HP-UX Reference (11i v2 03/08) - 1 User Commands N-Z (vol 2)

n
nm(1) nm(1)
NAME
nm - print name list of common object file
SYNOPSIS
/usr/ccs/bin/nm
[-ACefghlnNqrsTuUvV
][-d-o
-x][-p-P][-t format ] file ...
DESCRIPTION
The
nm command displays the symbol table of each object file, file.
file can be a relocatable object file or an executable object file, or it can be an archive of relocatable or exe-
cutable object files.
There are three general output formats: the default (neither
-p nor -P specified), -p specified, and -P
specified. The output formats are described after the "Options" subsection.
By default,
nm prints the entire name of the symbols listed. Since object files can have symbol names
with an arbitrary number of characters, a name that is longer than the width of the column set aside for
names will overflow its column, forcing every column after the name to be misaligned.
Options
nm recognizes the following options:
-A Prefix each output line with the name of the object file or archive, file. Equivalent
to
-r.
-C Demangle C++ names before printing them (ELF only).
-d Display the value and size of a symbol in decimal. This is the default for the default
format or the -p format. Equivalent to -t d.
-e Display only external and static symbols. This option is ignored (see -f).
-f Display full output. This option is in force by default.
-g Display only external (global) symbol information.
-h Do not display the output header data.
-l Distinguish between weak and global symbols by appending * to the key letter of
weak symbols. Only takes effect with -p and/or -P.
-n Sort symbols by name, in ascending collation order, before they are printed. This is
the default. See "Environment Variables" in EXTERNAL INFLUENCES below.
-N Display symbols in the order in which they appear in the symbol table.
-o Display the value and size of a symbol in octal. Equivalent to -t o
.
-p Display information in a blank-separated output format. Each symbol name is pre-
ceded by its value (blanks if undefined) and a letter to indicate type. A lowercase
letter indicates a local (nonexternal) symbol.
A (absolute)
B (bss symbol)
C (common symbol)
D (data symbol)
M (milli symbol)
N (notype)
R (section region)
T (text symbol)
U (undefined)
If the symbol is a secondary definition, the type letter is followed by the letter
S.
Note that
-p is not compatible with -P.
-P Display information in a portable output format, as specified below, to standard out-
put. Note that -P is not compatible with -p.
Section 1632 Hewlett-Packard Company 1 HP-UX 11i Version 2: August 2003