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