ELFCTL(1)
π elfctl β aka the little tool that flips feature flags in ELF binaries π
hii bestie, welcome to the General Commands Manual page for elfctl β yes that's the manual name, and yes we're getting into it π«Ά
β¨ NAME β¨
elfctl β change an ELF binary's feature control note
πΈ SYNOPSIS πΈ
elfctl [-h | --help] [-i] [-l] [-e featurelist] file ...
π DESCRIPTION π
Okay so, the elfctl utility modifies feature flags in the feature control note inside an ELF binary. That's the whole vibe. You point it at an ELF binary, it goes in and edits (or just shows you) the feature control note. Iconic behavior honestly π«
π OPTIONS π
Here's the options menu, bestie, and yes you should read all of them:
-h|--helpβ prints a usage message and then dips out (exits). That's it. Low maintenance king π-iβ ignore unknown feature flags in featurelist. So like, if something in your list isn't a thing,-iis gonna be like "whatever, moving on" instead of getting mad π-lβ list the known ELF feature flags. Just, like, shows you the whole menu of what exists π₯-efeaturelist β edit features from the given comma separated list featurelist. And here's the important part, bestie: featurelist starts with one of the three operations:+β turn on the features-β turn off the features=β only turn on the given features
After that operation comes a comma separated list of feature names or numeric values. So it's like <operation><names or numbers> β our classic little pipeline of chaos π¦
If-eis not specified,elfctldisplays the status of each feature in the ELF note in each file .... (yes, the four dots are staying, I don't make the rules β¨)
π EXIT STATUS π
Exit status is 0 on success, and 1 if the command fails β specifically if a file does not exist, is too short, or it fails to find or edit the features note. That's the whole drama scale: 0 or 1. No in-between, no 42, nothing π
π§ EXAMPLES π§
The following is an example of a typical usage of the elfctl command:
elfctl file
elfctl -e +noaslr file
Features may be specified as numerical values:
elfctl -e =0x0001,0x0004 file
Features may also be specified as a single combined value:
elfctl -e =0x5 file
See? Same thing, different spelling. Slay for flexibility honestly π
β NOTES β
Hii so this part is important, pay attention bestie:
On amd64, on a machine with LA57 (5-level paging) mode supported and enabled, if both la57 and la48 feature flags are specified, the la57 feature has priority over la48. Yeah. la57 wins. It's giving main character energy π
Also: the vm.pmap.prefer_uva_la48 sysctl MIB defines the default user address space size for binaries which do not set either of these flags. So if you set neither, that's the one calling the shots π
π¦ SEE ALSO π¦
mitigations(7) β go read it, iykyk π
π HISTORY π
elfctl first appeared in FreeBSD 12.2. A legend from birth honestly πΈ
π AUTHORS π
elfctl was written by Bora Ozarslan borako.ozarslan@gmail.com under sponsorship from the FreeBSD Foundation. We love a sponsored icon π«Άπ
ok that's the whole page bestie, go edit some notes, and remember: keep every flag exactly as written, no cap π₯π
with love, from the Debian crew β this page is dated October 5, 2023 β¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright 2019 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms