nm(1) nm(1)NAME nm - displays the symbol table of a common object file SYNOPSIS nm [-d] [-e] [-f] [-h] [-n] [-o] [-T] [-u] [-v] [-V] [-x] file... ARGUMENTS -d Prints the value and size of a symbol in decimal (the default). -e Prints only static and external symbols. -f Produces full output. Redundant symbols (.test, .data, .bss), normally suppressed, are printed. file Specifies the common object file. -h Does not display the output header data. -n Sorts external symbols by name before they are printed. -o Prints the value and size of a symbol in octal instead of decimal. -T Truncates long names. 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, forcing every column after the name to be misaligned. The -T option 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. -u Prints undefined symbols only. -v Sorts external symbols by value before they are printed. -V Prints the version of the nm command executing on the standard error output. -x Prints the value and size of a symbol in hexadecimal instead of decimal. DESCRIPTION nm displays the symbol table of each common object file filename. The argument, filename, may be a relocatable or absolute common object file, or it may be an archive of relocatable or absolute common object files. The nm program January 1992 1
nm(1) nm(1)prints the following information for each symbol. Note that the object file must have been compiled with the -g 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 depending 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 instance of a structure or a union, the structure or union 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). 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. 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 options should be used only in conjunction with the -e option. STATUS MESSAGES AND VALUES nm: name: cannot open name cannot be read. nm: name: bad magic 2 January 1992
nm(1) nm(1)name is not an appropriate common object file. nm: name: no symbols The symbols have been stripped from name. FILES /bin/nm Executable file SEE ALSO as(1), cc(1), ld(1) a.out(4), ar(4) in A/UX Programmer's Reference January 1992 3