* Makefile.in (clean): Remove bfd.h and stmp-bfd.h.
[binutils-gdb.git] / binutils / nm.1
1 .\" Copyright (c) 1991 Free Software Foundation
2 .\" See section COPYING for conditions for redistribution
3 .TH nm 1 "5 November 1991" "cygnus support" "GNU Development Tools"
4 .de BP
5 .sp
6 .ti \-.2i
7 \(**
8 ..
9
10 .SH NAME
11 nm\(em\&list symbols from object files.
12
13 .SH SYNOPSIS
14 .hy 0
15 .na
16 .TP
17 .B nm
18 .RB "[\|" \-a | \-\-debug\-syms "\|]"
19 .RB "[\|" \-g | \-\-extern\-only "\|]"
20 .RB "[\|" \-s | \-\-print\-armap "\|]"
21 .RB "[\|" \-o | \-\-print\-file\-name "\|]"
22 .RB "[\|" \-n | \-\-numeric\-sort "\|]"
23 .RB "[\|" \-p | \-\-no\-sort "\|]"
24 .RB "[\|" \-r | \-\-reverse\-sort "\|]"
25 .RB "[\|" \-u | \-\-undefined\-only "\|]"
26 .RB "[\|" \-\-help "\|]"
27 .RB "[\|" \-\-version "\|]"
28 .RB "[\|" "\-t \fIradix" | \-\-radix=\fIradix "\|]"
29 .RB "[\|" \-P | --portability "\|]"
30 .RB "[\|" "\-f \fIformat" | \-\-format=\fIformat "\|]"
31 .RB "[\|" "\-\-target=\fIbfdname" "\|]"
32 .RB "[\|" \c
33 .I objfile\c
34 \&.\|.\|.\|]
35 .ad b
36 .hy 1
37 .SH DESCRIPTION
38 GNU \c
39 .B nm\c
40 \& lists the symbols from object files \c
41 .I objfile\c
42 \&. If no object files are given as arguments, \c
43 .B nm\c
44 \& assumes `\|\c
45 .B a.out\c
46 \|'.
47
48 .SH OPTIONS
49 The long and short forms of options, shown here as alternatives, are
50 equivalent.
51
52 .TP
53 .B \-A
54 .TP
55 .B \-o
56 .TP
57 .B \-\-print\-file\-name
58 Precede each symbol by the name of the input file where it was found,
59 rather than identifying the input file once only before all of its
60 symbols.
61
62 .TP
63 .B \-a
64 .TP
65 .B \-\-debug\-syms
66 Display debugger-only symbols; normally these are not listed.
67
68 .TP
69 .B "\-f \fIformat"
70 Use the output format \fIformat\fP, which can be ``bsd'',
71 ``sysv'', or ``posix''. The default is `bsd''.
72 Only the first character of \fIformat\fP is significant; it can be
73 either upper or lower case.
74
75 .TP
76 .B \-g
77 .TP
78 .B \-\-extern\-only
79 Display only external symbols.
80
81 .TP
82 .B \-n
83 .TP
84 .B \-v
85 .TP
86 .B \-\-numeric\-sort
87 Sort symbols numerically by their addresses, not alphabetically by their
88 names.
89
90 .TP
91 .B \-p
92 .TP
93 .B \-\-no\-sort
94 Don't bother to sort the symbols in any order; just print them in the
95 order encountered.
96
97 .TP
98 .B \-P
99 .TP
100 .B \-\-portability
101 Use the POSIX.2 standard output format instead of the default format.
102 Equivalent to ``\-f posix''.
103
104 .TP
105 .B \-s
106 .TP
107 .B \-\-print\-armap
108 When listing symbols from archive members, include the index: a mapping
109 (stored in the archive by \c
110 .B ar\c
111 \& or \c
112 .B ranlib\c
113 \&) of what modules
114 contain definitions for what names.
115
116 .TP
117 .B \-r
118 .TP
119 .B \-\-reverse\-sort
120 Reverse the sense of the sort (whether numeric or alphabetic); let the
121 last come first.
122
123 .TP
124 .B "\-t \fIradix"
125 .TP
126 .B "\-\-radix=\fIradix"
127 Use \fIradix\fP as the radix for printing the symbol values. It must be
128 ``d'' for decimal, ``o'' for octal, or ``x'' for hexadecimal.
129
130 .TP
131 .BI "\-\-target=" "bfdname"\c
132 \&
133 Specify an object code format other than your system's default format.
134 See
135 .BR objdump ( 1 ),
136 for information on listing available formats.
137
138 .TP
139 .B \-u
140 .TP
141 .B \-\-undefined\-only
142 Display only undefined symbols (those external to each object file).
143
144 .TP
145 .B \-V
146 .TP
147 .B \-\-version
148 Show the version number of
149 .B nm
150 and exit.
151
152 .TP
153 .B \-\-help
154 Show a summary of the options to
155 .B nm
156 and exit.
157
158 .SH "SEE ALSO"
159 .RB "`\|" binutils "\|'"
160 entry in
161 .B
162 info\c
163 \&;
164 .I
165 The GNU Binary Utilities\c
166 \&, Roland H. Pesch (October 1991);
167 .BR ar "(" 1 "),"
168 .BR objdump ( 1 ),
169 .BR ranlib "(" 1 ")."
170
171
172 .SH COPYING
173 Copyright (c) 1991 Free Software Foundation, Inc.
174 .PP
175 Permission is granted to make and distribute verbatim copies of
176 this manual provided the copyright notice and this permission notice
177 are preserved on all copies.
178 .PP
179 Permission is granted to copy and distribute modified versions of this
180 manual under the conditions for verbatim copying, provided that the
181 entire resulting derived work is distributed under the terms of a
182 permission notice identical to this one.
183 .PP
184 Permission is granted to copy and distribute translations of this
185 manual into another language, under the above conditions for modified
186 versions, except that this permission notice may be included in
187 translations approved by the Free Software Foundation instead of in
188 the original English.