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