NM(1) General Commands Manual NM(1)
nm - print symbol name list
nm [ -gnoprsua ] [ [ filename ] ...
nm prints the name list (symbol table) of each object filename in the
argument list. If an argument is an archive, a listing for each object
file in the archive will be produced. If no filename is given, the
symbols in a.out are listed.
Each symbol name is preceded by its value (blanks if undefined) and one
of the letters:
B bss segment symbol
C common symbol
D data segment symbol
t a static function symbol
T text segment symbol
- debug, giving symbol table entries (see -a below)
The type letter is upper case if the symbol is external, and lower case
if it is local. The output is sorted alphabetically.
-a Print all symbols.
-g Print only global (external) symbols.
-n Sort numerically rather than alphabetically.
-o Prepend file or archive element name to each output line rather
than only once.
-p Do not sort; print in symbol-table order.
-r Sort in reverse order.
-s Sort according to the size of the external symbol (computed from
the difference between the value of the symbol and the value of
the symbol with the next higher value). This difference is the
-u Print only undefined symbols.
prints the symbol list of the file named a.out, the default output file
for the C, compiler.
ar(1V), as(1), cc(1V), ld(1), tmpnam(3S), a.out(5), ar(5), coff(5)
To see what is in a shared library, run nm on the static (.a) version.
When all the symbols are printed, they must be printed in the order
they appear in the symbol table in order to preserve scoping informa-
tion. Therefore, the -v and -n options should be used only in conjunc-
tion with the -e option.
7 September 1989 NM(1)