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