elfctl(1)

elfctl1

Change an elf binary's feature control note

Usage

elfctl [{-h | --help}] [-i] [-l] [-e featurelist] file ...

Overview

The elfctl utility modifies feature flags in the feature control note in an ELF binary.

The options are as follows:

-h | --help

Print a usage message and exit.

-i

Ignore unknown feature flags in featurelist.

-l

List known ELF feature flags.

-e featurelist

Edit features from the given comma separated list featurelist. featurelist starts with one of the three operations: “+” to turn on the features, “-” to turn off the features, “=” to only turn on the given features. A comma separated list of feature names or numeric values follows the operation.

If -e is not specified elfctl displays the status of each feature in the ELF note in each file ....

Exit status

Exit status is 0 on success, and 1 if the command fails if a file does not exist, is too short, or fails to find or edit features note.

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

Notes

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. 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.

Releases

18 releases since FreeBSD 12.2-RELEASE; the text changed 9 times.

  1. 12.2
  2. 12.3
  3. 12.4
  4. 13.0
  5. 13.1–13.2
  6. 13.3–13.5
  7. 14.0–14.2
  8. 14.3
  9. 14.4–15.1
  10. 16.0

-i since FreeBSD 12.3-RELEASE.

History

elfctl first appeared in FreeBSD 12.2.

Authors

elfctl was written by Bora Ozarslan ⟨[email protected]⟩ under sponsorship from the FreeBSD Foundation.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.