COHERENT manpages
This page displays the COHERENT manpage for nm [Print a program's symbol table].
List of available manpages
Index
nm -- Command
Print a program's symbol table
nm [ -adgnopru ] file ...
The command nm prints the symbol table of each file. It can read binary
files produced by the compiler, assembler, or linker.
When a C source file is compiled with the -c switch to the cc command, or
when a file of assembly language is assembled, the result is an object
module, which is signified by the suffix .o.
The linker ld links multiple object modules to form an executable program.
Frequently used object modules often are grouped by the archiver ar into a
library, which is signified by the suffix .a. nm can read all three kinds
of files: .o, .a, and fully linked executables.
Options
nm recognizes the following options:
-a (COHERENT 286 only)
Print all symbols. Normally, nm prints names that are in C-style format
and ignores symbols with names inaccessible from C programs.
-d Print only defined symbol.
-g Print only global symbols.
-n Sort numerically rather than alphabetically. nm uses unsigned compares
when sorting symbols with this option.
-o Append the file name to the beginning of each output line.
-p Print symbols in the order in which they appear within the symbol table.
-r Sort in reverse-alphabetical order.
-u Print only undefined symbols.
Output Format
The output of nm is a series of lines of the form:
segment address symbol
segment gives the segment in which the symbol appears, or UNDEF for
undefined symbols. address is either the address in hexadecimal, or the
length of a common variable. symbol names the symbol.
For example, if foo.o is a relocatable object module, the output of the
command nm -o foo.o would appears as follows:
#nm foo.o
UNDEF 00000000 _canl
UNDEF 00000000 _stderr
.text 0000077C acomp
.text 00000034 acomp_old
UNDEF 00000000 alloc
.text 00000F28 archive
.comm 00000004 asw
.text 000003CC csymbol
.comm 00000004 dsw
See Also
cc,
commands,
ld,
size,
strip









