nm(1) CLIX nm(1)
NAME
nm - Displays name list of common object file
SYNOPSIS
nm [-oxhvnefurpVT] filename ...
FLAGS
-o Display the value and size of a symbol in octal instead of decimal.
-x Display the value and size of a symbol in hexadecimal instead of
decimal.
-h Do not display the output header data.
-v Sort external symbols by value before they are displayed.
-n Sort external symbols by name before they are displayed.
-e Display only external and static symbols.
-f Produce full output. Display redundant symbols (.text, .data, .lib,
and .bss), normally suppressed.
-u Display undefined symbols only.
-r Prepend the name of the object file or archive to each output line.
-p Produce easily parsable, terse output. If a symbol is local
(nonexternal), the type letter is in lowercase. Each symbol name is
preceded by its value (blanks if undefined) and one of the following
letters:
U (Undefined)
A (Absolute)
T (Text segment symbol),
D (Data segment symbol),
S (User defined segment symbol),
R (Register symbol),
F (File symbol)
C (Common symbol)
2/94 - Intergraph Corporation 1
nm(1) CLIX nm(1)
-V Displays the version of the m command executing on stderr.
-T By default, nm displays the entire name of the symbols listed. Since
object files can have symbols 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. The -T flag causes nm to truncate every
name which would otherwise overflow its column and place an asterisk
as the last character in the displayed name to mark it as truncated.
Flags may be used in any order, either singly or in combination, and may
appear anywhere in the command line. Therefore, both nm name -e -v and nm
-ve name display the static and external symbols in name, with external
symbols sorted by value.
DESCRIPTION
The nm command displays the symbol table of each common object file,
filename. The Filename may be a relocatable or absolute common object
file; or it may be an archive of relocatable or absolute common object
files. For each symbol, the following information is displayed:
Name The name of the symbol.
Value Its value expressed as an offset or an address depending on its
storage class.
Class Its storage class.
Type Its type and derived type. If the symbol is an instance of a
structure or of a union then the structure or union tag will be
given following the type (for example, struct-tag). If the
symbol is an array, then the array dimensions will be given
following the type (for example: char[n][m]). Note that the
object file must have been compiled with the -g flag of the cc
command for this information to appear.
Size Its size in bytes, if available. Note that the object file must
have been compiled with the -g flag of the cc command for this
information to appear.
Line The source line number at which it is defined, if available.
Note that the object file must have been compiled with the -g
flag of the cc command for this information to appear.
Section For storage classes static and external, the object file section
containing the symbol (for example: text, data, or bss).
EXAMPLES
The following displays the symbol table of the file a.out:
2 Intergraph Corporation - 2/94
nm(1) CLIX nm(1)
nm a.out
FILES
TMPDIR/* Temporary files
TMPDIR is usually /usr/tmp but can be redefined by setting the environment
variable TMPDIR (see tempnam() in tmpnam()).
NOTES
When all the symbols are displayed, they must be displayed in the order
they appear in the symbol table in order to preserve scoping information.
Therefore, the -v and -n flags should be used only in conjunction with the
-e flag.
DIAGNOSTICS
nm: name: cannot open
The name cannot be read.
nm: name: bad magic
if name is not a common object file.
nm: name: no symbols
if the symbols have been stripped from name.
EXIT VALUES
Exits with 0 if successful.
RELATED INFORMATION
Commands: acc(1), as(1), cc(1), ld(1)
Functions: tmpnam(3)
Files: a.out(4), ar(0)
2/94 - Intergraph Corporation 3