NM(1) — UNIX Programmer’s Manual
NAME
nm − print name list
SYNOPSIS
nm [ −agnoprumx ] [ file ... ]
DESCRIPTION
Nm prints the name list (symbol table) of each object file in the argument list. If an argument is an archive, a listing for each object file in the archive will be produced. If no file is given, the symbols in "a.out" are listed.
Each symbol name is preceded by its value (blanks if undefined). Then if the −m option is not specified one of the letters U (undefined), A (absolute), T (text section symbol), D (data section symbol), B (bss section symbol), C (common symbol), f file name, − for debugger symbol table entries (see −a below), S (symbol in a section other than those above) or I (indirect symbol) is printed for the symbol type. If the symbol is local (non-external) the type letter is in lower case.
If the symbol is a Objective-C method the symbol name is printed as ±[<Class name> where a ‘+’ is used for class methods and a ‘−’ is used for instance methods. The output is sorted alphabetically.
Options are:
−a Print all symbol table entries including those inserted for use by debuggers.
−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 Don’t sort; print in symbol-table order.
−r Sort in reverse order.
−u Print only undefined symbols.
−m Print the N_SECT type symbols (Mach-O symbols) as (segment_name, section_name) followed by either external or non-external and then the symbol name. Also undefined, common, absolute and indirect symbols get printed as (undefined), (common) (absolute) and (indirect) respectively.
−x Print the symbol table entry’s fields in hex along with the name as a string.
−z Don’t print Objective-C method names instead print the compiler generated symbol names.
SEE ALSO
ar(1), ar(5), Mach-O(5), stab(5), nlist(3)
BUGS
Printing Mach-O symbols with −m is too verbose. Without the −m symbols in the Objective-C sections type’s get printed as an ‘s’.
4th Berkeley Distribution — June 1, 1989