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

NAME

6       nm - list symbols from object files
7

SYNOPSIS

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

DESCRIPTION

21       GNU  nm  lists  the symbols from object files objfile....  If no object
22       files are listed as arguments, nm assumes the file a.out.
23
24       For each symbol, nm shows:
25
26       ·   The symbol value, in the radix selected by options (see below),  or
27           hexadecimal by default.
28
29       ·   The  symbol  type.   At  least the following types are used; others
30           are, as well, depending on the object file format.   If  lowercase,
31           the symbol is local; if uppercase, the symbol is global (external).
32
33           "A" The symbol's value is absolute, and will not be changed by fur‐
34               ther linking.
35
36           "B" The symbol is in the uninitialized data section (known as BSS).
37
38           "C" The symbol is common.  Common symbols are  uninitialized  data.
39               When  linking, multiple common symbols may appear with the same
40               name.  If the symbol is defined anywhere,  the  common  symbols
41               are treated as undefined references.
42
43           "D" The symbol is in the initialized data section.
44
45           "G" The symbol is in an initialized data section for small objects.
46               Some object file formats permit more efficient access to  small
47               data  objects,  such  as  a global int variable as opposed to a
48               large global array.
49
50           "I" The symbol is an indirect reference to another symbol.  This is
51               a GNU extension to the a.out object file format which is rarely
52               used.
53
54           "N" The symbol is a debugging symbol.
55
56           "R" The symbol is in a read only data section.
57
58           "S" The symbol is  in  an  uninitialized  data  section  for  small
59               objects.
60
61           "T" The symbol is in the text (code) section.
62
63           "U" The symbol is undefined.
64
65           "V" The  symbol  is  a  weak object.  When a weak defined symbol is
66               linked with a normal defined symbol, the normal defined  symbol
67               is  used with no error.  When a weak undefined symbol is linked
68               and the symbol is not defined, the value  of  the  weak  symbol
69               becomes zero with no error.
70
71           "W" The  symbol  is  a  weak  symbol that has not been specifically
72               tagged as a weak object symbol.  When a weak defined symbol  is
73               linked  with a normal defined symbol, the normal defined symbol
74               is used with no error.  When a weak undefined symbol is  linked
75               and  the  symbol  is  not  defined,  the value of the symbol is
76               determined in a system-specific manner without error.  On  some
77               systems,  uppercase  indicates  that  a  default value has been
78               specified.
79
80           "-" The symbol is a stabs symbol in an a.out object file.  In  this
81               case,  the  next  values printed are the stabs other field, the
82               stabs desc field, and the stab type.  Stabs symbols are used to
83               hold debugging information.
84
85           "?" The symbol type is unknown, or object file format specific.
86
87       ·   The symbol name.
88

OPTIONS

