readelf(1) on Solnix vs Linux and the BSDs

readelf is not in the Solnix base system: install pkgs.solnix.binutils to get GNU binutils readelf. Its page matches the Linux binutils page, so the real differences are with FreeBSD, whose readelf(1) is llvm-readelf with a different option set.

What Solnix runs

Not installed by default: add pkgs.solnix.binutils. The bundle names no other readelf variant shipped with illumos, and the header lists none.

Differences

Compared withTopicWhat differs
Linuxsame programThe Solnix page is the GNU binutils readelf page, and its SYNOPSIS and the start of OPTIONS read the same as the Linux page. The Linux flag list has --enable-follow-debug-links and --relocations, which the Solnix list does not show. The Solnix text is trimmed, so this may be an extraction gap.
Source: Solnix readelf(1) SYNOPSIS, OPTIONS; Linux readelf(1) SYNOPSIS, OPTIONS; option flag lists in the header
FreeBSDimplementationFreeBSD readelf(1) documents llvm-readelf, the LLVM tool, not GNU readelf. Its synopsis is llvm-readelf [options] [input...]. Solnix, after installing the package, runs GNU binutils readelf.
Source: FreeBSD readelf(1) NAME, SYNOPSIS; Solnix readelf(1) NAME, SYNOPSIS
FreeBSDno-option invocationSolnix readelf requires at least one option besides -v or -H. The FreeBSD page has no such statement. It documents -a as 'all the main display options relevant to the file format'.
Source: Solnix readelf(1) OPTIONS (first paragraph); FreeBSD readelf(1) --all
FreeBSD-a contentsOn Solnix, -a is defined as a fixed list: file header, program headers, sections, symbols, relocs, dynamic, notes, got-contents, version-info, arch-specific, unwind, section-groups, histogram. FreeBSD only says 'all the main display options relevant to the file format'.
Source: Solnix readelf(1) -a; FreeBSD readelf(1) --all
FreeBSD-e meaningSolnix -e is -h -l -S. FreeBSD --headers/-e is --file-header, --program-headers and --sections, so the two are the same set.
Source: Solnix readelf(1) -e; FreeBSD readelf(1) --headers
FreeBSD-s and dynamic symbolsOn Solnix, -s shows the symbol table, and dynamic symbols need --dyn-syms. On FreeBSD with GNU output style, -s also shows the dynamic symbol table.
Source: Solnix readelf(1) -s, --dyn-syms; FreeBSD readelf(1) --symbols
FreeBSD-x, -p take listsFreeBSD --hex-dump and --string-dump accept a comma-separated section list. The Solnix synopsis shows a single <number or name> per -x or -p.
Source: Solnix readelf(1) SYNOPSIS -x, -p; FreeBSD readelf(1) --hex-dump, --string-dump
FreeBSD-W and -tOn FreeBSD, -W is ignored because output is already like GNU -W. Solnix has -W/--wide. FreeBSD -t is described as an alternative to --sections, while Solnix -t implies -S.
Source: Solnix readelf(1) -t, SYNOPSIS -W; FreeBSD readelf(1) --wide, --section-details
FreeBSDmissing optionsFreeBSD has no documented -D, -L, -w/--debug-dump, -R, -j, -z, -c, -P, -U, -X, -T, --ctf*, --sframe, --got-contents, --lto-syms or --sym-base. Solnix documents all of these in the synopsis.
Source: Solnix readelf(1) SYNOPSIS; FreeBSD readelf(1) OPTIONS and option flag list
FreeBSDFreeBSD-only optionsFreeBSD adds options such as --elf-output-style=LLVM|GNU|JSON, --pretty-print, --needed-libs, --dependent-libraries, --stack-sizes, --addrsig, --hash-table, --gnu-hash-table and @FILE response files. They are not in the Solnix synopsis.
Source: FreeBSD readelf(1) --elf-output-style, --needed-libs, --stack-sizes, @<FILE>; Solnix readelf(1) SYNOPSIS
FreeBSDstdin and exit statusFreeBSD llvm-readelf reads standard input if the input is '-', and exits non-zero on any error. The Solnix text does not document either.
Source: FreeBSD readelf(1) DESCRIPTION, EXIT STATUS; Solnix readelf(1) DESCRIPTION
FreeBSD-v meaningOn Solnix, -v/--version prints the version. FreeBSD has only --version, and -v is not listed there.
Source: Solnix readelf(1) SYNOPSIS -v; FreeBSD readelf(1) --version

Standards

  • POSIX: readelf is not a POSIX.1-2024 utility.

Writing portable scripts

  • Stick to the common core: -h, -l, -S, -s, -d, -r, -n, -V, -x and -p, using long forms like --dyn-syms. Avoid -w, -D, -L, -R and -j, which FreeBSD's readelf does not document.
  • Always pass at least one display option, since GNU readelf requires one besides -v or -H.

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.