Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

ld(1)

crt0(3)

end(3C)

nm_800(1)  —  Series 700/800 Implementation

NAME

nm − print name list of object file

SYNOPSIS

nm [−hnoprxuvTV] file ...

DESCRIPTION

The nm command displays the symbol table of each object file file.  file can be a relocatable or absolute common object file, or it can be an archive of relocatable or absolute common object files.  For each symbol, at least the following information is printed:

Name The name of the symbol. 

Value Its value expressed as an offset or an address depending on its storage class. 

Scope The scope of the symbol (undefined, static, sdef, or external).  The “sdef” scope indicates an external symbol that is flagged as a secondary definition. 

Type The type of the symbol (code, data, common, absolute, etc.). 

Subspace The subspace to which the symbol belongs. 

The output of nm can be controlled using the following options:

−e Print only external and static symbols.  This is the normal behavior, so this option is ignored. 

−f Produce full output.  This is the normal behavior, so this option is ignored. 

−h Do not display the output header data. 

−n Sort symbols by name, in ascending collation order, before they are printed (see Environment Variables below).

−o Print the value and size of a symbol in octal instead of decimal. 

−p Produce easily parsable, terse output.  Each symbol name is preceded by its value (blanks if undefined) and one of the letters U (undefined), A (absolute), T (text symbol), D (data symbol), B (bss symbol), or C (common symbol).  If the symbol is local (non-external), the type letter is in lowercase.  If the symbol is a secondary definition, the type letter is followed by the letter S. 

−r Prefix each output line with the name of the object file or archive. 

−u Print undefined symbols only. 

−v Sort symbols by value before they are printed. 

−x Print the value and size of a symbol in hexadecimal instead of decimal. 

−T 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.  The −T option causes nm to truncate every name that would otherwise overflow its column and place an asterisk as the last character in the displayed name to mark it as truncated. 

−V Print the version of the nm command executing on the standard error output. 

EXTERNAL INFLUENCES

Environment Variables

LC_COLLATE determines the collating order output by the −n option. 

If LC_COLLATE is not specified in the environment or is set to the empty string, the value of LANG is used as a default.  If LANG is not specified or is set to the empty string, a default of “C” (see lang(5)) is used instead of LANG.  If any internationalization variable contains an invalid setting, nm behaves as if all internationalization variables are set to “C” (see environ(5)).

International Code Set Support

Single-byte character code sets are supported. 

SEE ALSO

cc(1), ld(1), crt0(3), end(3C). 

STANDARDS CONFORMANCE

nm: SVID2, XPG2, XPG3

Hewlett-Packard Company  —  HP-UX Release 9.03: April 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026