1OBJDUMP(1) GNU Development Tools OBJDUMP(1)
2
3
4
6 objdump - display information from object files.
7
9 objdump [-a|--archive-headers]
10 [-b bfdname|--target=bfdname]
11 [-C|--demangle[=style] ]
12 [-d|--disassemble]
13 [-D|--disassemble-all]
14 [-z|--disassemble-zeroes]
15 [-EB|-EL|--endian={big | little }]
16 [-f|--file-headers]
17 [-F|--file-offsets]
18 [--file-start-context]
19 [-g|--debugging]
20 [-e|--debugging-tags]
21 [-h|--section-headers|--headers]
22 [-i|--info]
23 [-j section|--section=section]
24 [-l|--line-numbers]
25 [-S|--source]
26 [-m machine|--architecture=machine]
27 [-M options|--disassembler-options=options]
28 [-p|--private-headers]
29 [-r|--reloc]
30 [-R|--dynamic-reloc]
31 [-s|--full-contents]
32 [-W[lLiaprmfFsoRt]|
33 --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges]]
34 [-G|--stabs]
35 [-t|--syms]
36 [-T|--dynamic-syms]
37 [-x|--all-headers]
38 [-w|--wide]
39 [--start-address=address]
40 [--stop-address=address]
41 [--prefix-addresses]
42 [--[no-]show-raw-insn]
43 [--adjust-vma=offset]
44 [--special-syms]
45 [--prefix=prefix]
46 [--prefix-strip=level]
47 [--insn-width=width]
48 [-V|--version]
49 [-H|--help]
50 objfile...
51
53 objdump displays information about one or more object files. The
54 options control what particular information to display. This
55 information is mostly useful to programmers who are working on the
56 compilation tools, as opposed to programmers who just want their
57 program to compile and work.
58
59 objfile... are the object files to be examined. When you specify
60 archives, objdump shows information on each of the member object files.
61
63 The long and short forms of options, shown here as alternatives, are
64 equivalent. At least one option from the list
65 -a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x must be given.
66
67 -a
68 --archive-header
69 If any of the objfile files are archives, display the archive
70 header information (in a format similar to ls -l). Besides the
71 information you could list with ar tv, objdump -a shows the object
72 file format of each archive member.
73
74 --adjust-vma=offset
75 When dumping information, first add offset to all the section
76 addresses. This is useful if the section addresses do not
77 correspond to the symbol table, which can happen when putting
78 sections at particular addresses when using a format which can not
79 represent section addresses, such as a.out.
80
81 -b bfdname
82 --target=bfdname
83 Specify that the object-code format for the object files is
84 bfdname. This option may not be necessary; objdump can
85 automatically recognize many formats.
86
87 For example,
88
89 objdump -b oasys -m vax -h fu.o
90
91 displays summary information from the section headers (-h) of fu.o,
92 which is explicitly identified (-m) as a VAX object file in the
93 format produced by Oasys compilers. You can list the formats
94 available with the -i option.
95
96 -C
97 --demangle[=style]
98 Decode (demangle) low-level symbol names into user-level names.
99 Besides removing any initial underscore prepended by the system,
100 this makes C++ function names readable. Different compilers have
101 different mangling styles. The optional demangling style argument
102 can be used to choose an appropriate demangling style for your
103 compiler.
104
105 -g
106 --debugging
107 Display debugging information. This attempts to parse STABS and
108 IEEE debugging format information stored in the file and print it
109 out using a C like syntax. If neither of these formats are found
110 this option falls back on the -W option to print any DWARF
111 information in the file.
112
113 -e
114 --debugging-tags
115 Like -g, but the information is generated in a format compatible
116 with ctags tool.
117
118 -d
119 --disassemble
120 Display the assembler mnemonics for the machine instructions from
121 objfile. This option only disassembles those sections which are
122 expected to contain instructions.
123
124 -D
125 --disassemble-all
126 Like -d, but disassemble the contents of all sections, not just
127 those expected to contain instructions.
128
129 If the target is an ARM architecture this switch also has the
130 effect of forcing the disassembler to decode pieces of data found
131 in code sections as if they were instructions.
132
133 --prefix-addresses
134 When disassembling, print the complete address on each line. This
135 is the older disassembly format.
136
137 -EB
138 -EL
139 --endian={big|little}
140 Specify the endianness of the object files. This only affects
141 disassembly. This can be useful when disassembling a file format
142 which does not describe endianness information, such as S-records.
143
144 -f
145 --file-headers
146 Display summary information from the overall header of each of the
147 objfile files.
148
149 -F
150 --file-offsets
151 When disassembling sections, whenever a symbol is displayed, also
152 display the file offset of the region of data that is about to be
153 dumped. If zeroes are being skipped, then when disassembly
154 resumes, tell the user how many zeroes were skipped and the file
155 offset of the location from where the disassembly resumes. When
156 dumping sections, display the file offset of the location from
157 where the dump starts.
158
159 --file-start-context
160 Specify that when displaying interlisted source code/disassembly
161 (assumes -S) from a file that has not yet been displayed, extend
162 the context to the start of the file.
163
164 -h
165 --section-headers
166 --headers
167 Display summary information from the section headers of the object
168 file.
169
170 File segments may be relocated to nonstandard addresses, for
171 example by using the -Ttext, -Tdata, or -Tbss options to ld.
172 However, some object file formats, such as a.out, do not store the
173 starting address of the file segments. In those situations,
174 although ld relocates the sections correctly, using objdump -h to
175 list the file section headers cannot show the correct addresses.
176 Instead, it shows the usual addresses, which are implicit for the
177 target.
178
179 -H
180 --help
181 Print a summary of the options to objdump and exit.
182
183 -i
184 --info
185 Display a list showing all architectures and object formats
186 available for specification with -b or -m.
187
188 -j name
189 --section=name
190 Display information only for section name.
191
192 -l
193 --line-numbers
194 Label the display (using debugging information) with the filename
195 and source line numbers corresponding to the object code or relocs
196 shown. Only useful with -d, -D, or -r.
197
198 -m machine
199 --architecture=machine
200 Specify the architecture to use when disassembling object files.
201 This can be useful when disassembling object files which do not
202 describe architecture information, such as S-records. You can list
203 the available architectures with the -i option.
204
205 If the target is an ARM architecture then this switch has an
206 additional effect. It restricts the disassembly to only those
207 instructions supported by the architecture specified by machine.
208 If it is necessary to use this switch because the input file does
209 not contain any architecture information, but it is also desired to
210 disassemble all the instructions use -marm.
211
212 -M options
213 --disassembler-options=options
214 Pass target specific information to the disassembler. Only
215 supported on some targets. If it is necessary to specify more than
216 one disassembler option then multiple -M options can be used or can
217 be placed together into a comma separated list.
218
219 If the target is an ARM architecture then this switch can be used
220 to select which register name set is used during disassembler.
221 Specifying -M reg-names-std (the default) will select the register
222 names as used in ARM's instruction set documentation, but with
223 register 13 called 'sp', register 14 called 'lr' and register 15
224 called 'pc'. Specifying -M reg-names-apcs will select the name set
225 used by the ARM Procedure Call Standard, whilst specifying -M reg-
226 names-raw will just use r followed by the register number.
227
228 There are also two variants on the APCS register naming scheme
229 enabled by -M reg-names-atpcs and -M reg-names-special-atpcs which
230 use the ARM/Thumb Procedure Call Standard naming conventions.
231 (Either with the normal register names or the special register
232 names).
233
234 This option can also be used for ARM architectures to force the
235 disassembler to interpret all instructions as Thumb instructions by
236 using the switch --disassembler-options=force-thumb. This can be
237 useful when attempting to disassemble thumb code produced by other
238 compilers.
239
240 For the x86, some of the options duplicate functions of the -m
241 switch, but allow finer grained control. Multiple selections from
242 the following may be specified as a comma separated string.
243 x86-64, i386 and i8086 select disassembly for the given
244 architecture. intel and att select between intel syntax mode and
245 AT&T syntax mode. intel-mnemonic and att-mnemonic select between
246 intel mnemonic mode and AT&T mnemonic mode. intel-mnemonic implies
247 intel and att-mnemonic implies att. addr64, addr32, addr16, data32
248 and data16 specify the default address size and operand size.
249 These four options will be overridden if x86-64, i386 or i8086
250 appear later in the option string. Lastly, suffix, when in AT&T
251 mode, instructs the disassembler to print a mnemonic suffix even
252 when the suffix could be inferred by the operands.
253
254 For PowerPC, booke controls the disassembly of BookE instructions.
255 32 and 64 select PowerPC and PowerPC64 disassembly, respectively.
256 e300 selects disassembly for the e300 family. 440 selects
257 disassembly for the PowerPC 440. ppcps selects disassembly for the
258 paired single instructions of the PPC750CL.
259
260 For MIPS, this option controls the printing of instruction mnemonic
261 names and register names in disassembled instructions. Multiple
262 selections from the following may be specified as a comma separated
263 string, and invalid options are ignored:
264
265 "no-aliases"
266 Print the 'raw' instruction mnemonic instead of some pseudo
267 instruction mnemonic. I.e., print 'daddu' or 'or' instead of
268 'move', 'sll' instead of 'nop', etc.
269
270 "gpr-names=ABI"
271 Print GPR (general-purpose register) names as appropriate for
272 the specified ABI. By default, GPR names are selected
273 according to the ABI of the binary being disassembled.
274
275 "fpr-names=ABI"
276 Print FPR (floating-point register) names as appropriate for
277 the specified ABI. By default, FPR numbers are printed rather
278 than names.
279
280 "cp0-names=ARCH"
281 Print CP0 (system control coprocessor; coprocessor 0) register
282 names as appropriate for the CPU or architecture specified by
283 ARCH. By default, CP0 register names are selected according to
284 the architecture and CPU of the binary being disassembled.
285
286 "hwr-names=ARCH"
287 Print HWR (hardware register, used by the "rdhwr" instruction)
288 names as appropriate for the CPU or architecture specified by
289 ARCH. By default, HWR names are selected according to the
290 architecture and CPU of the binary being disassembled.
291
292 "reg-names=ABI"
293 Print GPR and FPR names as appropriate for the selected ABI.
294
295 "reg-names=ARCH"
296 Print CPU-specific register names (CP0 register and HWR names)
297 as appropriate for the selected CPU or architecture.
298
299 For any of the options listed above, ABI or ARCH may be specified
300 as numeric to have numbers printed rather than names, for the
301 selected types of registers. You can list the available values of
302 ABI and ARCH using the --help option.
303
304 For VAX, you can specify function entry addresses with -M
305 entry:0xf00ba. You can use this multiple times to properly
306 disassemble VAX binary files that don't contain symbol tables (like
307 ROM dumps). In these cases, the function entry mask would
308 otherwise be decoded as VAX instructions, which would probably lead
309 the rest of the function being wrongly disassembled.
310
311 -p
312 --private-headers
313 Print information that is specific to the object file format. The
314 exact information printed depends upon the object file format. For
315 some object file formats, no additional information is printed.
316
317 -r
318 --reloc
319 Print the relocation entries of the file. If used with -d or -D,
320 the relocations are printed interspersed with the disassembly.
321
322 -R
323 --dynamic-reloc
324 Print the dynamic relocation entries of the file. This is only
325 meaningful for dynamic objects, such as certain types of shared
326 libraries. As for -r, if used with -d or -D, the relocations are
327 printed interspersed with the disassembly.
328
329 -s
330 --full-contents
331 Display the full contents of any sections requested. By default
332 all non-empty sections are displayed.
333
334 -S
335 --source
336 Display source code intermixed with disassembly, if possible.
337 Implies -d.
338
339 --prefix=prefix
340 Specify prefix to add to the absolute paths when used with -S.
341
342 --prefix-strip=level
343 Indicate how many initial directory names to strip off the
344 hardwired absolute paths. It has no effect without --prefix=prefix.
345
346 --show-raw-insn
347 When disassembling instructions, print the instruction in hex as
348 well as in symbolic form. This is the default except when
349 --prefix-addresses is used.
350
351 --no-show-raw-insn
352 When disassembling instructions, do not print the instruction
353 bytes. This is the default when --prefix-addresses is used.
354
355 --insn-width=width
356 Display width bytes on a single line when disassembling
357 instructions.
358
359 -W[lLiaprmfFsoRt]
360 --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges]
361 Displays the contents of the debug sections in the file, if any are
362 present. If one of the optional letters or words follows the
363 switch then only data found in those specific sections will be
364 dumped.
365
366 Note that there is no single letter option to display the content
367 of trace sections.
368
369 -G
370 --stabs
371 Display the full contents of any sections requested. Display the
372 contents of the .stab and .stab.index and .stab.excl sections from
373 an ELF file. This is only useful on systems (such as Solaris 2.0)
374 in which ".stab" debugging symbol-table entries are carried in an
375 ELF section. In most other file formats, debugging symbol-table
376 entries are interleaved with linkage symbols, and are visible in
377 the --syms output.
378
379 --start-address=address
380 Start displaying data at the specified address. This affects the
381 output of the -d, -r and -s options.
382
383 --stop-address=address
384 Stop displaying data at the specified address. This affects the
385 output of the -d, -r and -s options.
386
387 -t
388 --syms
389 Print the symbol table entries of the file. This is similar to the
390 information provided by the nm program, although the display format
391 is different. The format of the output depends upon the format of
392 the file being dumped, but there are two main types. One looks
393 like this:
394
395 [ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss
396 [ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred
397
398 where the number inside the square brackets is the number of the
399 entry in the symbol table, the sec number is the section number,
400 the fl value are the symbol's flag bits, the ty number is the
401 symbol's type, the scl number is the symbol's storage class and the
402 nx value is the number of auxilary entries associated with the
403 symbol. The last two fields are the symbol's value and its name.
404
405 The other common output format, usually seen with ELF based files,
406 looks like this:
407
408 00000000 l d .bss 00000000 .bss
409 00000000 g .text 00000000 fred
410
411 Here the first number is the symbol's value (sometimes refered to
412 as its address). The next field is actually a set of characters
413 and spaces indicating the flag bits that are set on the symbol.
414 These characters are described below. Next is the section with
415 which the symbol is associated or *ABS* if the section is absolute
416 (ie not connected with any section), or *UND* if the section is
417 referenced in the file being dumped, but not defined there.
418
419 After the section name comes another field, a number, which for
420 common symbols is the alignment and for other symbol is the size.
421 Finally the symbol's name is displayed.
422
423 The flag characters are divided into 7 groups as follows:
424
425 "l"
426 "g"
427 "u"
428 "!" The symbol is a local (l), global (g), unique global (u),
429 neither global nor local (a space) or both global and local
430 (!). A symbol can be neither local or global for a variety of
431 reasons, e.g., because it is used for debugging, but it is
432 probably an indication of a bug if it is ever both local and
433 global. Unique global symbols are a GNU extension to the
434 standard set of ELF symbol bindings. For such a symbol the
435 dynamic linker will make sure that in the entire process there
436 is just one symbol with this name and type in use.
437
438 "w" The symbol is weak (w) or strong (a space).
439
440 "C" The symbol denotes a constructor (C) or an ordinary symbol (a
441 space).
442
443 "W" The symbol is a warning (W) or a normal symbol (a space). A
444 warning symbol's name is a message to be displayed if the
445 symbol following the warning symbol is ever referenced.
446
447 "I"
448 "i" The symbol is an indirect reference to another symbol (I), a
449 function to be evaluated during reloc processing (i) or a
450 normal symbol (a space).
451
452 "d"
453 "D" The symbol is a debugging symbol (d) or a dynamic symbol (D) or
454 a normal symbol (a space).
455
456 "F"
457 "f"
458 "O" The symbol is the name of a function (F) or a file (f) or an
459 object (O) or just a normal symbol (a space).
460
461 -T
462 --dynamic-syms
463 Print the dynamic symbol table entries of the file. This is only
464 meaningful for dynamic objects, such as certain types of shared
465 libraries. This is similar to the information provided by the nm
466 program when given the -D (--dynamic) option.
467
468 --special-syms
469 When displaying symbols include those which the target considers to
470 be special in some way and which would not normally be of interest
471 to the user.
472
473 -V
474 --version
475 Print the version number of objdump and exit.
476
477 -x
478 --all-headers
479 Display all available header information, including the symbol
480 table and relocation entries. Using -x is equivalent to specifying
481 all of -a -f -h -p -r -t.
482
483 -w
484 --wide
485 Format some lines for output devices that have more than 80
486 columns. Also do not truncate symbol names when they are
487 displayed.
488
489 -z
490 --disassemble-zeroes
491 Normally the disassembly output will skip blocks of zeroes. This
492 option directs the disassembler to disassemble those blocks, just
493 like any other data.
494
495 @file
496 Read command-line options from file. The options read are inserted
497 in place of the original @file option. If file does not exist, or
498 cannot be read, then the option will be treated literally, and not
499 removed.
500
501 Options in file are separated by whitespace. A whitespace
502 character may be included in an option by surrounding the entire
503 option in either single or double quotes. Any character (including
504 a backslash) may be included by prefixing the character to be
505 included with a backslash. The file may itself contain additional
506 @file options; any such options will be processed recursively.
507
509 nm(1), readelf(1), and the Info entries for binutils.
510
512 Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
513 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
514 Software Foundation, Inc.
515
516 Permission is granted to copy, distribute and/or modify this document
517 under the terms of the GNU Free Documentation License, Version 1.3 or
518 any later version published by the Free Software Foundation; with no
519 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
520 Texts. A copy of the license is included in the section entitled "GNU
521 Free Documentation License".
522
523
524
525binutils-2.21 2010-12-08 OBJDUMP(1)