Sign in

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.

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 withTopicWhat differs
Linuxdifferent programs under one nameSolnix /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
Linuxoption sets share nothingSolnix 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
Linuxinteractive vs one-shotSolnix 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
Linuxfile operands and output fileSolnix 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
Linuxsetting header fieldsLinux 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)
Linuxx86 feature bitsLinux 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
Linuxbuilt-in helpSolnix 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
LinuxGNU alternative on SolnixThe 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

TaskSolnix
set the runpath of an ELF executableelfedit -e 'dyn:runpath $ORIGIN/../lib' infile outfile
read an ELF header field, read-onlyelfedit -r -onum -e 'ehdr:e_shnum' file
start an interactive ELF editing sessionelfedit infile
remove the SSE3 hardware capability bitelfedit -e 'cap:hw1 -and -cmp sse3' file

Standards

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/elfedit only for illumos -e command 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.