United States-English |
|
|
HP-UX Reference > Nnm(1)HP-UX 11i Version 3: February 2007 |
|
NAMEnm — print name list of common object file DESCRIPTIONThe nm command displays the symbol table of each object file, file. There are three general output formats: the default (neither -p nor -P specified), -p specified, and -P specified. The output formats are described after the "Options" subsection. 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 its column, forcing every column after the name to be misaligned. Optionsnm recognizes the following options:
Operandsnm recognizes the following operand:
Default Output Format - 32 bitIf the default (neither the -p nor the -P option) output format is specified, each symbol has the following columns, separated by vertical bars (|). The default for numbers is decimal (-d or -t d). If decimal: "%20s|%10d|%6s|%7s|%s", name, value, scope, type, subspace If octal: "%20s|%012o|%6s|%7s|%s", name, value, scope, type, subspace If hexadecimal: "%20s|0x%08x|%6s|%7s|%s", name, value, scope, type, subspace Default Output Format - 64 bitIf the default (neither the -p nor the -P option) output format is specified, each symbol has the following columns, separated by vertical bars (|). The default for numbers is decimal (-d or -t d). If decimal: "[%u]%s|%22llu|%8u|%s|%s|%1d|%s|%s", index, value, size, type, bind, O, shndx, name If octal: "[%u]%s|%022llo|%010o|%s|%s|%1o|%s|%s", index, value, size, type, bind, O, shndx, name If hexadecimal: "[%u]%s|0x%016llx|0x%08x|%s|%s|%1x|%s|%s", index, value, size, type, bind, O, shndx, name The descriptions are explained below:
Output Format for -pIf the -p option is specified, information is displayed using the following portable C-language formats. The default for numbers is decimal (-d or -t d). If decimal: "%010d %s %s", value, type, name If octal: "%012o %s %s", value, type, name If hexadecimal: "0x%08x %s %s", value, type, name If -A or -r, the line is preceded by: "%20s:", file Output Format for -PIf the -P option is specified, information is displayed using the following portable C-language formats. The default for numbers is hexadecimal (-x or -t x). In the format string, %s represents string output; %d represents decimal output; %o represents octal output; %x represents hexadecimal output; \n represents newline; all other characters represent themselves.
where library-object is a string preformatted as follows:
If -A and -r are not specified, and if more than one file operand is specified, or if a single file operand that names a library is specified, then nm prints a line identifying the object containing the symbols before the lines containing those symbols, in one of the following forms:
EXTERNAL INFLUENCESEnvironment VariablesThe following internationalization variables affect the execution of nm: LANG determines the locale category for native language, local customs and coded character set in the absence of LC_ALL or other LC_* environment variables. If LANG is not specified or is null, it defaults to C (see lang(5)). LC_ALL, if set to a nonempty string value, determines the values for all locale categories and has precedence over LANG and other LC_* environment variables. LC_COLLATE determines the locale category for character collation. LC_CTYPE determines the locale category for character handling functions. LC_MESSAGES determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error. LC_NUMERIC determines the locale category for numeric formatting. ST_NMCAT and NLSPATH determine the location of message catalogues for processing LC_MESSAGES. If an internationalization variable is not specified or is null, it defaults to the value of LANG. If LANG is not specified or is null, it defaults to C (see lang(5)). If any internationalization variable contains an invalid setting, then all internationalization variables default to C (see environ(5)). EXAMPLESDisplay which object files have undefined references for the symbol leap: nm -rup *.o | grep leap Display which object files have a definition for the text symbol leap: nm -rp *.o | awk '{ if ($3 == "T" && $4 == "leap") { print $0 } }' WARNINGSBy default, nm now sorts symbols by name (the -n option). To turn off sorting, use the -N option. Some options added for standards conformance duplicate the functionality of options that previously existed. This duplication has been retained for backward compatibility. |
Printable version | ||
|