elfedit(1) on Solnix vs Linux and the BSDs
On Solnix, elfedit is the illumos interactive ELF editor at /usr/bin/elfedit, which runs module commands from -e or standard input. The Linux elfedit is a different program, the GNU binutils one-shot tool driven by options such as --output-mach, none of which the illumos page documents.
The manual pages
- Solnix: elfedit(1) from
pkgs.solnix.illumos-world-man; the default on Solnix · illumos.org - Solnix: gelfedit(1) (its page calls it elfedit) from
pkgs.solnix.binutils; add the package to get it - Linux: elfedit(1) binutils-2.46
What Solnix runs
A default Solnix system runs the illumos elfedit at /usr/bin/elfedit; no other illumos variants are shipped. GNU binutils elfedit is available from pkgs.solnix.binutils, installed as gelfedit; its page calls the command elfedit.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | different programs under one name | Solnix /usr/bin/elfedit is the illumos tool, which edits ELF metadata through modules (cap, dyn, ehdr, phdr, shdr, str, sym, syminfo, sys). Linux elfedit is GNU binutils and only updates the ELF header and x86 program property bits.Source: illumos elfedit(1) DESCRIPTION (modules); Linux elfedit(1) NAME, DESCRIPTION |
| Linux | option sets share nothing | Solnix documents -a, -d, -e, -L, -o and -r. Linux documents --input-mach, --input-type, --input-osabi, --input-abiversion, the matching --output-mach, --output-type, --output-osabi and --output-abiversion, the x86 feature options, -v, -h and @file. No option appears on both.Source: illumos elfedit(1) SYNOPSIS; Linux elfedit(1) SYNOPSIS, OPTIONS |
| Linux | interactive vs one-shot | Solnix elfedit reads commands from -e or standard input, with line editing and TAB completion on a terminal. Linux elfedit takes options and file names, and needs at least one of --output-mach, --output-type, --output-osabi, --output-abiversion, --enable-x86-feature or --disable-x86-feature.Source: illumos elfedit(1) DESCRIPTION, Syntax; Linux elfedit(1) OPTIONS |
| Linux | file operands and output file | Solnix takes an optional infile and outfile in its synopsis. Linux takes one or more elffile operands, which are updated, and the page also allows archives containing ELF files. Source: illumos elfedit(1) SYNOPSIS; Linux elfedit(1) SYNOPSIS, DESCRIPTION |
| Linux | setting header fields | Linux changes the machine, file type, OSABI and ABIVERSION with --output-mach, --output-type, --output-osabi and --output-abiversion. The illumos page documents no such option; it edits the ELF header through its ehdr module.Source: Linux elfedit(1) OPTIONS; illumos elfedit(1) DESCRIPTION (modules: ehdr) |
| Linux | x86 feature bits | Linux sets or clears ibt, shstk, lam_u48 and lam_u57 with --enable-x86-feature and --disable-x86-feature, on hosts with mmap support. The illumos page documents no such options.Source: Linux elfedit(1) --enable-x86-feature, --disable-x86-feature; illumos elfedit(1) SYNOPSIS |
| Linux | built-in help | Solnix elfedit has a help command (help module:command) that documents each module and command. The Linux page documents only -h/--help for its options.Source: illumos elfedit(1) Status And Command Documentation; Linux elfedit(1) -h, --help |
| Linux | GNU alternative on Solnix | The pkgs.solnix.binutils package installs GNU elfedit as gelfedit. Its page text matches the Linux elfedit(1) page (binutils-2.46), so Linux-style invocations belong to gelfedit on Solnix. Source: Solnix gelfedit(1) from pkgs.solnix.binutils OPTIONS; Linux elfedit(1) OPTIONS |
Everyday tasks
| Task | Solnix |
|---|---|
| set the runpath of an ELF executable | elfedit -e 'dyn:runpath $ORIGIN/../lib' infile outfile |
| read an ELF header field, read-only | elfedit -r -onum -e 'ehdr:e_shnum' file |
| start an interactive ELF editing session | elfedit infile |
| remove the SSE3 hardware capability bit | elfedit -e 'cap:hw1 -and -cmp sse3' file |
Standards
- POSIX: elfedit is not a POSIX.1-2024 utility.
Writing portable scripts
- Do not assume elfedit means the same program everywhere. On Solnix, call gelfedit (pkgs.solnix.binutils) for GNU-style
--output-* options, and use/usr/bin/elfeditonly for illumos-ecommand scripts.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.