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"
37           "b" The symbol is in the uninitialized data section (known as BSS).
38
39           "C" The symbol is common.  Common symbols are  uninitialized  data.
40               When  linking, multiple common symbols may appear with the same
41               name.  If the symbol is defined anywhere,  the  common  symbols
42               are treated as undefined references.
43
44           "D"
45           "d" The symbol is in the initialized data section.
46
47           "G"
48           "g" The symbol is in an initialized data section for small objects.
49               Some object file formats permit more efficient access to  small
50               data  objects,  such  as  a global int variable as opposed to a
51               large global array.
52
53           "I" The symbol is an indirect reference to another symbol.  This is
54               a GNU extension to the a.out object file format which is rarely
55               used.
56
57           "i" The symbol is in a section specific to  the  implementation  of
58               DLLs.
59
60           "N" The symbol is a debugging symbol.
61
62           "p" The symbols is in a stack unwind section.
63
64           "R"
65           "r" The symbol is in a read only data section.
66
67           "S"
68           "s" The  symbol  is  in  an  uninitialized  data  section for small
69               objects.
70
71           "T"
72           "t" The symbol is in the text (code) section.
73
74           "U" The symbol is undefined.
75
76           "V"
77           "v" The symbol is a weak object.  When a  weak  defined  symbol  is
78               linked  with a normal defined symbol, the normal defined symbol
79               is used with no error.  When a weak undefined symbol is  linked
80               and  the  symbol  is  not defined, the value of the weak symbol
81               becomes zero with no error.  On some systems,  uppercase  indi‐
82               cates that a default value has been specified.
83
84           "W"
85           "w" The  symbol  is  a  weak  symbol that has not been specifically
86               tagged as a weak object symbol.  When a weak defined symbol  is
87               linked  with a normal defined symbol, the normal defined symbol
88               is used with no error.  When a weak undefined symbol is  linked
89               and  the  symbol  is  not  defined,  the value of the symbol is
90               determined in a system-specific manner without error.  On  some
91               systems,  uppercase  indicates  that  a  default value has been
92               specified.
93
94           "-" The symbol is a stabs symbol in an a.out object file.  In  this
95               case,  the  next  values printed are the stabs other field, the
96               stabs desc field, and the stab type.  Stabs symbols are used to
97               hold debugging information.
98
99           "?" The symbol type is unknown, or object file format specific.
100
101       ·   The symbol name.
102

OPTIONS

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

SEE ALSO

248       ar(1), objdump(1), ranlib(1), and the Info entries for binutils.
249
251       Copyright  (c)  1991,  1992,  1993, 1994, 1995, 1996, 1997, 1998, 1999,
252       2000, 2001, 2002, 2003, 2004, 2005,  2006,  2007,  2008  Free  Software
253       Foundation, Inc.
254
255       Permission  is  granted to copy, distribute and/or modify this document
256       under the terms of the GNU Free Documentation License, Version  1.2  or
257       any  later  version  published by the Free Software Foundation; with no
258       Invariant Sections, with no Front-Cover Texts, and with  no  Back-Cover
259       Texts.   A copy of the license is included in the section entitled "GNU
260       Free Documentation License".
261
262
263
264binutils-2.18.90                  2008-09-10                             NM(1)
Impressum