1NM(1)                        GNU Development Tools                       NM(1)
2
3
4

NAME

6       nm - list symbols from object files
7

SYNOPSIS

9       nm [-A|-o|--print-file-name] [-a|--debug-syms]
10          [-B|--format=bsd] [-C|--demangle[=style]]
11          [-D|--dynamic] [-fformat|--format=format]
12          [-g|--extern-only] [-h|--help]
13          [-l|--line-numbers] [--inlines]
14          [-n|-v|--numeric-sort]
15          [-P|--portability] [-p|--no-sort]
16          [-r|--reverse-sort] [-S|--print-size]
17          [-s|--print-armap] [-t radix|--radix=radix]
18          [-u|--undefined-only] [-V|--version]
19          [-X 32_64] [--defined-only] [--no-demangle]
20          [--plugin name] [--size-sort] [--special-syms]
21          [--synthetic] [--with-symbol-versions] [--target=bfdname]
22          [objfile...]
23

DESCRIPTION

25       GNU nm lists the symbols from object files objfile....  If no object
26       files are listed as arguments, nm assumes the file a.out.
27
28       For each symbol, nm shows:
29
30       ·   The symbol value, in the radix selected by options (see below), or
31           hexadecimal by default.
32
33       ·   The symbol type.  At least the following types are used; others
34           are, as well, depending on the object file format.  If lowercase,
35           the symbol is usually local; if uppercase, the symbol is global
36           (external).  There are however a few lowercase symbols that are
37           shown for special global symbols ("u", "v" and "w").
38
39           "A" The symbol's value is absolute, and will not be changed by
40               further linking.
41
42           "B"
43           "b" The symbol is in the BSS data section.  This section typically
44               contains zero-initialized or uninitialized data, although the
45               exact behavior is system dependent.
46
47           "C" The symbol is common.  Common symbols are uninitialized data.
48               When linking, multiple common symbols may appear with the same
49               name.  If the symbol is defined anywhere, the common symbols
50               are treated as undefined references.
51
52           "D"
53           "d" The symbol is in the initialized data section.
54
55           "G"
56           "g" The symbol is in an initialized data section for small objects.
57               Some object file formats permit more efficient access to small
58               data objects, such as a global int variable as opposed to a
59               large global array.
60
61           "i" For PE format files this indicates that the symbol is in a
62               section specific to the implementation of DLLs.  For ELF format
63               files this indicates that the symbol is an indirect function.
64               This is a GNU extension to the standard set of ELF symbol
65               types.  It indicates a symbol which if referenced by a
66               relocation does not evaluate to its address, but instead must
67               be invoked at runtime.  The runtime execution will then return
68               the value to be used in the relocation.
69
70           "I" The symbol is an indirect reference to another symbol.
71
72           "N" The symbol is a debugging symbol.
73
74           "p" The symbols is in a stack unwind section.
75
76           "R"
77           "r" The symbol is in a read only data section.
78
79           "S"
80           "s" The symbol is in an uninitialized or zero-initialized data
81               section for small objects.
82
83           "T"
84           "t" The symbol is in the text (code) section.
85
86           "U" The symbol is undefined.
87
88           "u" The symbol is a unique global symbol.  This is a GNU extension
89               to the standard set of ELF symbol bindings.  For such a symbol
90               the dynamic linker will make sure that in the entire process
91               there is just one symbol with this name and type in use.
92
93           "V"
94           "v" The symbol is a weak object.  When a weak defined symbol is
95               linked with a normal defined symbol, the normal defined symbol
96               is used with no error.  When a weak undefined symbol is linked
97               and the symbol is not defined, the value of the weak symbol
98               becomes zero with no error.  On some systems, uppercase
99               indicates that a default value has been specified.
100
101           "W"
102           "w" The symbol is a weak symbol that has not been specifically
103               tagged as a weak object symbol.  When a weak defined symbol is
104               linked with a normal defined symbol, the normal defined symbol
105               is used with no error.  When a weak undefined symbol is linked
106               and the symbol is not defined, the value of the symbol is
107               determined in a system-specific manner without error.  On some
108               systems, uppercase indicates that a default value has been
109               specified.
110
111           "-" The symbol is a stabs symbol in an a.out object file.  In this
112               case, the next values printed are the stabs other field, the
113               stabs desc field, and the stab type.  Stabs symbols are used to
114               hold debugging information.
115
116           "?" The symbol type is unknown, or object file format specific.
117
118       ·   The symbol name.
119

OPTIONS

