/usr/xpg4/bin/nm [ -AChlnPprRsTuVv ] [ -efox ] [ -g | -u ] [ -t format ] 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.
The output of nm may be controlled using the following options:
undefined
- A
- absolute symbol
- B
- bss (uninitialized data space) symbol
- D
- data object symbol
- F
- file symbol.
- N
- symbol has no type
- S
- section symbol
- T
- text symbol
- U
- LOCAL
- the key letter is lower case
- WEAK
- the key letter is upper case; if the -l modifier is specified, the upper case key letter is followed by a *
- GLOBAL
- the key letter is upper case.
- d
- The offset is written in decimal (default).
- o
- The offset is written in octal.
- x
- The offset is written in hexadecimal.
Options may be used in any order, either singly or in combination, and may appear anywhere in the command line. When conflicting options are specified (such as -v and -n; and -o and -x) the first is taken and the second ignored with a warning message to the user. (See -R for exception.)
For each symbol, the following information will be printed:
- a section offset for defined symbols in a relocatable file
- alignment constraints for symbols whose section index is SHN_COMMON
- a virtual address in executable and dynamic library files.
- NOTYPE
- no type was specified
- OBJECT
- a data object such as an array or variable
- FUNC
- a function or other executable code
- SECTION
- a section symbol
- FILE
- name of the source file.
- LOCAL
- have a scope limited to the object file containing their definition
- GLOBAL
- are visible to all object files being combined
- WEAK
- are essentially global symbols with a lower precedence than GLOBAL .
- ABS
- indicates the symbol’s value will not change through relocation
- COMMON
- indicates an unallocated block and the value provides alignment constraints
- UNDEF
- indicates an undefined symbol.
If the -P option is specified, the previous information is displayed using the following portable format. The three versions differ depending on whether -t d, -t o or -t x was specified, respectively:
"%s%s %s %d %d\n", <library/object name>, name, type, value, sizewhere <library/object name> is formatted as follows:"%s%s %s %o %o\n", <library/object name>, name, type, value, size
"%s%s %s %x %x\n", <library/object name>, name, type, value, size
- If -A is not specified, <library/object name> is an empty string.
- If -A is specified and the corresponding file operand does not name a library:
"%s: ", file
- If -A is specified and the corresponding file operand names a library. In this case, <object file> names the object file in the library containing the symbol being described:
"%s[%s]: ", file, <object file>
If -A is not specified, then if more than one file operand is specified or if only one file operand is specified and it names a library, nm will write a line identifying the object containing the following symbols before the lines containing those symbols, in the form:
- If the corresponding file operand does not name a library:
"%s:\n", file
- If the corresponding file operand names a library; in this case, <object file> is the name of the file in the library containing the following symbols:
"%s[%s]:\n", file, <object file>
If -P is specified, but -t is not, the format is as if -t x had been specified.
The following options are obsolete because of changes to the object file format and will be deleted in a future release.