elfedit
Update ELF file headers and x86 feature notes
TLDR
SYNOPSIS
elfedit [options] elffile...
DESCRIPTION
elfedit updates fields in the ELF header, and on builds that support it, x86 feature bits in the GNU property note. It is part of GNU binutils.Pass at least one output option or one x86-feature option. Input options only narrow which files are changed. 32-bit and 64-bit ELF files are accepted, including ELF members inside archives.The machine name x86-64 is the form to type. The same parser also accepts the underscore spelling.Feature options are compiled in when binutils was built with mmap support. A build without them rejects those flags.
PARAMETERS
--input-mach machine
Match only files whose ELF machine is machine. Without this option, every machine matches. Names are case-insensitive. Accepted names include none, i386, iamcu, l1om, k1om, and x86-64.--output-mach machine
Write machine into the ELF header. Same names as --input-mach.--input-type type
Match only files of this ELF type. Without this option, every type matches. Names: none, rel, exec, dyn.--output-type type
Write type into the ELF header. Same names as --input-type.--input-osabi osabi
Match only files with this OS ABI. Without this option, every OS ABI matches. Names are case-insensitive. Linux is an alias of GNU. elfedit --help prints the names that build accepts. The binutils manual documents none, HPUX, NetBSD, GNU, Solaris, AIX, Irix, FreeBSD, TRU64, Modesto, OpenBSD, OpenVMS, NSK, AROS, and FenixOS.--output-osabi osabi
Write osabi into the ELF header. Same names as --input-osabi.--input-abiversion 0-255
Match only files with this ABI version.--output-abiversion 0-255
Write this ABI version into the ELF header.--enable-x86-feature feature
Turn on one x86 feature in the GNU property note. Enabling a feature clears it from the disable mask. Tokens are exact:
Turn off one x86 feature. Same tokens as --enable-x86-feature. Disabling a feature clears it from the enable mask.-h, --help
Show help and exit.-v, --version
Show the version and exit.@file
Read more options from file. The file may itself contain @file options.
INSTALL
CAVEATS
Changing the machine, type, or OS ABI does not rewrite the rest of the file. A header that no longer matches the body will not load.Feature names have no hyphen alias. Type them exactly, inside a context that does not treat underscores as emphasis.
