The utility nm displays symbolic information appearing in the object file, executable file or object-file library named by file.
If no symbolic information is available for a valid input file, the nm utility will report that fact, but not consider it an error condition.
Syntax
nm[ -APv][ -efox][ -g| -u][ -t format] file... |
options:
Write the full pathname or library name of an object on each line.
Write only external (global) and static symbol information.
Produce full output. Write redundant symbols (.text, .data and .bss), normally suppressed.
Write only external (global) symbols.
Write numeric values in octal (equivalent to -t
Write information in a portable output file, as specified in Standard output.
Write each numeric value in the specified format. The format is dependent on the single character used as the format option-argument:
Write only undefined symbols.
Sort output by value instead of alphabetically.
Write numeric values in hexadecimal (equivalent to -t
A pathname of an object file, executable file or object-file library. |
Standard output
If symbolic information is present in the input files, for each file or for each member of an archive, the nm utility will write the following information to standard output:
Library or object name, if -A is specified.
Symbol name.
Symbol type, which is one of the following single characters:
A Global absolute symbol a Local absolute symbol B Global "bss" symbol b Local "bss" symbol D Global data symbol d Local data symbol T Global text symbol t Local text symbol U
Undefined symbol
Value of the symbol
The size in bytes associated with the symbol, if applicable.
If the -P option is specified, the previous information is displayed using the following portable format. The three versions differ depending on whether was specified in decimal, octal or hexadecimal format.
If -t is not specified, the format is as if -t
x has been specified.
|
where library-/object name is formatted as follows:
If -A is not specified, library-/objekt name is an empty string.
If -A is specified and the corresponding file operand does not name a library:
"%s: ",
fileIf -A is specified and the corresponding file operand names a library. In this case, object file names the object in the library containing the symbol being described:
"%s[%s]: ",
file,
objekt file
Locale
The following environment variables affect the execution of nm: LANG Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined. LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_COLLATE Determine the locale for character collation information for the symbol name and symbol-value collation sequence. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments and input files), the classification of characters as upper- to lower-case, and the mapping of characters from one case to the other. LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. |
See also
ar c89 [5] |