nm(1) MAXION/OS 1.2v9 nm(1)
NAME
nm - print name list of an object file
SYNOPSIS
nm [ -oxhvnefurplVT ] files
DESCRIPTION
The nm command displays the symbol table of each ELF object
file, specified by file(s). The file may be a relocatable
or absolute ELF object file; or it may be an archive of
relocatable or absolute ELF object files or an ELF shared
object. For each symbol, the following information will be
printed:
Index The index of the symbol. (The index appears in
brackets.)
Value The value of the symbol is one of the following: a
section offset for defined symbols in a relocatable
file; alignment constraints for symbols whose sec-
tion index is SHN_COMMON; a virtual address in exe-
cutable and shared object files.
Size The size in bytes of the associated object.
Type A symbol is of one of the following types: NOTYPE
(no type was specified), OBJECT (a data object such
as an array or variable), FUNC (a function or other
executable code), SECTION (a section symbol), or
FILE (name of the source file).
Bind The symbol's binding attributes. LOCAL symbols
have a scope limited to the object file containing
their definition; GLOBAL symbols are visible to all
object files being combined; and WEAK symbols are
essentially global symbols with a lower precedence
than GLOBAL.
Other A field reserved for future use, currently contain-
ing 0.
Shndx Except for three special values, this is the sec-
tion header table index in relation to which the
symbol is defined. The following special values
exist: ABS indicates the symbol's value will not
change through relocation; COMMON indicates an
unallocated block and the value provides alignment
constraints; and UNDEF indicates an undefined sym-
bol.
Name The name of the symbol.
1
nm(1) MAXION/OS 1.2v9 nm(1)
The output of nm may be controlled using the following
options:
-o Print the value and size of a symbol in octal
instead of decimal.
-x Print the value and size of a symbol in hexadecimal
instead of decimal.
-h Do not display the output heading data.
-v Sort external symbols by value before they are
printed.
-n Sort external symbols by name before they are
printed.
-e See NOTICES below.
-f See NOTICES below.
-u Print undefined symbols only.
-r Prepend the name of the object file or archive to
each output line.
-p Produce easily parsable, terse output. Each symbol
name is preceded by its value (blanks if undefined)
and one of the letters U (undefined), N (symbol has
no type), D (data object symbol), T (text symbol),
S (section symbol), or F (file symbol). If the
symbol's binding attribute is LOCAL, the key letter
is lower case; if the symbol's binding attribute is
WEAK, the key letter is upper case; if the -l
modifier is specified, the upper case key letter is
followed by a *; if the symbol's binding attribute
is GLOBAL, the key letter is upper case.
-l Distinguish between WEAK and GLOBAL symbols by
appending a * to the key letter for WEAK symbols.
-V Print the version of the nm command executing on
the standard error output.
-T See NOTICES below.
Options may be used in any order, either singly or in combi-
nation, and may appear anywhere in the command line. When
conflicting options are specified (such as nm -v -n) the
first is taken and the second ignored with a warning message
to the user.
2
nm(1) MAXION/OS 1.2v9 nm(1)
REFERENCES
a.out(4), ar(4), as(1), cc(1), dump(1), ld(1)
NOTICES
The following options are obsolete because of changes to the
object file format and will be deleted in a future release.
-e Print only external and static symbols. The symbol
table now contains only static and external sym-
bols. Automatic symbols no longer appear in the
symbol table. They do appear in the debugging
information produced by cc -g, which may be exam-
ined using dump(1).
-f Produce full output. Redundant symbols (such as
.text, .data, etc). which existed previously do not
exist and producing full output will be identical
to the default output.
-T By default, nm prints the entire name of the sym-
bols listed. Since symbol names have been moved to
the last column, the problem of overflow is removed
and it is no longer necessary to truncate the sym-
bol name.
Modified, August 1996
3