Name

nm

Synopsis

nm [options] [objfiles]

Print the symbol table in alphabetical order from one or more object files. If no object files are specified, perform operations on a.out. Output includes each symbol’s value, type, size, name, and so on. A key letter categorizing the symbol can also be displayed.

Options

-a, --debug-syms

Print debugger symbols.

--defined-only

Display only defined symbols.

-f format, --format=format

Specify output format (bsd, sysv, or posix). Default is bsd.

-g, --extern-only

Print external symbols only.

--help

Print help message, then exit.

-l, --line-numbers

Print source filenames and line numbers for each symbol from available debugging information.

-n, -v, --numeric-sort

Sort the external symbols by address.

-p, --no-sort

Don’t sort the symbols at all.

-r, --reverse-sort

Sort in reverse, alphabetically or numerically.

-s, --print-armap

Include mappings stored by ar and ranlib when printing archive symbols.

--size-sort

Sort by size.

-t radix, --radix=radix

Use the specified radix for printing symbol values. Accepted values are d for decimal, o for octal, and x for hexadecimal.

--target=format

Specify an object code format other than the system default.

-u, --undefined-only

Report only the undefined symbols.

-A, -o, --print-file-name

Print input filenames before each symbol.

-B

Same as --format=bsd.

-C, --demangle[=style]

Translate low-level symbol names into readable versions. You may specify a style to use when demangling symbol names from a foreign compiler.

-D, --dynamic

Print dynamic, not ...

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.