aboutsummaryrefslogtreecommitdiff
path: root/binutils/nm.1
blob: 4d3b3da49d3eda9676585caeae23ced4895a131d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
.\" Copyright (c) 1991 Free Software Foundation
.\" See section COPYING for conditions for redistribution
.TH nm 1 "5 November 1991" "cygnus support" "GNU Development Tools"
.de BP
.sp
.ti \-.2i
\(**
..

.SH NAME
nm \- list symbols from object files.

.SH SYNOPSIS
.hy 0
.na
.TP
.B nm
.RB "[\|" \-a | \-\-debug\-syms "\|]" 
.RB "[\|" \-g | \-\-extern\-only "\|]"
.RB "[\|" \-B "\|]"  
.RB "[\|" \-C | \-\-demangle "\|]" 
.RB "[\|" \-D | \-\-dynamic "\|]" 
.RB "[\|" \-s | \-\-print\-armap "\|]" 
.RB "[\|" \-o | \-\-print\-file\-name "\|]"  
.RB "[\|" \-n | \-\-numeric\-sort "\|]" 
.RB "[\|" \-p | \-\-no\-sort "\|]"
.RB "[\|" \-r | \-\-reverse\-sort "\|]" 
.RB "[\|" \-\-size\-sort "\|]" 
.RB "[\|" \-u | \-\-undefined\-only "\|]"  
.RB "[\|" \-\-help "\|]"  
.RB "[\|" \-\-version "\|]"  
.RB "[\|" "\-t \fIradix" | \-\-radix=\fIradix "\|]"
.RB "[\|" \-P | --portability "\|]"
.RB "[\|" "\-f \fIformat" | \-\-format=\fIformat "\|]"
.RB "[\|" "\-\-target=\fIbfdname" "\|]"
.RB "[\|" \c
.I objfile\c
\&.\|.\|.\|]
.ad b
.hy 1
.SH DESCRIPTION
GNU \c
.B nm\c
\& lists the symbols from object files \c
.I objfile\c
\&.  If no object files are given as arguments, \c
.B nm\c
\& assumes `\|\c
.B a.out\c
\|'.

.SH OPTIONS
The long and short forms of options, shown here as alternatives, are
equivalent.

.TP
.B \-A
.TP
.B \-o
.TP
.B \-\-print\-file\-name 
Precede each symbol by the name of the input file where it was found,
rather than identifying the input file once only before all of its
symbols. 

.TP
.B \-a
.TP
.B \-\-debug\-syms 
Display debugger-only symbols; normally these are not listed.

.TP
.B \-B
The same as
.B \-\-format=bsd
(for compatibility with the MIPS \fBnm\fP).

.TP
.B \-C
.TP
.B \-\-demangle
Decode (\fIdemangle\fP) low-level symbol names into user-level names.
Besides removing any initial underscore prepended by the system, this
makes C++ function names readable.

.TP
.B \-D
.TP
.B \-\-dynamic
Display the dynamic symbols rather than the normal symbols.  This is
only meaningful for dynamic objects, such as certain types of shared
libraries.

.TP
.B "\-f \fIformat"
Use the output format \fIformat\fP, which can be ``bsd'',
``sysv'', or ``posix''.  The default is `bsd''.
Only the first character of \fIformat\fP is significant; it can be
either upper or lower case.

.TP
.B \-g
.TP
.B \-\-extern\-only 
Display only external symbols.

.TP
.B \-n
.TP
.B \-v
.TP
.B \-\-numeric\-sort 
Sort symbols numerically by their addresses, not alphabetically by their
names. 

.TP
.B \-p
.TP
.B \-\-no\-sort 
Don't bother to sort the symbols in any order; just print them in the
order encountered.

.TP
.B \-P
.TP
.B \-\-portability
Use the POSIX.2 standard output format instead of the default format.
Equivalent to ``\-f posix''.

.TP
.B \-s
.TP
.B \-\-print\-armap
When listing symbols from archive members, include the index: a mapping
(stored in the archive by \c
.B ar\c
\& or \c
.B ranlib\c
\&) of what modules
contain definitions for what names.

.TP
.B \-r
.TP
.B \-\-reverse\-sort 
Reverse the sense of the sort (whether numeric or alphabetic); let the
last come first.

.TP
.B \-\-size\-sort 
Sort symbols by size.  The size is computed as the difference between
the value of the symbol and the value of the symbol with the next higher
value.  The size of the symbol is printed, rather than the value.

.TP
.B "\-t \fIradix"
.TP
.B "\-\-radix=\fIradix"
Use \fIradix\fP as the radix for printing the symbol values.  It must be
``d'' for decimal, ``o'' for octal, or ``x'' for hexadecimal.

.TP
.BI "\-\-target=" "bfdname"\c
\&
Specify an object code format other than your system's default format.
See 
.BR objdump ( 1 ),
for information on listing available formats.

.TP
.B \-u
.TP
.B \-\-undefined\-only 
Display only undefined symbols (those external to each object file).

.TP
.B \-V
.TP
.B \-\-version
Show the version number of
.B nm
and exit.

.TP
.B \-\-help
Show a summary of the options to
.B nm
and exit.

.SH "SEE ALSO"
.RB "`\|" binutils "\|'"
entry in 
.B
info\c
\&; 
.I
The GNU Binary Utilities\c
\&, Roland H. Pesch (October 1991);
.BR ar "(" 1 "),"
.BR objdump ( 1 ),
.BR ranlib "(" 1 ")."


.SH COPYING
Copyright (c) 1991 Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
.PP
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
.PP
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.