binutils: nm
1
1 2 nm
1 ****
1
1 nm [-A|-o|--print-file-name] [-a|--debug-syms]
1 [-B|--format=bsd] [-C|--demangle[=STYLE]]
1 [-D|--dynamic] [-fFORMAT|--format=FORMAT]
1 [-g|--extern-only] [-h|--help]
1 [-l|--line-numbers] [--inlines]
1 [-U METHOD] [--unicode=METHOD]
1 [-n|-v|--numeric-sort]
1 [-P|--portability] [-p|--no-sort]
1 [-r|--reverse-sort] [-S|--print-size]
1 [-s|--print-armap] [-t RADIX|--radix=RADIX]
1 [-u|--undefined-only] [-V|--version]
1 [-X 32_64] [--defined-only] [--no-demangle]
1 [--plugin NAME] [--size-sort] [--special-syms]
1 [--synthetic] [--with-symbol-versions] [--target=BFDNAME]
1 [OBJFILE...]
1
1 GNU 'nm' lists the symbols from object files OBJFILE.... If no
1 object files are listed as arguments, 'nm' assumes the file 'a.out'.
1
1 For each symbol, 'nm' shows:
1
1 * The symbol value, in the radix selected by options (see below), or
1 hexadecimal by default.
1
1 * The symbol type. At least the following types are used; others
1 are, as well, depending on the object file format. If lowercase,
1 the symbol is usually local; if uppercase, the symbol is global
1 (external). There are however a few lowercase symbols that are
1 shown for special global symbols ('u', 'v' and 'w').
1
1 'A'
1 The symbol's value is absolute, and will not be changed by
1 further linking.
1
1 'B'
1 'b'
1 The symbol is in the uninitialized data section (known as
1 BSS).
1
1 'C'
1 The symbol is common. Common symbols are uninitialized data.
1 When linking, multiple common symbols may appear with the same
1 name. If the symbol is defined anywhere, the common symbols
1 are treated as undefined references. For more details on
11 common symbols, see the discussion of -warn-common in ⇒
Linker options (ld.info)Options.
1
1 'D'
1 'd'
1 The symbol is in the initialized data section.
1
1 'G'
1 'g'
1 The symbol is in an initialized data section for small
1 objects. Some object file formats permit more efficient
1 access to small data objects, such as a global int variable as
1 opposed to a large global array.
1
1 'i'
1 For PE format files this indicates that the symbol is in a
1 section specific to the implementation of DLLs. For ELF
1 format files this indicates that the symbol is an indirect
1 function. This is a GNU extension to the standard set of ELF
1 symbol types. It indicates a symbol which if referenced by a
1 relocation does not evaluate to its address, but instead must
1 be invoked at runtime. The runtime execution will then return
1 the value to be used in the relocation.
1
1 'I'
1 The symbol is an indirect reference to another symbol.
1
1 'N'
1 The symbol is a debugging symbol.
1
1 'p'
1 The symbols is in a stack unwind section.
1
1 'R'
1 'r'
1 The symbol is in a read only data section.
1
1 'S'
1 's'
1 The symbol is in an uninitialized data section for small
1 objects.
1
1 'T'
1 't'
1 The symbol is in the text (code) section.
1
1 'U'
1 The symbol is undefined.
1
1 'u'
1 The symbol is a unique global symbol. This is a GNU extension
1 to the standard set of ELF symbol bindings. For such a symbol
1 the dynamic linker will make sure that in the entire process
1 there is just one symbol with this name and type in use.
1
1 'V'
1 'v'
1 The symbol is a weak object. When a weak defined symbol is
1 linked with a normal defined symbol, the normal defined symbol
1 is used with no error. When a weak undefined symbol is linked
1 and the symbol is not defined, the value of the weak symbol
1 becomes zero with no error. On some systems, uppercase
1 indicates that a default value has been specified.
1
1 'W'
1 'w'
1 The symbol is a weak symbol that has not been specifically
1 tagged as a weak object symbol. When a weak defined symbol is
1 linked with a normal defined symbol, the normal defined symbol
1 is used with no error. When a weak undefined symbol is linked
1 and the symbol is not defined, the value of the symbol is
1 determined in a system-specific manner without error. On some
1 systems, uppercase indicates that a default value has been
1 specified.
1
1 '-'
1 The symbol is a stabs symbol in an a.out object file. In this
1 case, the next values printed are the stabs other field, the
1 stabs desc field, and the stab type. Stabs symbols are used
1 to hold debugging information.
1
1 '?'
1 The symbol type is unknown, or object file format specific.
1
1 * The symbol name.
1
1 The long and short forms of options, shown here as alternatives, are
1 equivalent.
1
1 '-A'
1 '-o'
1 '--print-file-name'
1 Precede each symbol by the name of the input file (or archive
1 member) in which it was found, rather than identifying the input
1 file once only, before all of its symbols.
1
1 '-a'
1 '--debug-syms'
1 Display all symbols, even debugger-only symbols; normally these are
1 not listed.
1
1 '-B'
1 The same as '--format=bsd' (for compatibility with the MIPS 'nm').
1
1 '-C'
1 '--demangle[=STYLE]'
1 Decode ("demangle") low-level symbol names into user-level names.
1 Besides removing any initial underscore prepended by the system,
1 this makes C++ function names readable. Different compilers have
1 different mangling styles. The optional demangling style argument
1 can be used to choose an appropriate demangling style for your
1 compiler. ⇒c++filt, for more information on demangling.
1
1 '--no-demangle'
1 Do not demangle low-level symbol names. This is the default.
1
1 '-D'
1 '--dynamic'
1 Display the dynamic symbols rather than the normal symbols. This
1 is only meaningful for dynamic objects, such as certain types of
1 shared libraries.
1
1 '-f FORMAT'
1 '--format=FORMAT'
1 Use the output format FORMAT, which can be 'bsd', 'sysv', or
1 'posix'. The default is 'bsd'. Only the first character of FORMAT
1 is significant; it can be either upper or lower case.
1
1 '-g'
1 '--extern-only'
1 Display only external symbols.
1
1 '-h'
1 '--help'
1 Show a summary of the options to 'nm' and exit.
1
1 '-l'
1 '--line-numbers'
1 For each symbol, use debugging information to try to find a
1 filename and line number. For a defined symbol, look for the line
1 number of the address of the symbol. For an undefined symbol, look
1 for the line number of a relocation entry which refers to the
1 symbol. If line number information can be found, print it after
1 the other symbol information.
1
1 '--inlines'
1 When option '-l' is active, if the address belongs to a function
1 that was inlined, then this option causes the source information
1 for all enclosing scopes back to the first non-inlined function to
1 be printed as well. For example, if 'main' inlines 'callee1' which
1 inlines 'callee2', and address is from 'callee2', the source
1 information for 'callee1' and 'main' will also be printed.
1
1 '-n'
1 '-v'
1 '--numeric-sort'
1 Sort symbols numerically by their addresses, rather than
1 alphabetically by their names.
1
1 '-p'
1 '--no-sort'
1 Do not bother to sort the symbols in any order; print them in the
1 order encountered.
1
1 '-P'
1 '--portability'
1 Use the POSIX.2 standard output format instead of the default
1 format. Equivalent to '-f posix'.
1
1 '-r'
1 '--reverse-sort'
1 Reverse the order of the sort (whether numeric or alphabetic); let
1 the last come first.
1
1 '-S'
1 '--print-size'
1 Print both value and size of defined symbols for the 'bsd' output
1 style. This option has no effect for object formats that do not
1 record symbol sizes, unless '--size-sort' is also used in which
1 case a calculated size is displayed.
1
1 '-s'
1 '--print-armap'
1 When listing symbols from archive members, include the index: a
1 mapping (stored in the archive by 'ar' or 'ranlib') of which
1 modules contain definitions for which names.
1
1 '-t RADIX'
1 '--radix=RADIX'
1 Use RADIX as the radix for printing the symbol values. It must be
1 'd' for decimal, 'o' for octal, or 'x' for hexadecimal.
1
1 '-u'
1 '--undefined-only'
1 Display only undefined symbols (those external to each object
1 file).
1
1 '-U [D|I|L|E|X|H]'
1 '--unicode=[DEFAULT|INVALID|LOCALE|ESCAPE|HEX|HIGHLIGHT]'
1 Controls the display of UTF-8 encoded mulibyte characters in
1 strings. The default ('--unicode=default') is to give them no
1 special treatment. The '--unicode=locale' option displays the
1 sequence in the current locale, which may or may not support them.
1 The options '--unicode=hex' and '--unicode=invalid' display them as
1 hex byte sequences enclosed by either angle brackets or curly
1 braces.
1
1 The '--unicode=escape' option displays them as escape sequences
1 (\UXXXX) and the '--unicode=highlight' option displays them as
1 escape sequences highlighted in red (if supported by the output
1 device). The colouring is intended to draw attention to the
1 presence of unicode sequences where they might not be expected.
1
1 '-V'
1 '--version'
1 Show the version number of 'nm' and exit.
1
1 '-X'
1 This option is ignored for compatibility with the AIX version of
1 'nm'. It takes one parameter which must be the string '32_64'.
1 The default mode of AIX 'nm' corresponds to '-X 32', which is not
1 supported by GNU 'nm'.
1
1 '--defined-only'
1 Display only defined symbols for each object file.
1
1 '--plugin NAME'
1 Load the plugin called NAME to add support for extra target types.
1 This option is only available if the toolchain has been built with
1 plugin support enabled.
1
1 If '--plugin' is not provided, but plugin support has been enabled
1 then 'nm' iterates over the files in '${libdir}/bfd-plugins' in
1 alphabetic order and the first plugin that claims the object in
1 question is used.
1
1 Please note that this plugin search directory is _not_ the one used
1 by 'ld''s '-plugin' option. In order to make 'nm' use the linker
1 plugin it must be copied into the '${libdir}/bfd-plugins'
1 directory. For GCC based compilations the linker plugin is called
1 'liblto_plugin.so.0.0.0'. For Clang based compilations it is
1 called 'LLVMgold.so'. The GCC plugin is always backwards
1 compatible with earlier versions, so it is sufficient to just copy
1 the newest one.
1
1 '--size-sort'
1 Sort symbols by size. For ELF objects symbol sizes are read from
1 the ELF, for other object types the symbol sizes are computed as
1 the difference between the value of the symbol and the value of the
1 symbol with the next higher value. If the 'bsd' output format is
1 used the size of the symbol is printed, rather than the value, and
1 '-S' must be used in order both size and value to be printed.
1
1 '--special-syms'
1 Display symbols which have a target-specific special meaning.
1 These symbols are usually used by the target for some special
1 processing and are not normally helpful when included in the normal
1 symbol lists. For example for ARM targets this option would skip
1 the mapping symbols used to mark transitions between ARM code,
1 THUMB code and data.
1
1 '--synthetic'
1 Include synthetic symbols in the output. These are special symbols
1 created by the linker for various purposes. They are not shown by
1 default since they are not part of the binary's original source
1 code.
1
1 '--with-symbol-versions'
1 Enables the display of symbol version information if any exists.
1 The version string is displayed as a suffix to the symbol name,
1 preceeded by an @ character. For example 'foo@VER_1'. If the
1 version is the default version to be used when resolving
1 unversioned references to the symbol then it is displayed as a
1 suffix preceeded by two @ characters. For example 'foo@@VER_2'.
1
1 '--target=BFDNAME'
1 Specify an object code format other than your system's default
1 format. ⇒Target Selection, for more information.
1