Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ nm(1) — Sun WorkShop 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(1V)

as(1)

nm(1)

cc(1V)

ld(1)

tmpnam(3S)

a.out(5)

ar(5)

coff(5)

NM(1)  —  USER COMMANDS

NAME

nm − print name list

SYNOPSIS

nm [ −gnoprsuaC ] [ [ filename ] ...

DESCRIPTION

nm prints the name list (symbol table) of each object filename in the argument list.  If an argument is an archive, a listing for each object file in the archive will be produced.  If no filename is given, the symbols in a.out are listed. 

Output Format

Each symbol name is preceded by its value (blanks if undefined) and one of the letters:

A absolute

B bss segment symbol

C common symbol

D data segment symbol

f filename

t a static function symbol

T text segment symbol

U undefined

− debug, giving symbol table entries (see −a below)

The type letter is upper case if the symbol is external, and lower case if it is local.  The output is sorted alphabetically. 

OPTIONS

−a Print all symbols. 

−C Demangle symbols as if they are C++ names. 

−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 Do not sort; print in symbol-table order. 

−r Sort in reverse order. 

−s Sort according to the size of the external symbol (computed from the difference between the value of the symbol and the value of the symbol with the next higher value).  This difference is the value printed. 

−u Print only undefined symbols. 

Options 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 print the static and external symbols in name, with external symbols sorted by value.

EXAMPLE

example% nm

prints the symbol list of the file named a.out, the default output file for the C/C++ compiler(s). 

NOTE

Some C++ symbols contain file name information.  A SunOS file name path can contain characters (such as ‘.’ and ‘/’) that cannot be used to encode assembler symbols.  Those characters are transformed into ‘_’.  For example, ../stream_io.c is represented as ___stream_io_c in C++ mangled symbol.  nm does not second-guess or demangle ‘_’ in the file name path string. 

LIMITATIONS

The demangling scheme will not handle the functions that take more than 35 arguments. 

SEE ALSO

ar(1V), as(1), nm(1), cc(1V), ld(1), tmpnam(3S), a.out(5), ar(5), coff(5)

Sun Release 4.1  —  Last change: 4 April 1994

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