Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ nm(1) — A/UX 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

as(1)

cc(1)

ld(1)

a.out(4)

ar(4)




nm(1) nm(1)
NAME nm - display the symbol table of a common object file SYNOPSIS nm [-d] [-e] [-f] [-h] [-n] [-o] [-T] [-u] [-v] [-V] [-x] file ... DESCRIPTION The nm command displays the symbol table of each common ob- ject file filename. filename may be a relocatable or abso- lute common object file, or it may be an archive of relocat- able or absolute common object files. nm prints the follow- ing information for each symbol. Note that the object file must have been compiled with the -g flag option of the cc(1) command for there to be type, size, or line information. name The name of the symbol. value Its value expressed as an offset or an address depend- ing on its storage class. class Its storage class. tv If the symbol is accessed through a transfer vector, this field contains tv. type Its type and derived type. If the symbol is an in- stance of a structure or a union, the structure or un- ion tag is given following the type (e.g., struct-tag). If the symbol is an array, the array dimensions are given following the type (e.g., char[n] [m]). size Its size in bytes, if available. line The source line number at which it is defined, if available. section For storage classes static and external, the object file section containing the symbol (e.g., text, data, or bss). FLAG OPTIONS The output of nm may be controlled using the following flag options: -d Print the value and size of a symbol in decimal (the default). -o Print the value and size of a symbol in octal in- April, 1990 1



nm(1) nm(1)
stead of decimal. -x Print 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 printed. -n Sort external symbols by name before they are printed. -e Print only static and external symbols. -f Produce full output. Redundant symbols (.test, .data, .bss), normally suppressed, are printed. -u Print undefined symbols only. -V Print the version of the nm command executing on the standard error output. -T Truncate long names. By default, nm prints the en- tire 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, forcing every column after the name to be misaligned. The -T flag option causes nm to trun- cate 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. Flag 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. FILES /bin/nm SEE ALSO as(1), cc(1), ld(1), a.out(4), ar(4). WARNINGS When all the symbols are printed, they must be printed in the order they appear in the symbol table in order to preserve scoping information. Therefore, the -v and -n flag options should be used only in conjunction with the -e flag option. 2 April, 1990



nm(1) nm(1)
DIAGNOSTICS nm: name: cannot open name cannot be read. nm: name: bad magic name is not an appropriate common object file. nm: name: no symbols The symbols have been stripped from name. April, 1990 3

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