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.
The manual pages
- Solnix: readelf(1) from
pkgs.solnix.binutils - Linux: readelf(1) binutils-2.46
- FreeBSD: readelf(1) 15.1-RELEASE
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 with | Topic | What differs |
|---|---|---|
| Linux | same program | The 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 |
| FreeBSD | implementation | FreeBSD 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 |
| FreeBSD | no-option invocation | Solnix 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 contents | On 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 meaning | Solnix -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 symbols | On 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 lists | FreeBSD --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 -t | On 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 |
| FreeBSD | missing options | FreeBSD 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 |
| FreeBSD | FreeBSD-only options | FreeBSD 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 |
| FreeBSD | stdin and exit status | FreeBSD 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 meaning | On 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,-xand-p, using long forms like--dyn-syms. Avoid-w,-D,-L,-Rand-j, which FreeBSD's readelf does not document. - Always pass at least one display option, since GNU readelf requires one besides
-vor-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.