1 llvm-objdump - LLVM's object file dumper
2 ========================================
4 .. program:: llvm-objdump
9 :program:`llvm-objdump` [*commands*] [*options*] [*filenames...*]
13 The :program:`llvm-objdump` utility prints the contents of object files and
14 final linked images named on the command line. If no file name is specified,
15 :program:`llvm-objdump` will attempt to read from *a.out*. If *-* is used as a
16 file name, :program:`llvm-objdump` will process a file on its standard input
21 At least one of the following commands are required, and some commands can be
22 combined with other commands:
24 .. option:: -a, --archive-headers
26 Display the information contained within an archive's headers.
28 .. option:: -d, --disassemble
30 Disassemble all executable sections found in the input files.
32 .. option:: -D, --disassemble-all
34 Disassemble all sections found in the input files.
36 .. option:: --disassemble-symbols=<symbol1[,symbol2,...]>
38 Disassemble only the specified symbols. Takes demangled symbol names when
39 :option:`--demangle` is specified, otherwise takes mangled symbol names.
40 Implies :option:`--disassemble`.
42 .. option:: --dwarf=<value>
44 Dump the specified DWARF debug sections. The supported values are:
46 `frames` - .debug_frame
48 .. option:: -f, --file-headers
50 Display the contents of the overall file header.
52 .. option:: --fault-map-section
54 Display the content of the fault map section.
56 .. option:: -h, --headers, --section-headers
58 Display summaries of the headers for each section.
62 Display usage information and exit. Does not stack with other commands.
64 .. option:: -p, --private-headers
66 Display format-specific file headers.
68 .. option:: -r, --reloc
70 Display the relocation entries in the file.
72 .. option:: -R, --dynamic-reloc
74 Display the dynamic relocation entries in the file.
76 .. option:: --raw-clang-ast
78 Dump the raw binary contents of the clang AST section.
80 .. option:: -s, --full-contents
82 Display the contents of each section.
84 .. option:: -t, --syms
86 Display the symbol table.
88 .. option:: -T, --dynamic-syms
90 Display the contents of the dynamic symbol table.
92 .. option:: -u, --unwind-info
94 Display the unwind info of the input(s).
96 This operation is only currently supported for COFF and Mach-O object files.
98 .. option:: -v, --version
100 Display the version of the :program:`llvm-objdump` executable. Does not stack
103 .. option:: -x, --all-headers
105 Display all available header information. Equivalent to specifying
106 :option:`--archive-headers`, :option:`--file-headers`,
107 :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`,
108 and :option:`--syms`.
112 :program:`llvm-objdump` supports the following options:
114 .. option:: --adjust-vma=<offset>
116 Increase the displayed address in disassembly or section header printing by
117 the specified offset.
119 .. option:: --arch-name=<string>
121 Specify the target architecture when disassembling. Use :option:`--version`
122 for a list of available targets.
124 .. option:: -C, --demangle
126 Demangle symbol names in the output.
128 .. option:: --debug-vars=<format>
130 Print the locations (in registers or memory) of source-level variables
131 alongside disassembly. ``format`` may be ``unicode`` or ``ascii``, defaulting
132 to ``unicode`` if omitted.
134 .. option:: --debug-vars-indent=<width>
136 Distance to indent the source-level variable display, relative to the start
137 of the disassembly. Defaults to 52 characters.
139 .. option:: -j, --section=<section1[,section2,...]>
141 Perform commands on the specified sections only. For Mach-O use
142 `segment,section` to specify the section name.
144 .. option:: -l, --line-numbers
146 When disassembling, display source line numbers. Implies
147 :option:`--disassemble`.
149 .. option:: -M, --disassembler-options=<opt1[,opt2,...]>
151 Pass target-specific disassembler options. Available options:
153 * ``reg-names-std``: ARM only (default). Print in ARM 's instruction set documentation, with r13/r14/r15 replaced by sp/lr/pc.
154 * ``reg-names-raw``: ARM only. Use r followed by the register number.
155 * ``no-aliases``: AArch64 and RISC-V only. Print raw instruction mnemonic instead of pseudo instruction mnemonic.
156 * ``numeric``: RISC-V only. Print raw register names instead of ABI mnemonic. (e.g. print x1 instead of ra)
157 * ``att``: x86 only (default). Print in the AT&T syntax.
158 * ``intel``: x86 only. Print in the intel syntax.
160 .. option:: --mcpu=<cpu-name>
162 Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display
165 .. option:: --mattr=<a1,+a2,-a3,...>
167 Enable/disable target-specific attributes. Specify ``--mattr=help`` to display
168 the available attributes.
170 .. option:: --no-leading-addr
172 When disassembling, do not print leading addresses.
174 .. option:: --no-print-imm-hex
176 Do not use hex format for immediate values in disassembly output (default).
178 .. option:: --no-show-raw-insn
180 When disassembling, do not print the raw bytes of each instruction.
182 .. option:: --prefix=<prefix>
184 When disassembling with the :option:`--source` option, prepend ``prefix`` to
187 .. option:: --prefix-strip=<level>
189 When disassembling with the :option:`--source` option, strip out ``level``
190 initial directories from absolute paths. This option has no effect without
193 .. option:: --print-imm-hex
195 Use hex format when printing immediate values in disassembly output.
197 .. option:: -S, --source
199 When disassembling, display source interleaved with the disassembly. Implies
200 :option:`--disassemble`.
202 .. option:: --show-lma
204 Display the LMA column when dumping ELF section headers. Defaults to off
205 unless any section has different VMA and LMAs.
207 .. option:: --start-address=<address>
209 When disassembling, only disassemble from the specified address.
211 When printing relocations, only print the relocations patching offsets from at least ``address``.
213 When printing symbols, only print symbols with a value of at least ``address``.
215 .. option:: --stop-address=<address>
217 When disassembling, only disassemble up to, but not including the specified address.
219 When printing relocations, only print the relocations patching offsets up to ``address``.
221 When printing symbols, only print symbols with a value up to ``address``.
223 .. option:: --symbolize-operands
225 When disassembling, symbolize a branch target operand to print a label instead of a real address.
227 When printing a PC-relative global symbol reference, print it as an offset from the leading symbol.
229 Only works with an X86 linked image.
232 A non-symbolized branch instruction with a local target and pc-relative memory access like
236 cmp eax, dword ptr [rip + 4112]
237 jge 0x20117e <_start+0x25>
244 cmp eax, dword ptr <g>
247 .. option:: --triple=<string>
249 Target triple to disassemble for, see ``--version`` for available targets.
251 .. option:: -w, --wide
253 Ignored for compatibility with GNU objdump.
255 .. option:: --x86-asm-syntax=<style>
258 When used with :option:`--disassemble`, choose style of code to emit from
259 X86 backend. Supported values are:
270 The default disassembly style is **att**.
272 .. option:: -z, --disassemble-zeroes
274 Do not skip blocks of zeroes when disassembling.
278 Read command-line options and commands from response file `<FILE>`.
280 MACH-O ONLY OPTIONS AND COMMANDS
281 --------------------------------
283 .. option:: --arch=<architecture>
285 Specify the architecture to disassemble. see ``--version`` for available
288 .. option:: --archive-member-offsets
290 Print the offset to each archive member for Mach-O archives (requires
291 :option:`--archive-headers`).
297 .. option:: --data-in-code
299 Display the data in code table.
301 .. option:: --dis-symname=<name>
303 Disassemble just the specified symbol's instructions.
305 .. option:: --dylibs-used
307 Display the shared libraries used for linked files.
309 .. option:: --dsym=<string>
311 Use .dSYM file for debug info.
313 .. option:: --dylib-id
315 Display the shared library's ID for dylib files.
317 .. option:: --exports-trie
319 Display exported symbols.
321 .. option:: --function-starts
323 Print the function starts table for Mach-O objects.
327 Print line information from debug info if available.
329 .. option:: --full-leading-addr
331 Print the full leading address when disassembling.
333 .. option:: --indirect-symbols
335 Display the indirect symbol table.
337 .. option:: --info-plist
339 Display the info plist section as strings.
341 .. option:: --lazy-bind
343 Display lazy binding info.
345 .. option:: --link-opt-hints
347 Display the linker optimization hints.
349 .. option:: -m, --macho
351 Use Mach-O specific object file parser. Commands and other options may behave
352 differently when used with ``--macho``.
354 .. option:: --no-leading-headers
356 Do not print any leading headers.
358 .. option:: --no-symbolic-operands
360 Do not print symbolic operands when disassembling.
362 .. option:: --non-verbose
364 Display the information for Mach-O objects in non-verbose or numeric form.
366 .. option:: --objc-meta-data
368 Display the Objective-C runtime meta data.
370 .. option:: --private-header
372 Display only the first format specific file header.
376 Display rebasing information.
380 Display runtime search paths for the binary.
382 .. option:: --universal-headers
384 Display universal headers.
386 .. option:: --weak-bind
388 Display weak binding information.
390 XCOFF ONLY OPTIONS AND COMMANDS
391 ---------------------------------
393 .. option:: --symbol-description
395 Add symbol description to disassembly output.
400 To report bugs, please visit <https://bugs.llvm.org/>.
405 :manpage:`llvm-nm(1)`, :manpage:`llvm-otool(1)`, :manpage:`llvm-readelf(1)`,
406 :manpage:`llvm-readobj(1)`