NM(1)

NAME
nm - print symbol name list

SYNOPSIS
nm [ -gnoprsua ] [ [ filename ] ...

DESCRIPTION
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.

  Output Format

Each symbol name is preceded by its value (blanks if undefined) and one of the letters:

A   absolute

B   bss segment symbol

C   common symbol

D   data segment symbol

f   filename

t   a static function symbol

T   text segment symbol

U   undefined

-   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.

OPTIONS

-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 value printed.

-u  Print only undefined symbols.

EXAMPLE

    example% nm

prints the symbol list of the file named a.out, the default output file for the C, compiler.

SEE ALSO
ar(1V), as(1), cc(1V), ld(1), tmpnam(3S), a.out(5), ar(5), coff(5)

BUGS

To see what is in a shared library, run nm on the static (.a) version.

Sun386i BUGS
When all the symbols are printed, they must be printed in the order they appear in the symbol table in order to preserve scoping information. Therefore, the -v and -n options should be used only in conjunction with the -e option.