Merge from vendor branch OPENSSH:
[dragonfly.git] / contrib / binutils / binutils / doc / nm.1
1 .\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13
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
25 .fi
26 ..
27 .\" Set up some character translations and predefined strings.  \*(-- will
28 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
29 .\" double quote, and \*(R" will give a right double quote.  | will give a
30 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
31 .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
32 .\" expand to `' in nroff, nothing in troff, for use with C<>.
33 .tr \(*W-|\(bv\*(Tr
34 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
35 .ie n \{\
36 .    ds -- \(*W-
37 .    ds PI pi
38 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
39 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
40 .    ds L" ""
41 .    ds R" ""
42 .    ds C` ""
43 .    ds C' ""
44 'br\}
45 .el\{\
46 .    ds -- \|\(em\|
47 .    ds PI \(*p
48 .    ds L" ``
49 .    ds R" ''
50 'br\}
51 .\"
52 .\" If the F register is turned on, we'll generate index entries on stderr for
53 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
54 .\" entries marked with X<> in POD.  Of course, you'll have to process the
55 .\" output yourself in some meaningful fashion.
56 .if \nF \{\
57 .    de IX
58 .    tm Index:\\$1\t\\n%\t"\\$2"
59 ..
60 .    nr % 0
61 .    rr F
62 .\}
63 .\"
64 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
65 .\" way too many mistakes in technical documents.
66 .hy 0
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "NM 1"
132 .TH NM 1 "2002-05-14" "binutils-2.12.1" "GNU Development Tools"
133 .UC
134 .SH "NAME"
135 nm \- list symbols from object files
136 .SH "SYNOPSIS"
137 .IX Header "SYNOPSIS"
138 nm [\fB\-a\fR|\fB\-\-debug\-syms\fR] [\fB\-g\fR|\fB\-\-extern\-only\fR]
139    [\fB\-B\fR] [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] [\fB\-D\fR|\fB\-\-dynamic\fR]
140    [\fB\-s\fR|\fB\-\-print\-armap\fR] [\fB\-A\fR|\fB\-o\fR|\fB\-\-print\-file\-name\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 weak symbol becomes zero with no error.
228 .ie n .IP """\-""" 4
229 .el .IP "\f(CW\-\fR" 4
230 .IX Item "-"
231 The symbol is a stabs symbol in an a.out object file.  In this case, the
232 next values printed are the stabs other field, the stabs desc field, and
233 the stab type.  Stabs symbols are used to hold debugging information.
234 .ie n .IP """?""" 4
235 .el .IP "\f(CW?\fR" 4
236 .IX Item "?"
237 The symbol type is unknown, or object file format specific.
238 .RE
239 .RS 4
240 .RE
241 .IP "\(bu" 4
242 The symbol name.
243 .SH "OPTIONS"
244 .IX Header "OPTIONS"
245 The long and short forms of options, shown here as alternatives, are
246 equivalent.
247 .IP "\fB\-A\fR" 4
248 .IX Item "-A"
249 .PD 0
250 .IP "\fB\-o\fR" 4
251 .IX Item "-o"
252 .IP "\fB\-\-print\-file\-name\fR" 4
253 .IX Item "--print-file-name"
254 .PD
255 Precede each symbol by the name of the input file (or archive member)
256 in which it was found, rather than identifying the input file once only,
257 before all of its symbols.
258 .IP "\fB\-a\fR" 4
259 .IX Item "-a"
260 .PD 0
261 .IP "\fB\-\-debug\-syms\fR" 4
262 .IX Item "--debug-syms"
263 .PD
264 Display all symbols, even debugger-only symbols; normally these are not
265 listed.
266 .IP "\fB\-B\fR" 4
267 .IX Item "-B"
268 The same as \fB\-\-format=bsd\fR (for compatibility with the \s-1MIPS\s0 \fBnm\fR).
269 .IP "\fB\-C\fR" 4
270 .IX Item "-C"
271 .PD 0
272 .IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
273 .IX Item "--demangle[=style]"
274 .PD
275 Decode (\fIdemangle\fR) low-level symbol names into user-level names.
276 Besides removing any initial underscore prepended by the system, this
277 makes \*(C+ function names readable. Different compilers have different
278 mangling styles. The optional demangling style argument can be used to 
279 choose an appropriate demangling style for your compiler. 
280 .IP "\fB\-\-no\-demangle\fR" 4
281 .IX Item "--no-demangle"
282 Do not demangle low-level symbol names.  This is the default.
283 .IP "\fB\-D\fR" 4
284 .IX Item "-D"
285 .PD 0
286 .IP "\fB\-\-dynamic\fR" 4
287 .IX Item "--dynamic"
288 .PD
289 Display the dynamic symbols rather than the normal symbols.  This is
290 only meaningful for dynamic objects, such as certain types of shared
291 libraries.
292 .IP "\fB\-f\fR \fIformat\fR" 4
293 .IX Item "-f format"
294 .PD 0
295 .IP "\fB\-\-format=\fR\fIformat\fR" 4
296 .IX Item "--format=format"
297 .PD
298 Use the output format \fIformat\fR, which can be \f(CW\*(C`bsd\*(C'\fR,
299 \&\f(CW\*(C`sysv\*(C'\fR, or \f(CW\*(C`posix\*(C'\fR.  The default is \f(CW\*(C`bsd\*(C'\fR.
300 Only the first character of \fIformat\fR is significant; it can be
301 either upper or lower case.
302 .IP "\fB\-g\fR" 4
303 .IX Item "-g"
304 .PD 0
305 .IP "\fB\-\-extern\-only\fR" 4
306 .IX Item "--extern-only"
307 .PD
308 Display only external symbols.
309 .IP "\fB\-l\fR" 4
310 .IX Item "-l"
311 .PD 0
312 .IP "\fB\-\-line\-numbers\fR" 4
313 .IX Item "--line-numbers"
314 .PD
315 For each symbol, use debugging information to try to find a filename and
316 line number.  For a defined symbol, look for the line number of the
317 address of the symbol.  For an undefined symbol, look for the line
318 number of a relocation entry which refers to the symbol.  If line number
319 information can be found, print it after the other symbol information.
320 .IP "\fB\-n\fR" 4
321 .IX Item "-n"
322 .PD 0
323 .IP "\fB\-v\fR" 4
324 .IX Item "-v"
325 .IP "\fB\-\-numeric\-sort\fR" 4
326 .IX Item "--numeric-sort"
327 .PD
328 Sort symbols numerically by their addresses, rather than alphabetically
329 by their names. 
330 .IP "\fB\-p\fR" 4
331 .IX Item "-p"
332 .PD 0
333 .IP "\fB\-\-no\-sort\fR" 4
334 .IX Item "--no-sort"
335 .PD
336 Do not bother to sort the symbols in any order; print them in the order
337 encountered.
338 .IP "\fB\-P\fR" 4
339 .IX Item "-P"
340 .PD 0
341 .IP "\fB\-\-portability\fR" 4
342 .IX Item "--portability"
343 .PD
344 Use the \s-1POSIX\s0.2 standard output format instead of the default format.
345 Equivalent to \fB\-f posix\fR.
346 .IP "\fB\-s\fR" 4
347 .IX Item "-s"
348 .PD 0
349 .IP "\fB\-\-print\-armap\fR" 4
350 .IX Item "--print-armap"
351 .PD
352 When listing symbols from archive members, include the index: a mapping
353 (stored in the archive by \fBar\fR or \fBranlib\fR) of which modules
354 contain definitions for which names.
355 .IP "\fB\-r\fR" 4
356 .IX Item "-r"
357 .PD 0
358 .IP "\fB\-\-reverse\-sort\fR" 4
359 .IX Item "--reverse-sort"
360 .PD
361 Reverse the order of the sort (whether numeric or alphabetic); let the
362 last come first.
363 .IP "\fB\-\-size\-sort\fR" 4
364 .IX Item "--size-sort"
365 Sort symbols by size.  The size is computed as the difference between
366 the value of the symbol and the value of the symbol with the next higher
367 value.  The size of the symbol is printed, rather than the value.
368 .IP "\fB\-t\fR \fIradix\fR" 4
369 .IX Item "-t radix"
370 .PD 0
371 .IP "\fB\-\-radix=\fR\fIradix\fR" 4
372 .IX Item "--radix=radix"
373 .PD
374 Use \fIradix\fR as the radix for printing the symbol values.  It must be
375 \&\fBd\fR for decimal, \fBo\fR for octal, or \fBx\fR for hexadecimal.
376 .IP "\fB\-\-target=\fR\fIbfdname\fR" 4
377 .IX Item "--target=bfdname"
378 Specify an object code format other than your system's default format.
379 .IP "\fB\-u\fR" 4
380 .IX Item "-u"
381 .PD 0
382 .IP "\fB\-\-undefined\-only\fR" 4
383 .IX Item "--undefined-only"
384 .PD
385 Display only undefined symbols (those external to each object file).
386 .IP "\fB\-\-defined\-only\fR" 4
387 .IX Item "--defined-only"
388 Display only defined symbols for each object file.
389 .IP "\fB\-V\fR" 4
390 .IX Item "-V"
391 .PD 0
392 .IP "\fB\-\-version\fR" 4
393 .IX Item "--version"
394 .PD
395 Show the version number of \fBnm\fR and exit.
396 .IP "\fB\-X\fR" 4
397 .IX Item "-X"
398 This option is ignored for compatibility with the \s-1AIX\s0 version of
399 \&\fBnm\fR.  It takes one parameter which must be the string
400 \&\fB32_64\fR.  The default mode of \s-1AIX\s0 \fBnm\fR corresponds
401 to \fB\-X 32\fR, which is not supported by \s-1GNU\s0 \fBnm\fR.
402 .IP "\fB\-\-help\fR" 4
403 .IX Item "--help"
404 Show a summary of the options to \fBnm\fR and exit.
405 .SH "SEE ALSO"
406 .IX Header "SEE ALSO"
407 \&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR.
408 .SH "COPYRIGHT"
409 .IX Header "COPYRIGHT"
410 Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc.
411 .PP
412 Permission is granted to copy, distribute and/or modify this document
413 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1
414 or any later version published by the Free Software Foundation;
415 with no Invariant Sections, with no Front-Cover Texts, and with no
416 Back-Cover Texts.  A copy of the license is included in the
417 section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".