]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - gnu/usr.bin/binutils/nm/nm.1
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / gnu / usr.bin / binutils / nm / nm.1
1 .\" $FreeBSD$
2 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" Set up some character translations and predefined strings.  \*(-- will
20 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
21 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
22 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
23 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
24 .\" nothing in troff, for use with C<>.
25 .tr \(*W-
26 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
27 .ie n \{\
28 .    ds -- \(*W-
29 .    ds PI pi
30 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
31 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
32 .    ds L" ""
33 .    ds R" ""
34 .    ds C` ""
35 .    ds C' ""
36 'br\}
37 .el\{\
38 .    ds -- \|\(em\|
39 .    ds PI \(*p
40 .    ds L" ``
41 .    ds R" ''
42 'br\}
43 .\"
44 .\" Escape single quotes in literal strings from groff's Unicode transform.
45 .ie \n(.g .ds Aq \(aq
46 .el       .ds Aq '
47 .\"
48 .\" If the F register is turned on, we'll generate index entries on stderr for
49 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
50 .\" entries marked with X<> in POD.  Of course, you'll have to process the
51 .\" output yourself in some meaningful fashion.
52 .ie \nF \{\
53 .    de IX
54 .    tm Index:\\$1\t\\n%\t"\\$2"
55 ..
56 .    nr % 0
57 .    rr F
58 .\}
59 .el \{\
60 .    de IX
61 ..
62 .\}
63 .\"
64 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
65 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
66 .    \" fudge factors for nroff and troff
67 .if n \{\
68 .    ds #H 0
69 .    ds #V .8m
70 .    ds #F .3m
71 .    ds #[ \f1
72 .    ds #] \fP
73 .\}
74 .if t \{\
75 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
76 .    ds #V .6m
77 .    ds #F 0
78 .    ds #[ \&
79 .    ds #] \&
80 .\}
81 .    \" simple accents for nroff and troff
82 .if n \{\
83 .    ds ' \&
84 .    ds ` \&
85 .    ds ^ \&
86 .    ds , \&
87 .    ds ~ ~
88 .    ds /
89 .\}
90 .if t \{\
91 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
92 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
93 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
94 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
95 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
96 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
97 .\}
98 .    \" troff and (daisy-wheel) nroff accents
99 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
100 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
101 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
102 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
103 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
104 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
105 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
106 .ds ae a\h'-(\w'a'u*4/10)'e
107 .ds Ae A\h'-(\w'A'u*4/10)'E
108 .    \" corrections for vroff
109 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
110 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
111 .    \" for low resolution devices (crt and lpr)
112 .if \n(.H>23 .if \n(.V>19 \
113 \{\
114 .    ds : e
115 .    ds 8 ss
116 .    ds o a
117 .    ds d- d\h'-1'\(ga
118 .    ds D- D\h'-1'\(hy
119 .    ds th \o'bp'
120 .    ds Th \o'LP'
121 .    ds ae ae
122 .    ds Ae AE
123 .\}
124 .rm #[ #] #H #V #F C
125 .\" ========================================================================
126 .\"
127 .IX Title "NM 1"
128 .TH NM 1 "2010-10-30" "binutils-2.17.50" "GNU Development Tools"
129 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
130 .\" way too many mistakes in technical documents.
131 .if n .ad l
132 .nh
133 .SH "NAME"
134 nm \- list symbols from object files
135 .SH "SYNOPSIS"
136 .IX Header "SYNOPSIS"
137 nm [\fB\-a\fR|\fB\-\-debug\-syms\fR] [\fB\-g\fR|\fB\-\-extern\-only\fR]
138    [\fB\-B\fR] [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] [\fB\-D\fR|\fB\-\-dynamic\fR]
139    [\fB\-S\fR|\fB\-\-print\-size\fR] [\fB\-s\fR|\fB\-\-print\-armap\fR]
140    [\fB\-A\fR|\fB\-o\fR|\fB\-\-print\-file\-name\fR][\fB\-\-special\-syms\fR]
141    [\fB\-n\fR|\fB\-v\fR|\fB\-\-numeric\-sort\fR] [\fB\-p\fR|\fB\-\-no\-sort\fR]
142    [\fB\-r\fR|\fB\-\-reverse\-sort\fR] [\fB\-\-size\-sort\fR] [\fB\-u\fR|\fB\-\-undefined\-only\fR]
143    [\fB\-t\fR \fIradix\fR|\fB\-\-radix=\fR\fIradix\fR] [\fB\-P\fR|\fB\-\-portability\fR]
144    [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-f\fR\fIformat\fR|\fB\-\-format=\fR\fIformat\fR]
145    [\fB\-\-defined\-only\fR] [\fB\-l\fR|\fB\-\-line\-numbers\fR] [\fB\-\-no\-demangle\fR]
146    [\fB\-V\fR|\fB\-\-version\fR] [\fB\-X 32_64\fR] [\fB\-\-help\fR]  [\fIobjfile\fR...]
147 .SH "DESCRIPTION"
148 .IX Header "DESCRIPTION"
149 \&\s-1GNU\s0 \fBnm\fR lists the symbols from object files \fIobjfile\fR....
150 If no object files are listed as arguments, \fBnm\fR assumes the file
151 \&\fIa.out\fR.
152 .PP
153 For each symbol, \fBnm\fR shows:
154 .IP "\(bu" 4
155 The symbol value, in the radix selected by options (see below), or
156 hexadecimal by default.
157 .IP "\(bu" 4
158 The symbol type.  At least the following types are used; others are, as
159 well, depending on the object file format.  If lowercase, the symbol is
160 local; if uppercase, the symbol is global (external).
161 .RS 4
162 .ie n .IP """A""" 4
163 .el .IP "\f(CWA\fR" 4
164 .IX Item "A"
165 The symbol's value is absolute, and will not be changed by further
166 linking.
167 .ie n .IP """B""" 4
168 .el .IP "\f(CWB\fR" 4
169 .IX Item "B"
170 The symbol is in the uninitialized data section (known as \s-1BSS\s0).
171 .ie n .IP """C""" 4
172 .el .IP "\f(CWC\fR" 4
173 .IX Item "C"
174 The symbol is common.  Common symbols are uninitialized data.  When
175 linking, multiple common symbols may appear with the same name.  If the
176 symbol is defined anywhere, the common symbols are treated as undefined
177 references.
178 .ie n .IP """D""" 4
179 .el .IP "\f(CWD\fR" 4
180 .IX Item "D"
181 The symbol is in the initialized data section.
182 .ie n .IP """G""" 4
183 .el .IP "\f(CWG\fR" 4
184 .IX Item "G"
185 The symbol is in an initialized data section for small objects.  Some
186 object file formats permit more efficient access to small data objects,
187 such as a global int variable as opposed to a large global array.
188 .ie n .IP """I""" 4
189 .el .IP "\f(CWI\fR" 4
190 .IX Item "I"
191 The symbol is an indirect reference to another symbol.  This is a \s-1GNU\s0
192 extension to the a.out object file format which is rarely used.
193 .ie n .IP """N""" 4
194 .el .IP "\f(CWN\fR" 4
195 .IX Item "N"
196 The symbol is a debugging symbol.
197 .ie n .IP """R""" 4
198 .el .IP "\f(CWR\fR" 4
199 .IX Item "R"
200 The symbol is in a read only data section.
201 .ie n .IP """S""" 4
202 .el .IP "\f(CWS\fR" 4
203 .IX Item "S"
204 The symbol is in an uninitialized data section for small objects.
205 .ie n .IP """T""" 4
206 .el .IP "\f(CWT\fR" 4
207 .IX Item "T"
208 The symbol is in the text (code) section.
209 .ie n .IP """U""" 4
210 .el .IP "\f(CWU\fR" 4
211 .IX Item "U"
212 The symbol is undefined.
213 .ie n .IP """V""" 4
214 .el .IP "\f(CWV\fR" 4
215 .IX Item "V"
216 The symbol is a weak object.  When a weak defined symbol is linked with
217 a normal defined symbol, the normal defined symbol is used with no error.
218 When a weak undefined symbol is linked and the symbol is not defined,
219 the value of the weak symbol becomes zero with no error.
220 .ie n .IP """W""" 4
221 .el .IP "\f(CWW\fR" 4
222 .IX Item "W"
223 The symbol is a weak symbol that has not been specifically tagged as a
224 weak object symbol.  When a weak defined symbol is linked with a normal
225 defined symbol, the normal defined symbol is used with no error.
226 When a weak undefined symbol is linked and the symbol is not defined,
227 the value of the symbol is determined in a system-specific manner without
228 error.  On some systems, uppercase indicates that a default value has been
229 specified.
230 .ie n .IP """\-""" 4
231 .el .IP "\f(CW\-\fR" 4
232 .IX Item "-"
233 The symbol is a stabs symbol in an a.out object file.  In this case, the
234 next values printed are the stabs other field, the stabs desc field, and
235 the stab type.  Stabs symbols are used to hold debugging information.
236 .ie n .IP """?""" 4
237 .el .IP "\f(CW?\fR" 4
238 .IX Item "?"
239 The symbol type is unknown, or object file format specific.
240 .RE
241 .RS 4
242 .RE
243 .IP "\(bu" 4
244 The symbol name.
245 .SH "OPTIONS"
246 .IX Header "OPTIONS"
247 The long and short forms of options, shown here as alternatives, are
248 equivalent.
249 .IP "\fB\-A\fR" 4
250 .IX Item "-A"
251 .PD 0
252 .IP "\fB\-o\fR" 4
253 .IX Item "-o"
254 .IP "\fB\-\-print\-file\-name\fR" 4
255 .IX Item "--print-file-name"
256 .PD
257 Precede each symbol by the name of the input file (or archive member)
258 in which it was found, rather than identifying the input file once only,
259 before all of its symbols.
260 .IP "\fB\-a\fR" 4
261 .IX Item "-a"
262 .PD 0
263 .IP "\fB\-\-debug\-syms\fR" 4
264 .IX Item "--debug-syms"
265 .PD
266 Display all symbols, even debugger-only symbols; normally these are not
267 listed.
268 .IP "\fB\-B\fR" 4
269 .IX Item "-B"
270 The same as \fB\-\-format=bsd\fR (for compatibility with the \s-1MIPS\s0 \fBnm\fR).
271 .IP "\fB\-C\fR" 4
272 .IX Item "-C"
273 .PD 0
274 .IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
275 .IX Item "--demangle[=style]"
276 .PD
277 Decode (\fIdemangle\fR) low-level symbol names into user-level names.
278 Besides removing any initial underscore prepended by the system, this
279 makes \*(C+ function names readable. Different compilers have different
280 mangling styles. The optional demangling style argument can be used to
281 choose an appropriate demangling style for your compiler.
282 .IP "\fB\-\-no\-demangle\fR" 4
283 .IX Item "--no-demangle"
284 Do not demangle low-level symbol names.  This is the default.
285 .IP "\fB\-D\fR" 4
286 .IX Item "-D"
287 .PD 0
288 .IP "\fB\-\-dynamic\fR" 4
289 .IX Item "--dynamic"
290 .PD
291 Display the dynamic symbols rather than the normal symbols.  This is
292 only meaningful for dynamic objects, such as certain types of shared
293 libraries.
294 .IP "\fB\-f\fR \fIformat\fR" 4
295 .IX Item "-f format"
296 .PD 0
297 .IP "\fB\-\-format=\fR\fIformat\fR" 4
298 .IX Item "--format=format"
299 .PD
300 Use the output format \fIformat\fR, which can be \f(CW\*(C`bsd\*(C'\fR,
301 \&\f(CW\*(C`sysv\*(C'\fR, or \f(CW\*(C`posix\*(C'\fR.  The default is \f(CW\*(C`bsd\*(C'\fR.
302 Only the first character of \fIformat\fR is significant; it can be
303 either upper or lower case.
304 .IP "\fB\-g\fR" 4
305 .IX Item "-g"
306 .PD 0
307 .IP "\fB\-\-extern\-only\fR" 4
308 .IX Item "--extern-only"
309 .PD
310 Display only external symbols.
311 .IP "\fB\-l\fR" 4
312 .IX Item "-l"
313 .PD 0
314 .IP "\fB\-\-line\-numbers\fR" 4
315 .IX Item "--line-numbers"
316 .PD
317 For each symbol, use debugging information to try to find a filename and
318 line number.  For a defined symbol, look for the line number of the
319 address of the symbol.  For an undefined symbol, look for the line
320 number of a relocation entry which refers to the symbol.  If line number
321 information can be found, print it after the other symbol information.
322 .IP "\fB\-n\fR" 4
323 .IX Item "-n"
324 .PD 0
325 .IP "\fB\-v\fR" 4
326 .IX Item "-v"
327 .IP "\fB\-\-numeric\-sort\fR" 4
328 .IX Item "--numeric-sort"
329 .PD
330 Sort symbols numerically by their addresses, rather than alphabetically
331 by their names.
332 .IP "\fB\-p\fR" 4
333 .IX Item "-p"
334 .PD 0
335 .IP "\fB\-\-no\-sort\fR" 4
336 .IX Item "--no-sort"
337 .PD
338 Do not bother to sort the symbols in any order; print them in the order
339 encountered.
340 .IP "\fB\-P\fR" 4
341 .IX Item "-P"
342 .PD 0
343 .IP "\fB\-\-portability\fR" 4
344 .IX Item "--portability"
345 .PD
346 Use the \s-1POSIX\s0.2 standard output format instead of the default format.
347 Equivalent to \fB\-f posix\fR.
348 .IP "\fB\-S\fR" 4
349 .IX Item "-S"
350 .PD 0
351 .IP "\fB\-\-print\-size\fR" 4
352 .IX Item "--print-size"
353 .PD
354 Print size, not the value, of defined symbols for the \f(CW\*(C`bsd\*(C'\fR output format.
355 .IP "\fB\-s\fR" 4
356 .IX Item "-s"
357 .PD 0
358 .IP "\fB\-\-print\-armap\fR" 4
359 .IX Item "--print-armap"
360 .PD
361 When listing symbols from archive members, include the index: a mapping
362 (stored in the archive by \fBar\fR or \fBranlib\fR) of which modules
363 contain definitions for which names.
364 .IP "\fB\-r\fR" 4
365 .IX Item "-r"
366 .PD 0
367 .IP "\fB\-\-reverse\-sort\fR" 4
368 .IX Item "--reverse-sort"
369 .PD
370 Reverse the order of the sort (whether numeric or alphabetic); let the
371 last come first.
372 .IP "\fB\-\-size\-sort\fR" 4
373 .IX Item "--size-sort"
374 Sort symbols by size.  The size is computed as the difference between
375 the value of the symbol and the value of the symbol with the next higher
376 value.  If the \f(CW\*(C`bsd\*(C'\fR output format is used the size of the symbol
377 is printed, rather than the value, and \fB\-S\fR must be used in order
378 both size and value to be printed.
379 .IP "\fB\-\-special\-syms\fR" 4
380 .IX Item "--special-syms"
381 Display symbols which have a target-specific special meaning.  These
382 symbols are usually used by the target for some special processing and
383 are not normally helpful when included included in the normal symbol
384 lists.  For example for \s-1ARM\s0 targets this option would skip the mapping
385 symbols used to mark transitions between \s-1ARM\s0 code, \s-1THUMB\s0 code and
386 data.
387 .IP "\fB\-t\fR \fIradix\fR" 4
388 .IX Item "-t radix"
389 .PD 0
390 .IP "\fB\-\-radix=\fR\fIradix\fR" 4
391 .IX Item "--radix=radix"
392 .PD
393 Use \fIradix\fR as the radix for printing the symbol values.  It must be
394 \&\fBd\fR for decimal, \fBo\fR for octal, or \fBx\fR for hexadecimal.
395 .IP "\fB\-\-target=\fR\fIbfdname\fR" 4
396 .IX Item "--target=bfdname"
397 Specify an object code format other than your system's default format.
398 .IP "\fB\-u\fR" 4
399 .IX Item "-u"
400 .PD 0
401 .IP "\fB\-\-undefined\-only\fR" 4
402 .IX Item "--undefined-only"
403 .PD
404 Display only undefined symbols (those external to each object file).
405 .IP "\fB\-\-defined\-only\fR" 4
406 .IX Item "--defined-only"
407 Display only defined symbols for each object file.
408 .IP "\fB\-V\fR" 4
409 .IX Item "-V"
410 .PD 0
411 .IP "\fB\-\-version\fR" 4
412 .IX Item "--version"
413 .PD
414 Show the version number of \fBnm\fR and exit.
415 .IP "\fB\-X\fR" 4
416 .IX Item "-X"
417 This option is ignored for compatibility with the \s-1AIX\s0 version of
418 \&\fBnm\fR.  It takes one parameter which must be the string
419 \&\fB32_64\fR.  The default mode of \s-1AIX\s0 \fBnm\fR corresponds
420 to \fB\-X 32\fR, which is not supported by \s-1GNU\s0 \fBnm\fR.
421 .IP "\fB\-\-help\fR" 4
422 .IX Item "--help"
423 Show a summary of the options to \fBnm\fR and exit.
424 .IP "\fB@\fR\fIfile\fR" 4
425 .IX Item "@file"
426 Read command-line options from \fIfile\fR.  The options read are
427 inserted in place of the original @\fIfile\fR option.  If \fIfile\fR
428 does not exist, or cannot be read, then the option will be treated
429 literally, and not removed.
430 .Sp
431 Options in \fIfile\fR are separated by whitespace.  A whitespace
432 character may be included in an option by surrounding the entire
433 option in either single or double quotes.  Any character (including a
434 backslash) may be included by prefixing the character to be included
435 with a backslash.  The \fIfile\fR may itself contain additional
436 @\fIfile\fR options; any such options will be processed recursively.
437 .SH "SEE ALSO"
438 .IX Header "SEE ALSO"
439 \&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR.
440 .SH "COPYRIGHT"
441 .IX Header "COPYRIGHT"
442 Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
443 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
444 .PP
445 Permission is granted to copy, distribute and/or modify this document
446 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1
447 or any later version published by the Free Software Foundation;
448 with no Invariant Sections, with no Front-Cover Texts, and with no
449 Back-Cover Texts.  A copy of the license is included in the
450 section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".