fba8d6b9da79a36a0300220e5b769dda5d5f9365
[binutils-gdb.git] / binutils / objdump.1
1 .\" Copyright (c) 1991, 1996 Free Software Foundation
2 .\" See section COPYING for conditions for redistribution
3 .TH objdump 1 "5 November 1991" "cygnus support" "GNU Development Tools"
4 .de BP
5 .sp
6 .ti \-.2i
7 \(**
8 ..
9
10 .SH NAME
11 objdump \- display information from object files.
12
13 .SH SYNOPSIS
14 .hy 0
15 .na
16 .TP
17 .B objdump
18 .RB "[\|" \-a | \-\-archive\-headers "\|]"
19 .RB "[\|" "\-b\ "\c
20 .I bfdname\c
21 .RB " | " "\-\-target="\c
22 .I bfdname\c
23 \&\|]
24 .RB "[\|" \-\-debugging "\|]"
25 .RB "[\|" \-d | \-\-disassemble "\|]"
26 .RB "[\|" \-D | \-\-disassemble-all "\|]"
27 .RB "[\|" \-f | \-\-file\-headers "\|]"
28 .RB "[\|" \-h | \-\-section\-headers
29 .RB "| " \-\-headers "\|]"
30 .RB "[\|" \-i | \-\-info "\|]"
31 .RB "[\|" "\-j\ "\c
32 .I section\c
33 .RB " | " "\-\-section="\c
34 .I section\c
35 \&\|]
36 .RB "[\|" \-l | \-\-line\-numbers "\|]"
37 .RB "[\|" "\-m\ "\c
38 .I machine\c
39 .RB " | " "\-\-architecture="\c
40 .I machine\c
41 \&\|]
42 .RB "[\|" \-r | \-\-reloc "\|]"
43 .RB "[\|" \-R | \-\-dynamic\-reloc "\|]"
44 .RB "[\|" \-s | \-\-full\-contents "\|]"
45 .RB "[\|" \-S | \-\-source "\|]"
46 .RB "[\|" \-\-show\-raw\-insn "\|]"
47 .RB "[\|" \-\-stabs "\|]"
48 .RB "[\|" \-t | \-\-syms "\|]"
49 .RB "[\|" \-T | \-\-dynamic\-syms "\|]"
50 .RB "[\|" \-x | \-\-all\-headers "\|]"
51 .RB "[\|" "\-\-start\-address="\c
52 .I address\c
53 \&\|]
54 .RB "[\|" "\-\-stop\-address="\c
55 .I address\c
56 \&\|]
57 .RB "[\|" \-\-version "\|]"
58 .RB "[\|" \-\-help "\|]"
59 .I objfile\c
60 \&.\|.\|.
61 .ad b
62 .hy 1
63 .SH DESCRIPTION
64 \c
65 .B objdump\c
66 \& displays information about one or more object files.
67 The options control what particular information to display. This
68 information is mostly useful to programmers who are working on the
69 compilation tools, as opposed to programmers who just want their
70 program to compile and work.
71 .PP
72 .IR "objfile" .\|.\|.
73 are the object files to be examined. When you specify archives,
74 \c
75 .B objdump\c
76 \& shows information on each of the member object files.
77
78 .SH OPTIONS
79 Where long and short forms of an option are shown together, they are
80 equivalent. At least one option besides
81 .B \-l
82 (\fB\-\-line\-numbers\fP) must be given.
83
84 .TP
85 .B \-a
86 .TP
87 .B \-\-archive\-headers
88 If any files from \c
89 .I objfile\c
90 \& are archives, display the archive
91 header information (in a format similar to `\|\c
92 .B ls \-l\c
93 \|'). Besides the
94 information you could list with `\|\c
95 .B ar tv\c
96 \|', `\|\c
97 .B objdump \-a\c
98 \|' shows
99 the object file format of each archive member.
100
101 .TP
102 .BI "\-b " "bfdname"\c
103 .TP
104 .BI "\-\-target=" "bfdname"
105 Specify the object-code format for the object files to be
106 \c
107 .I bfdname\c
108 \&. This may not be necessary; \c
109 .I objdump\c
110 \& can
111 automatically recognize many formats. For example,
112 .sp
113 .br
114 objdump\ \-b\ oasys\ \-m\ vax\ \-h\ fu.o
115 .br
116 .sp
117 display summary information from the section headers (`\|\c
118 .B \-h\c
119 \|') of
120 `\|\c
121 .B fu.o\c
122 \|', which is explicitly identified (`\|\c
123 .B \-m\c
124 \|') as a Vax object
125 file in the format produced by Oasys compilers. You can list the
126 formats available with the `\|\c
127 .B \-i\c
128 \|' option.
129
130 .TP
131 .B \-\-debugging
132 Display debugging information. This attempts to parse debugging
133 information stored in the file and print it out using a C like syntax.
134 Only certain types of debugging information have been implemented.
135
136 .TP
137 .B \-d
138 .TP
139 .B \-\-disassemble
140 Display the assembler mnemonics for the machine
141 instructions from \c
142 .I objfile\c
143 \&.
144 This option only disassembles those sections which are
145 expected to contain instructions.
146
147 .TP
148 .B \-D
149 .TP
150 .B \-\-disassemble-all
151 Like \fB\-d\fP, but disassemble the contents of all sections, not just
152 those expected to contain instructions.
153
154 .TP
155 .B \-f
156 .TP
157 .B \-\-file\-headers
158 Display summary information from the overall header of
159 each file in \c
160 .I objfile\c
161 \&.
162
163 .TP
164 .B \-h
165 .TP
166 .B \-\-section\-headers
167 .TP
168 .B \-\-headers
169 Display summary information from the section headers of the
170 object file.
171
172 .TP
173 .B \-\-help
174 Print a summary of the options to
175 .B objdump
176 and exit.
177
178 .TP
179 .B \-i
180 .TP
181 .B \-\-info
182 Display a list showing all architectures and object formats available
183 for specification with \c
184 .B \-b\c
185 \& or \c
186 .B \-m\c
187 \&.
188
189 .TP
190 .BI "\-j " "name"\c
191 .TP
192 .BI "\-\-section=" "name"
193 Display information only for section \c
194 .I name\c
195 \&.
196
197 .TP
198 .B \-l
199 .TP
200 .B \-\-line\-numbers
201 Label the display (using debugging information) with the filename
202 and source line numbers corresponding to the object code shown.
203 Only useful with \fB\-d\fP, \fB\-D\fP, or \fB\-r\fP.
204
205 .TP
206 .BI "\-m " "machine"\c
207 .TP
208 .BI "\-\-architecture=" "machine"
209 Specify the object files \c
210 .I objfile\c
211 \& are for architecture
212 \c
213 .I machine\c
214 \&. You can list available architectures using the `\|\c
215 .B \-i\c
216 \|'
217 option.
218
219 .TP
220 .B \-r
221 .TP
222 .B \-\-reloc
223 Print the relocation entries of the file. If used with \fB\-d\fP or
224 \fB\-d\fP, the relocations are printed interspersed with the
225 disassembly.
226
227 .TP
228 .B \-R
229 .TP
230 .B \-\-dynamic\-reloc
231 Print the dynamic relocation entries of the file. This is only
232 meaningful for dynamic objects, such as certain types of shared
233 libraries.
234
235 .TP
236 .B \-s
237 .TP
238 .B \-\-full\-contents
239 Display the full contents of any sections requested.
240
241 .TP
242 .B \-S
243 .TP
244 .B \-\-source
245 Display source code intermixed with disassembly, if possible. Implies
246 \fB-d\fP.
247
248 .TP
249 .B \-\-show-raw-insn
250 When disassembling instructions, print the instruction in hex as well as
251 in symbolic form. Not all targets handle this correctly yet.
252
253 .TP
254 .B \-\-stabs
255 Display the contents of the .stab, .stab.index, and .stab.excl
256 sections from an ELF file. This is only useful on systems (such as
257 Solaris 2.0) in which .stab debugging symbol-table entries are carried
258 in an ELF section. In most other file formats, debugging symbol-table
259 entries are interleaved with linkage symbols, and are visible in the
260 \-\-syms output.
261
262 .TP
263 .BI "\-\-start\-address=" "address"
264 Start displaying data at the specified address. This affects the output
265 of the
266 .B \-d\c
267 ,
268 .B \-r
269 and
270 .B \-s
271 options.
272
273 .TP
274 .BI "\-\-stop\-address=" "address"
275 Stop displaying data at the specified address. This affects the output
276 of the
277 .B \-d\c
278 ,
279 .B \-r
280 and
281 .B \-s
282 options.
283
284 .TP
285 .B \-t
286 .TP
287 .B \-\-syms
288 Symbol Table. Print the symbol table entries of the file.
289 This is similar to the information provided by the `\|\c
290 .B nm\c
291 \|' program.
292
293 .TP
294 .B \-T
295 .TP
296 .B \-\-dynamic\-syms
297 Dynamic Symbol Table. Print the dynamic symbol table entries of the
298 file. This is only meaningful for dynamic objects, such as certain
299 types of shared libraries. This is similar to the information
300 provided by the `\|\c
301 .B nm\c
302 \|' program when given the
303 .B \-D (\-\-dynamic)
304 option.
305
306 .TP
307 .B \-\-version
308 Print the version number of
309 .B objdump
310 and exit.
311
312 .TP
313 .B \-x
314 .TP
315 .B \-\-all\-headers
316 Display all available header information, including the symbol table and
317 relocation entries. Using `\|\c
318 .B \-x\c
319 \|' is equivalent to specifying all of
320 `\|\c
321 .B \-a \-f \-h \-r \-t\c
322 \|'.
323
324 .SH "SEE ALSO"
325 .RB "`\|" binutils "\|'"
326 entry in
327 .B
328 info\c
329 \&;
330 .I
331 The GNU Binary Utilities\c
332 \&, Roland H. Pesch (October 1991);
333 .BR nm "(" 1 ")."
334
335 .SH COPYING
336 Copyright (c) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
337 .PP
338 Permission is granted to make and distribute verbatim copies of
339 this manual provided the copyright notice and this permission notice
340 are preserved on all copies.
341 .PP
342 Permission is granted to copy and distribute modified versions of this
343 manual under the conditions for verbatim copying, provided that the
344 entire resulting derived work is distributed under the terms of a
345 permission notice identical to this one.
346 .PP
347 Permission is granted to copy and distribute translations of this
348 manual into another language, under the above conditions for modified
349 versions, except that this permission notice may be included in
350 translations approved by the Free Software Foundation instead of in
351 the original English.