90       The  long  and  short forms of options, shown here as alternatives, are
91       equivalent.
92
93       -A
94       -o
95       --print-file-name
96           Precede each symbol by the name of the input file (or archive  mem‐
97           ber)  in which it was found, rather than identifying the input file
98           once only, before all of its symbols.
99
100       -a
101       --debug-syms
102           Display all symbols, even debugger-only symbols; normally these are
103           not listed.
104
105       -B  The same as --format=bsd (for compatibility with the MIPS nm).
106
107       -C
108       --demangle[=style]
109           Decode  (demangle)  low-level  symbol  names into user-level names.
110           Besides removing any initial underscore prepended  by  the  system,
111           this  makes  C++  function names readable. Different compilers have
112           different mangling styles. The optional demangling  style  argument
113           can be used to choose an appropriate demangling style for your com‐
114           piler.
115
116       --no-demangle
117           Do not demangle low-level symbol names.  This is the default.
118
119       -D
120       --dynamic
121           Display the dynamic symbols rather than the normal  symbols.   This
122           is  only  meaningful  for dynamic objects, such as certain types of
123           shared libraries.
124
125       -f format
126       --format=format
127           Use the output format  format,  which  can  be  "bsd",  "sysv",  or
128           "posix".  The default is "bsd".  Only the first character of format
129           is significant; it can be either upper or lower case.
130
131       -g
132       --extern-only
133           Display only external symbols.
134
135       -l
136       --line-numbers
137           For each symbol, use debugging information to try to find  a  file‐
138           name and line number.  For a defined symbol, look for the line num‐
139           ber of the address of the symbol.  For an  undefined  symbol,  look
140           for  the line number of a relocation entry which refers to the sym‐
141           bol.  If line number information can be found, print it  after  the
142           other symbol information.
143
144       -n
145       -v
146       --numeric-sort
147           Sort symbols numerically by their addresses, rather than alphabeti‐
148           cally by their names.
149
150       -p
151       --no-sort
152           Do not bother to sort the symbols in any order; print them  in  the
153           order encountered.
154
155       -P
156       --portability
157           Use  the POSIX.2 standard output format instead of the default for‐
158           mat.  Equivalent to -f posix.
159
160       -S
161       --print-size
162           Print size, not the value, of defined symbols for the "bsd"  output
163           format.
164
165       -s
166       --print-armap
167           When  listing  symbols  from  archive members, include the index: a
168           mapping (stored in the archive by ar or ranlib)  of  which  modules
169           contain definitions for which names.
170
171       -r
172       --reverse-sort
173           Reverse  the order of the sort (whether numeric or alphabetic); let
174           the last come first.
175
176       --size-sort
177           Sort symbols by size.  The  size  is  computed  as  the  difference
178           between  the  value  of the symbol and the value of the symbol with
179           the next higher value.  If the "bsd" output format is used the size
180           of  the  symbol  is  printed, rather than the value, and -S must be
181           used in order both size and value to be printed.
182
183       --special-syms
184           Display symbols  which  have  a  target-specific  special  meaning.
185           These  symbols are usually used by the target for some special pro‐
186           cessing and are not normally helpful when included included in  the
187           normal symbol lists.  For example for ARM targets this option would
188           skip the mapping symbols used  to  mark  transistions  between  ARM
189           code, THUMB code and data.
190
191       -t radix
192       --radix=radix
193           Use  radix as the radix for printing the symbol values.  It must be
194           d for decimal, o for octal, or x for hexadecimal.
195
196       --target=bfdname
197           Specify an object code format other than your system's default for‐
198           mat.
199
200       -u
201       --undefined-only
202           Display  only  undefined  symbols  (those  external  to each object
203           file).
204
205       --defined-only
206           Display only defined symbols for each object file.
207
208       -V
209       --version
210           Show the version number of nm and exit.
211
212       -X  This option is ignored for compatibility with the  AIX  version  of
213           nm.   It  takes  one parameter which must be the string 32_64.  The
214           default mode of AIX nm corresponds to -X 32, which is not supported
215           by GNU nm.
216
217       --help
218           Show a summary of the options to nm and exit.
219
220       @file
221           Read command-line options from file.  The options read are inserted
222           in place of the original @file option.  If file does not exist,  or
223           cannot  be read, then the option will be treated literally, and not
224           removed.
225
226           Options in file are separated by whitespace.  A whitespace  charac‐
227           ter  may  be included in an option by surrounding the entire option
228           in either single or double  quotes.   Any  character  (including  a
229           backslash)  may  be  included  by  prefixing  the  character  to be
230           included with a backslash.  The file may itself contain  additional
231           @file options; any such options will be processed recursively.
232

SEE ALSO

234       ar(1), objdump(1), ranlib(1), and the Info entries for binutils.
235
237       Copyright  (c)  1991,  1992,  1993, 1994, 1995, 1996, 1997, 1998, 1999,
238       2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
239
240       Permission is granted to copy, distribute and/or modify  this  document
241       under  the  terms of the GNU Free Documentation License, Version 1.1 or
242       any later version published by the Free Software  Foundation;  with  no
243       Invariant  Sections,  with no Front-Cover Texts, and with no Back-Cover
244       Texts.  A copy of the license is included in the section entitled  "GNU
245       Free Documentation License".
246
247
248
249binutils-2.17                     2006-06-23                             NM(1)
Impressum