121       The long and short forms of options, shown here as alternatives, are
122       equivalent.
123
124       -A
125       -o
126       --print-file-name
127           Precede each symbol by the name of the input file (or archive
128           member) in which it was found, rather than identifying the input
129           file once only, before all of its symbols.
130
131       -a
132       --debug-syms
133           Display all symbols, even debugger-only symbols; normally these are
134           not listed.
135
136       -B  The same as --format=bsd (for compatibility with the MIPS nm).
137
138       -C
139       --demangle[=style]
140           Decode (demangle) low-level symbol names into user-level names.
141           Besides removing any initial underscore prepended by the system,
142           this makes C++ function names readable. Different compilers have
143           different mangling styles. The optional demangling style argument
144           can be used to choose an appropriate demangling style for your
145           compiler.
146
147       --no-demangle
148           Do not demangle low-level symbol names.  This is the default.
149
150       -D
151       --dynamic
152           Display the dynamic symbols rather than the normal symbols.  This
153           is only meaningful for dynamic objects, such as certain types of
154           shared libraries.
155
156       -f format
157       --format=format
158           Use the output format format, which can be "bsd", "sysv", or
159           "posix".  The default is "bsd".  Only the first character of format
160           is significant; it can be either upper or lower case.
161
162       -g
163       --extern-only
164           Display only external symbols.
165
166       -h
167       --help
168           Show a summary of the options to nm and exit.
169
170       -l
171       --line-numbers
172           For each symbol, use debugging information to try to find a
173           filename and line number.  For a defined symbol, look for the line
174           number of the address of the symbol.  For an undefined symbol, look
175           for the line number of a relocation entry which refers to the
176           symbol.  If line number information can be found, print it after
177           the other symbol information.
178
179       --inlines
180           When option -l is active, if the address belongs to a function that
181           was inlined, then this option causes the source information for all
182           enclosing scopes back to the first non-inlined function to be
183           printed as well.  For example, if "main" inlines "callee1" which
184           inlines "callee2", and address is from "callee2", the source
185           information for "callee1" and "main" will also be printed.
186
187       -n
188       -v
189       --numeric-sort
190           Sort symbols numerically by their addresses, rather than
191           alphabetically by their names.
192
193       -p
194       --no-sort
195           Do not bother to sort the symbols in any order; print them in the
196           order encountered.
197
198       -P
199       --portability
200           Use the POSIX.2 standard output format instead of the default
201           format.  Equivalent to -f posix.
202
203       -r
204       --reverse-sort
205           Reverse the order of the sort (whether numeric or alphabetic); let
206           the last come first.
207
208       -S
209       --print-size
210           Print both value and size of defined symbols for the "bsd" output
211           style.  This option has no effect for object formats that do not
212           record symbol sizes, unless --size-sort is also used in which case
213           a calculated size is displayed.
214
215       -s
216       --print-armap
217           When listing symbols from archive members, include the index: a
218           mapping (stored in the archive by ar or ranlib) of which modules
219           contain definitions for which names.
220
221       -t radix
222       --radix=radix
223           Use radix as the radix for printing the symbol values.  It must be
224           d for decimal, o for octal, or x for hexadecimal.
225
226       -u
227       --undefined-only
228           Display only undefined symbols (those external to each object
229           file).
230
231       -V
232       --version
233           Show the version number of nm and exit.
234
235       -X  This option is ignored for compatibility with the AIX version of
236           nm.  It takes one parameter which must be the string 32_64.  The
237           default mode of AIX nm corresponds to -X 32, which is not supported
238           by GNU nm.
239
240       --defined-only
241           Display only defined symbols for each object file.
242
243       --plugin name
244           Load the plugin called name to add support for extra target types.
245           This option is only available if the toolchain has been built with
246           plugin support enabled.
247
248           If --plugin is not provided, but plugin support has been enabled
249           then nm iterates over the files in ${libdir}/bfd-plugins in
250           alphabetic order and the first plugin that claims the object in
251           question is used.
252
253           Please note that this plugin search directory is not the one used
254           by ld's -plugin option.  In order to make nm use the  linker plugin
255           it must be copied into the ${libdir}/bfd-plugins directory.  For
256           GCC based compilations the linker plugin is called
257           liblto_plugin.so.0.0.0.  For Clang based compilations it is called
258           LLVMgold.so.  The GCC plugin is always backwards compatible with
259           earlier versions, so it is sufficient to just copy the newest one.
260
261       --size-sort
262           Sort symbols by size.  For ELF objects symbol sizes are read from
263           the ELF, for other object types the symbol sizes are computed as
264           the difference between the value of the symbol and the value of the
265           symbol with the next higher value.  If the "bsd" output format is
266           used the size of the symbol is printed, rather than the value, and
267           -S must be used in order both size and value to be printed.
268
269       --special-syms
270           Display symbols which have a target-specific special meaning.
271           These symbols are usually used by the target for some special
272           processing and are not normally helpful when included in the normal
273           symbol lists.  For example for ARM targets this option would skip
274           the mapping symbols used to mark transitions between ARM code,
275           THUMB code and data.
276
277       --synthetic
278           Include synthetic symbols in the output.  These are special symbols
279           created by the linker for various purposes.  They are not shown by
280           default since they are not part of the binary's original source
281           code.
282
283       --with-symbol-versions
284           Enables the display of symbol version information if any exists.
285           The version string is displayed as a suffix to the symbol name,
286           preceeded by an @ character.  For example foo@VER_1.  If the
287           version is the default version to be used when resolving
288           unversioned references to the symbol then it is displayed as a
289           suffix preceeded by two @ characters.  For example foo@@VER_2.
290
291       --target=bfdname
292           Specify an object code format other than your system's default
293           format.
294
295       @file
296           Read command-line options from file.  The options read are inserted
297           in place of the original @file option.  If file does not exist, or
298           cannot be read, then the option will be treated literally, and not
299           removed.
300
301           Options in file are separated by whitespace.  A whitespace
302           character may be included in an option by surrounding the entire
303           option in either single or double quotes.  Any character (including
304           a backslash) may be included by prefixing the character to be
305           included with a backslash.  The file may itself contain additional
306           @file options; any such options will be processed recursively.
307

SEE ALSO

309       ar(1), objdump(1), ranlib(1), and the Info entries for binutils.
310
312       Copyright (c) 1991-2018 Free Software Foundation, Inc.
313
314       Permission is granted to copy, distribute and/or modify this document
315       under the terms of the GNU Free Documentation License, Version 1.3 or
316       any later version published by the Free Software Foundation; with no
317       Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
318       Texts.  A copy of the license is included in the section entitled "GNU
319       Free Documentation License".
320
321
322
323binutils-2.30.90                  2018-07-09                             NM(1)
Impressum