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. On some
31 architectures (AArch64, PowerPC, x86), all known instructions are disassembled by
32 default. On the others, :option:`--mcpu` or :option:`--mattr` is needed to
33 enable some instruction sets. Disabled instructions are displayed as
36 .. option:: -D, --disassemble-all
38 Disassemble all sections found in the input files.
40 .. option:: --disassemble-symbols=<symbol1[,symbol2,...]>
42 Disassemble only the specified symbols. Takes demangled symbol names when
43 :option:`--demangle` is specified, otherwise takes mangled symbol names.
44 Implies :option:`--disassemble`.
46 .. option:: --dwarf=<value>
48 Dump the specified DWARF debug sections. The supported values are:
50 `frames` - .debug_frame
52 .. option:: -f, --file-headers
54 Display the contents of the overall file header.
56 .. option:: --fault-map-section
58 Display the content of the fault map section.
60 .. option:: -h, --headers, --section-headers
62 Display summaries of the headers for each section.
66 Display usage information and exit. Does not stack with other commands.
68 .. option:: -p, --private-headers
70 Display format-specific file headers.
72 .. option:: -r, --reloc
74 Display the relocation entries in the file.
76 .. option:: -R, --dynamic-reloc
78 Display the dynamic relocation entries in the file.
80 .. option:: --raw-clang-ast
82 Dump the raw binary contents of the clang AST section.
84 .. option:: -s, --full-contents
86 Display the contents of each section.
88 .. option:: -t, --syms
90 Display the symbol table.
92 .. option:: -T, --dynamic-syms
94 Display the contents of the dynamic symbol table.
96 .. option:: -u, --unwind-info
98 Display the unwind info of the input(s).
100 This operation is only currently supported for COFF and Mach-O object files.
102 .. option:: -v, --version
104 Display the version of the :program:`llvm-objdump` executable. Does not stack
107 .. option:: -x, --all-headers
109 Display all available header information. Equivalent to specifying
110 :option:`--archive-headers`, :option:`--file-headers`,
111 :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`,
112 and :option:`--syms`.
116 :program:`llvm-objdump` supports the following options:
118 .. option:: --adjust-vma=<offset>
120 Increase the displayed address in disassembly or section header printing by
121 the specified offset.
123 .. option:: --arch-name=<string>
125 Specify the target architecture when disassembling. Use :option:`--version`
126 for a list of available targets.
128 .. option:: --build-id=<string>
130 Look up the object using the given build ID, specified as a hexadecimal
131 string. The found object is handled as if it were an input filename.
133 .. option:: -C, --demangle
135 Demangle symbol names in the output.
137 .. option:: --debug-file-directory <path>
139 Provide a path to a directory with a `.build-id` subdirectory to search for
140 debug information for stripped binaries. Multiple instances of this argument
141 are searched in the order given.
143 .. option:: --debuginfod, --no-debuginfod
145 Whether or not to try debuginfod lookups for debug binaries. Unless specified,
146 debuginfod is only enabled if libcurl was compiled in (``LLVM_ENABLE_CURL``)
147 and at least one server URL was provided by the environment variable
150 .. option:: --debug-vars=<format>
152 Print the locations (in registers or memory) of source-level variables
153 alongside disassembly. ``format`` may be ``unicode`` or ``ascii``, defaulting
154 to ``unicode`` if omitted.
156 .. option:: --debug-vars-indent=<width>
158 Distance to indent the source-level variable display, relative to the start
159 of the disassembly. Defaults to 52 characters.
161 .. option:: -j, --section=<section1[,section2,...]>
163 Perform commands on the specified sections only. For Mach-O use
164 `segment,section` to specify the section name.
166 .. option:: -l, --line-numbers
168 When disassembling, display source line numbers. Implies
169 :option:`--disassemble`.
171 .. option:: -M, --disassembler-options=<opt1[,opt2,...]>
173 Pass target-specific disassembler options. Available options:
175 * ``reg-names-std``: ARM only (default). Print in ARM 's instruction set documentation, with r13/r14/r15 replaced by sp/lr/pc.
176 * ``reg-names-raw``: ARM only. Use r followed by the register number.
177 * ``no-aliases``: AArch64 and RISC-V only. Print raw instruction mnemonic instead of pseudo instruction mnemonic.
178 * ``numeric``: RISC-V only. Print raw register names instead of ABI mnemonic. (e.g. print x1 instead of ra)
179 * ``att``: x86 only (default). Print in the AT&T syntax.
180 * ``intel``: x86 only. Print in the intel syntax.
183 .. option:: --disassembler-color=<mode>
185 Enable or disable disassembler color output.
187 * ``off``: Disable disassembler color output.
188 * ``on``: Enable disassembler color output.
189 * ``terminal``: Enable disassembler color output if the terminal supports it (default).
191 .. option:: --mcpu=<cpu-name>
193 Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display
196 .. option:: --mattr=<a1,+a2,-a3,...>
198 Enable/disable target-specific attributes. Specify ``--mattr=help`` to display
199 the available attributes.
201 .. option:: -mllvm <arg>
203 Specify an argument to forward to LLVM's CommandLine library.
205 .. option:: --no-leading-addr, --no-addresses
207 When disassembling, do not print leading addresses for instructions or inline
210 .. option:: --no-print-imm-hex
212 Do not use hex format for immediate values in disassembly output.
214 .. option:: --no-show-raw-insn
216 When disassembling, do not print the raw bytes of each instruction.
218 .. option:: --offloading
220 Display the content of the LLVM offloading section.
222 .. option:: --prefix=<prefix>
224 When disassembling with the :option:`--source` option, prepend ``prefix`` to
227 .. option:: --prefix-strip=<level>
229 When disassembling with the :option:`--source` option, strip out ``level``
230 initial directories from absolute paths. This option has no effect without
233 .. option:: --print-imm-hex
235 Use hex format when printing immediate values in disassembly output (default).
237 .. option:: -S, --source
239 When disassembling, display source interleaved with the disassembly. Implies
240 :option:`--disassemble`.
242 .. option:: --show-all-symbols
244 Show all symbols during disassembly, even if multiple symbols are defined at
247 .. option:: --show-lma
249 Display the LMA column when dumping ELF section headers. Defaults to off
250 unless any section has different VMA and LMAs.
252 .. option:: --start-address=<address>
254 When disassembling, only disassemble from the specified address.
256 When printing relocations, only print the relocations patching offsets from at least ``address``.
258 When printing symbols, only print symbols with a value of at least ``address``.
260 .. option:: --stop-address=<address>
262 When disassembling, only disassemble up to, but not including the specified address.
264 When printing relocations, only print the relocations patching offsets up to ``address``.
266 When printing symbols, only print symbols with a value up to ``address``.
268 .. option:: --symbolize-operands
270 When disassembling, symbolize a branch target operand to print a label instead of a real address.
272 When printing a PC-relative global symbol reference, print it as an offset from the leading symbol.
274 When a bb-address-map section is present (i.e., the object file is built with
275 ``-fbasic-block-address-map``), labels are retrieved from that section
276 instead. If a pgo-analysis-map is present alongside the bb-address-map, any
277 available analyses are printed after the relevant block label. By default,
278 any analysis with a special representation (i.e. BlockFrequency,
279 BranchProbability, etc) are printed as raw hex values.
281 Only works with PowerPC objects or X86 linked images.
284 A non-symbolized branch instruction with a local target and pc-relative memory access like
288 cmp eax, dword ptr [rip + 4112]
289 jge 0x20117e <_start+0x25>
296 cmp eax, dword ptr <g>
299 .. option:: --pretty-pgo-analysis-map
301 When using :option:`--symbolize-operands` with bb-address-map and
302 pgo-analysis-map, print analyses using the same format as their analysis
303 passes would. An example of pretty format would be printing block frequencies
304 relative to the entry block, the same as BFI.
306 Only works when :option:`--symbolize-operands` is enabled.
308 .. option:: --triple=<string>
310 Target triple to disassemble for, see ``--version`` for available targets.
312 .. option:: -w, --wide
314 Ignored for compatibility with GNU objdump.
316 .. option:: --x86-asm-syntax=<style>
319 When used with :option:`--disassemble`, choose style of code to emit from
320 X86 backend. Supported values are:
331 The default disassembly style is **att**.
333 .. option:: -z, --disassemble-zeroes
335 Do not skip blocks of zeroes when disassembling.
339 Read command-line options and commands from response file `<FILE>`.
341 MACH-O ONLY OPTIONS AND COMMANDS
342 --------------------------------
344 .. option:: --arch=<architecture>
346 Specify the architecture to disassemble. see ``--version`` for available
349 .. option:: --archive-member-offsets
351 Print the offset to each archive member for Mach-O archives (requires
352 :option:`--archive-headers`).
358 .. option:: --data-in-code
360 Display the data in code table.
362 .. option:: --dis-symname=<name>
364 Disassemble just the specified symbol's instructions.
366 .. option:: --chained-fixups
368 Print chained fixup information.
370 .. option:: --dyld-info
372 Print bind and rebase information used by dyld to resolve external
373 references in a final linked binary.
375 .. option:: --dylibs-used
377 Display the shared libraries used for linked files.
379 .. option:: --dsym=<string>
381 Use .dSYM file for debug info.
383 .. option:: --dylib-id
385 Display the shared library's ID for dylib files.
387 .. option:: --exports-trie
389 Display exported symbols.
391 .. option:: --function-starts [=<addrs|names|both>]
393 Print the function starts table for Mach-O objects. Either ``addrs``
394 (default) to print only the addresses of functions, ``names`` to print only
395 the names of the functions (when available), or ``both`` to print the
396 names beside the addresses.
400 Print line information from debug info if available.
402 .. option:: --full-leading-addr
404 Print the full leading address when disassembling.
406 .. option:: --indirect-symbols
408 Display the indirect symbol table.
410 .. option:: --info-plist
412 Display the info plist section as strings.
414 .. option:: --lazy-bind
416 Display lazy binding info.
418 .. option:: --link-opt-hints
420 Display the linker optimization hints.
422 .. option:: -m, --macho
424 Use Mach-O specific object file parser. Commands and other options may behave
425 differently when used with ``--macho``.
427 .. option:: --no-leading-headers
429 Do not print any leading headers.
431 .. option:: --no-symbolic-operands
433 Do not print symbolic operands when disassembling.
435 .. option:: --non-verbose
437 Display the information for Mach-O objects in non-verbose or numeric form.
439 .. option:: --objc-meta-data
441 Display the Objective-C runtime meta data.
443 .. option:: --private-header
445 Display only the first format specific file header.
449 Display rebasing information.
453 Display runtime search paths for the binary.
455 .. option:: --universal-headers
457 Display universal headers.
459 .. option:: --weak-bind
461 Display weak binding information.
463 XCOFF ONLY OPTIONS AND COMMANDS
464 ---------------------------------
466 .. option:: --symbol-description
468 Add symbol description to disassembly output.
470 .. option:: --traceback-table
472 Decode traceback table in disassembly output. Implies :option:`--disassemble`.
477 To report bugs, please visit <https://github.com/llvm/llvm-project/labels/tools:llvm-objdump/>.
482 :manpage:`llvm-nm(1)`, :manpage:`llvm-otool(1)`, :manpage:`llvm-readelf(1)`,
483 :manpage:`llvm-readobj(1)`