nm(1) on Solnix vs Linux and the BSDs
On Solnix, nm is the illumos nm at /usr/bin/nm, which reads ELF objects with single-letter flags that clash with GNU and BSD nm. Its -o means octal, -r prepends the file name, -n sorts by name, -s prints section names and -p gives terse output.
The manual pages
- Solnix: nm(1) from
pkgs.solnix.illumos-world-man; the default on Solnix · illumos.org - Solnix: gnm(1) (its page calls it nm) from
pkgs.solnix.binutils; add the package to get it - Linux: nm(1) binutils-2.46
- FreeBSD: nm(1) 15.1-RELEASE
- OpenBSD: nm(1) 8.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
nm
What Solnix runs
A default Solnix system runs the illumos nm at /usr/bin/nm. /usr/xpg4/bin/nm is also shipped with the same synopsis; the documented difference is -u, where /usr/bin/nm prints undefined symbols only and the xpg4 version prints a long listing for each. GNU nm is available from pkgs.solnix.binutils, installed as gnm; its page calls it nm.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | gnm is Linux's nm | The binutils gnm page has the same synopsis and options as the Linux binutils nm page: it is the same program. Scripts written for Linux nm should call gnm on Solnix, not /usr/bin/nm.Source: Solnix gnm(1) from pkgs.solnix.binutils SYNOPSIS, OPTIONS; Linux nm(1) SYNOPSIS, OPTIONS |
| Linux, FreeBSD, OpenBSD | -o meaning | Solnix nm -o prints values and sizes in octal, the same as -t o. On Linux and FreeBSD, -o is the same as -A and puts the file name on each line; OpenBSD -o shows the object's name on every line, similar to -A.Source: illumos nm(1) -o; Linux nm(1) -A, -o; FreeBSD nm(1) --print-file-name, -A, -o; OpenBSD nm(1) -o |
| Linux, FreeBSD, OpenBSD | -r meaning | Solnix nm -r prepends the object file or archive name to each output line. FreeBSD and OpenBSD -r reverses the sort order, and the Linux synopsis lists -r as --reverse-sort.Source: illumos nm(1) -r; FreeBSD nm(1) --reverse-sort, -r; OpenBSD nm(1) -r; Linux nm(1) SYNOPSIS |
| Linux, FreeBSD, OpenBSD | -n sorting | Solnix nm -n sorts external symbols by name and -v by value. FreeBSD -n and -v both sort by address, and the Linux synopsis lists -n and -v as --numeric-sort. OpenBSD -n gives numerical order.Source: illumos nm(1) -n, -v; FreeBSD nm(1) --numeric-sort, -n, -v; Linux nm(1) SYNOPSIS; OpenBSD nm(1) -n |
| Linux, FreeBSD, OpenBSD | -p meaning | Solnix nm -p gives terse, easy-to-parse output with a type letter per symbol; its unsorted option is -i. FreeBSD and OpenBSD -p means no sorting, and the Linux synopsis lists -p as --no-sort.Source: illumos nm(1) -p, -i; FreeBSD nm(1) --no-sort, -p; OpenBSD nm(1) -p; Linux nm(1) SYNOPSIS |
| Linux, FreeBSD, OpenBSD | -s meaning | Solnix nm -s prints the section name instead of the section index. OpenBSD -s shows the archive index, the Linux synopsis lists -s as --print-armap, and FreeBSD documents --print-armap with no -s.Source: illumos nm(1) -s; OpenBSD nm(1) -s; Linux nm(1) SYNOPSIS; FreeBSD nm(1) --print-armap |
| Linux, FreeBSD | -h meaning | Solnix nm -h suppresses the output heading. FreeBSD -h prints help, and the Linux synopsis lists -h as --help.Source: illumos nm(1) -h; FreeBSD nm(1) --help, -h; Linux nm(1) SYNOPSIS |
| Linux | -l meaning | Solnix nm -l appends * to the type letter of weak symbols. The Linux synopsis lists -l as --line-numbers.Source: illumos nm(1) -l; Linux nm(1) SYNOPSIS |
| Linux, FreeBSD, OpenBSD | numeric radix default and -t | Solnix -t takes d, o or x and defaults to decimal. Linux prints values in hexadecimal by default, and FreeBSD's default BSD format prints an 8-digit hex address. OpenBSD's -t applies only to POSIX-format output.Source: illumos nm(1) -t format; Linux nm(1) DESCRIPTION; FreeBSD nm(1) DESCRIPTION; OpenBSD nm(1) -t |
| OpenBSD | -e meaning | Solnix nm -e is deprecated and has no effect. OpenBSD -e outputs extended information: w for weak symbols, f for function-like and o for object-like.Source: illumos nm(1) -e, NOTES; OpenBSD nm(1) -e |
| Linux, FreeBSD | long options and extra flags | Solnix nm has no long options and none of -S, -a, -U, -W, -j or -B, which Linux and FreeBSD both document.Source: illumos nm(1) SYNOPSIS; Linux nm(1) SYNOPSIS; FreeBSD nm(1) OPTIONS |
| FreeBSD | exit status | The FreeBSD page is llvm-nm, whose EXIT STATUS says it exits with code zero. Solnix nm returns >0 on error, and reports a file with no symbol table without treating it as an error. Source: FreeBSD nm(1) EXIT STATUS; illumos nm(1) DESCRIPTION, EXIT STATUS |
Everyday tasks
| Task | Solnix | Linux | FreeBSD | OpenBSD |
|---|---|---|---|---|
| list the symbols of an object file | nm file | nm file | llvm-nm file | nm file |
| show the dynamic symbol table | nm -D file | nm -D file | llvm-nm -D file | nm -D file |
| demangle C++ symbol names | nm -C file | nm -C file | llvm-nm -C file | nm -C file |
| show only external (global) symbols | nm -g file | nm -g file | llvm-nm -g file | nm -g file |
| show only undefined symbols | nm -u file | — | llvm-nm -u file | nm -u file |
| print the file name on every symbol line | nm -A file | nm -A file | llvm-nm -A file | nm -A file |
| sort symbols by address (value) | nm -v file | nm -n file | llvm-nm -n file | nm -n file |
| list symbols in table order, unsorted | nm -i file | nm -p file | llvm-nm -p file | nm -p file |
| print symbol values in hexadecimal | nm -t x file | nm -t x file | llvm-nm -t x file | nm -P -t x file |
Standards
- POSIX: nm is a POSIX.1-2024 utility.
- Solnix: The
/usr/xpg4/bin/nmATTRIBUTES table lists Interface Stability: Committed. - OpenBSD: The nm utility is part of the IEEE Std 1003.1-2008 (“POSIX.1”) specification; this implementation is largely incompatible with that standard.
Writing portable scripts
- Avoid
-o,-r,-n,-p,-s,-hand-fin portable scripts: each means something different on Solnix nm than on GNU or BSD nm. Use-Pwith an explicit-tradix, since the default radix differs. - Use
-gfor external symbols and-ufor undefined symbols. Their meanings match across the pages, but the Solnix/usr/bin/nmand/usr/xpg4/bin/nmoutputs for-udiffer.
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.