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 text 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 .. option:: -v, --version
98 Display the version of the :program:`llvm-objdump` executable. Does not stack
101 .. option:: -x, --all-headers
103 Display all available header information. Equivalent to specifying
104 :option:`--archive-headers`, :option:`--file-headers`,
105 :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`,
106 and :option:`--syms`.
110 :program:`llvm-objdump` supports the following options:
112 .. option:: --adjust-vma=<offset>
114 Increase the displayed address in disassembly or section header printing by
115 the specified offset.
117 .. option:: --arch-name=<string>
119 Specify the target architecture when disassembling. Use :option:`--version`
120 for a list of available targets.
122 .. option:: -C, --demangle
124 Demangle symbol names in the output.
126 .. option:: --debug-vars=<format>
128 Print the locations (in registers or memory) of source-level variables
129 alongside disassembly. ``format`` may be ``unicode`` or ``ascii``, defaulting
130 to ``unicode`` if omitted.
132 .. option:: --debug-vars-indent=<width>
134 Distance to indent the source-level variable display, relative to the start
135 of the disassembly. Defaults to 52 characters.
137 .. option:: -j, --section=<section1[,section2,...]>
139 Perform commands on the specified sections only. For Mach-O use
140 `segment,section` to specify the section name.
142 .. option:: -l, --line-numbers
144 When disassembling, display source line numbers. Implies
145 :option:`--disassemble`.
147 .. option:: -M, --disassembler-options=<opt1[,opt2,...]>
149 Pass target-specific disassembler options. Available options:
151 * ``reg-names-std``: ARM only (default). Print in ARM 's instruction set documentation, with r13/r14/r15 replaced by sp/lr/pc.
152 * ``reg-names-raw``: ARM only. Use r followed by the register number.
153 * ``no-aliases``: AArch64 and RISC-V only. Print raw instruction mnemonic instead of pesudo instruction mnemonic.
154 * ``numeric``: RISC-V only. Print raw register names instead of ABI mnemonic. (e.g. print x1 instead of ra)
155 * ``att``: x86 only (default). Print in the AT&T syntax.
156 * ``intel``: x86 only. Print in the intel syntax.
158 .. option:: --mcpu=<cpu-name>
160 Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display
163 .. option:: --mattr=<a1,+a2,-a3,...>
165 Enable/disable target-specific attributes. Specify ``--mattr=help`` to display
166 the available attributes.
168 .. option:: --no-leading-addr
170 When disassembling, do not print leading addresses.
172 .. option:: --no-print-imm-hex
174 Do not use hex format for immediate values in disassembly output (default).
176 .. option:: --no-show-raw-insn
178 When disassembling, do not print the raw bytes of each instruction.
180 .. option:: --prefix=<prefix>
182 When disassembling with the :option:`--source` option, prepend ``prefix`` to
185 .. option:: --prefix-strip=<level>
187 When disassembling with the :option:`--source` option, strip out ``level``
188 initial directories from absolute paths. This option has no effect without
191 .. option:: --print-imm-hex
193 Use hex format when printing immediate values in disassembly output.
195 .. option:: -S, --source
197 When disassembling, display source interleaved with the disassembly. Implies
198 :option:`--disassemble`.
200 .. option:: --show-lma
202 Display the LMA column when dumping ELF section headers. Defaults to off
203 unless any section has different VMA and LMAs.
205 .. option:: --start-address=<address>
207 When disassembling, only disassemble from the specified address.
209 When printing relocations, only print the relocations patching offsets from at least ``address``.
211 When printing symbols, only print symbols with a value of at least ``address``.
213 .. option:: --stop-address=<address>
215 When disassembling, only disassemble up to, but not including the specified address.
217 When printing relocations, only print the relocations patching offsets up to ``address``.
219 When printing symbols, only print symbols with a value up to ``address``.
221 .. option:: --symbolize-operands
223 When disassembling, symbolize a branch target operand to print a label instead of a real address.
225 When printing a PC-relative global symbol reference, print it as an offset from the leading symbol.
227 Only works with an X86 linked image.
230 A non-symbolized branch instruction with a local target and pc-relative memory access like
234 cmp eax, dword ptr [rip + 4112]
235 jge 0x20117e <_start+0x25>
242 cmp eax, dword ptr <g>
245 .. option:: --triple=<string>
247 Target triple to disassemble for, see ``--version`` for available targets.
249 .. option:: -w, --wide
251 Ignored for compatibility with GNU objdump.
253 .. option:: --x86-asm-syntax=<style>
256 When used with :option:`--disassemble`, choose style of code to emit from
257 X86 backend. Supported values are:
268 The default disassembly style is **att**.
270 .. option:: -z, --disassemble-zeroes
272 Do not skip blocks of zeroes when disassembling.
276 Read command-line options and commands from response file `<FILE>`.
278 MACH-O ONLY OPTIONS AND COMMANDS
279 --------------------------------
281 .. option:: --arch=<architecture>
283 Specify the architecture to disassemble. see ``--version`` for available
286 .. option:: --archive-member-offsets
288 Print the offset to each archive member for Mach-O archives (requires
289 :option:`--archive-headers`).
295 .. option:: --data-in-code
297 Display the data in code table.
299 .. option:: --dis-symname=<name>
301 Disassemble just the specified symbol's instructions.
303 .. option:: --dylibs-used
305 Display the shared libraries used for linked files.
307 .. option:: --dsym=<string>
309 Use .dSYM file for debug info.
311 .. option:: --dylib-id
313 Display the shared library's ID for dylib files.
315 .. option:: --exports-trie
317 Display exported symbols.
319 .. option:: --function-starts
321 Print the function starts table for Mach-O objects.
325 Print line information from debug info if available.
327 .. option:: --full-leading-addr
329 Print the full leading address when disassembling.
331 .. option:: --indirect-symbols
333 Display the indirect symbol table.
335 .. option:: --info-plist
337 Display the info plist section as strings.
339 .. option:: --lazy-bind
341 Display lazy binding info.
343 .. option:: --link-opt-hints
345 Display the linker optimization hints.
347 .. option:: -m, --macho
349 Use Mach-O specific object file parser. Commands and other options may behave
350 differently when used with ``--macho``.
352 .. option:: --no-leading-headers
354 Do not print any leading headers.
356 .. option:: --no-symbolic-operands
358 Do not print symbolic operands when disassembling.
360 .. option:: --non-verbose
362 Display the information for Mach-O objects in non-verbose or numeric form.
364 .. option:: --objc-meta-data
366 Display the Objective-C runtime meta data.
368 .. option:: --private-header
370 Display only the first format specific file header.
374 Display rebasing information.
378 Display runtime search paths for the binary.
380 .. option:: --universal-headers
382 Display universal headers.
384 .. option:: --weak-bind
386 Display weak binding information.
388 XCOFF ONLY OPTIONS AND COMMANDS
389 ---------------------------------
391 .. option:: --symbol-description
393 Add symbol description to disassembly output.
398 To report bugs, please visit <https://bugs.llvm.org/>.
403 :manpage:`llvm-nm(1)`, :manpage:`llvm-otool(1)`, :manpage:`llvm-readelf(1)`,
404 :manpage:`llvm-readobj(1)`