490 lines · plain
1llvm-objdump - LLVM's object file dumper2========================================3 4.. program:: llvm-objdump5 6SYNOPSIS7--------8 9:program:`llvm-objdump` [*commands*] [*options*] [*filenames...*]10 11DESCRIPTION12-----------13The :program:`llvm-objdump` utility prints the contents of object files and14final 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 a16file name, :program:`llvm-objdump` will process a file on its standard input17stream.18 19COMMANDS20--------21At least one of the following commands are required, and some commands can be22combined with other commands:23 24.. option:: -a, --archive-headers25 26 Display the information contained within an archive's headers.27 28.. option:: -d, --disassemble29 30 Disassemble all executable sections found in the input files. On some31 architectures (AArch64, PowerPC, x86), all known instructions are disassembled by32 default. On the others, :option:`--mcpu` or :option:`--mattr` is needed to33 enable some instruction sets. Disabled instructions are displayed as34 ``<unknown>``.35 36.. option:: -D, --disassemble-all37 38 Disassemble all sections found in the input files.39 40.. option:: --disassemble-symbols=<symbol1[,symbol2,...]>41 42 Disassemble only the specified symbols. Takes demangled symbol names when43 :option:`--demangle` is specified, otherwise takes mangled symbol names.44 Implies :option:`--disassemble`.45 46.. option:: --dwarf=<value>47 48 Dump the specified DWARF debug sections. The supported values are:49 50 `frames` - .debug_frame51 52.. option:: -f, --file-headers53 54 Display the contents of the overall file header.55 56.. option:: --fault-map-section57 58 Display the content of the fault map section.59 60.. option:: -h, --headers, --section-headers61 62 Display summaries of the headers for each section.63 64.. option:: --help65 66 Display usage information and exit. Does not stack with other commands.67 68.. option:: -p, --private-headers69 70 Display format-specific file headers.71 72.. option:: -r, --reloc73 74 Display the relocation entries in the file.75 76.. option:: -R, --dynamic-reloc77 78 Display the dynamic relocation entries in the file.79 80.. option:: --raw-clang-ast81 82 Dump the raw binary contents of the clang AST section.83 84.. option:: -s, --full-contents85 86 Display the contents of each section.87 88.. option:: -t, --syms89 90 Display the symbol table.91 92.. option:: -T, --dynamic-syms93 94 Display the contents of the dynamic symbol table.95 96.. option:: -u, --unwind-info97 98 Display the unwind info of the input(s).99 100 This operation is only currently supported for COFF and Mach-O object files.101 102.. option:: -v, --version103 104 Display the version of the :program:`llvm-objdump` executable. Does not stack105 with other commands.106 107.. option:: -x, --all-headers108 109 Display all available header information. Equivalent to specifying110 :option:`--archive-headers`, :option:`--file-headers`,111 :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`,112 and :option:`--syms`.113 114OPTIONS115-------116:program:`llvm-objdump` supports the following options:117 118.. option:: --adjust-vma=<offset>119 120 Increase the displayed address in disassembly or section header printing by121 the specified offset.122 123.. option:: --arch-name=<string>124 125 Specify the target architecture when disassembling. Use :option:`--version`126 for a list of available targets.127 128.. option:: --build-id=<string>129 130 Look up the object using the given build ID, specified as a hexadecimal131 string. The found object is handled as if it were an input filename.132 133.. option:: -C, --demangle134 135 Demangle symbol names in the output.136 137.. option:: --debug-file-directory <path>138 139 Provide a path to a directory with a `.build-id` subdirectory to search for140 debug information for stripped binaries. Multiple instances of this argument141 are searched in the order given.142 143.. option:: --debug-indent=<width>144 145 Distance to indent the source-level variable or inlined function display,146 relative to the start of the disassembly. Defaults to 52 characters.147 148.. option:: --debug-inlined-funcs[=<format>]149 150 Print the locations of inlined functions alongside disassembly.151 ``format`` may be ``ascii``, ``limits-only``, or ``unicode``, defaulting to152 ``unicode`` if omitted.153 154.. option:: --debug-vars[=<format>]155 156 Print the locations (in registers or memory) of source-level variables157 alongside disassembly. ``format`` may be ``ascii`` or ``unicode``, defaulting158 to ``unicode`` if omitted.159 160.. option:: --debuginfod, --no-debuginfod161 162 Whether or not to try debuginfod lookups for debug binaries. Unless specified,163 debuginfod is only enabled if libcurl was compiled in (``LLVM_ENABLE_CURL``)164 and at least one server URL was provided by the environment variable165 ``DEBUGINFOD_URLS``.166 167.. option:: -j, --section=<section1[,section2,...]>168 169 Perform commands on the specified sections only. For Mach-O use170 `segment,section` to specify the section name.171 172.. option:: -l, --line-numbers173 174 When disassembling, display source line numbers. Implies175 :option:`--disassemble`.176 177.. option:: -M, --disassembler-options=<opt1[,opt2,...]>178 179 Pass target-specific disassembler options. Available options:180 181 * ``reg-names-std``: ARM only (default). Print in ARM 's instruction set documentation, with r13/r14/r15 replaced by sp/lr/pc.182 * ``reg-names-raw``: ARM only. Use r followed by the register number.183 * ``no-aliases``: AArch64 and RISC-V only. Print raw instruction mnemonic instead of pseudo instruction mnemonic.184 * ``numeric``: RISC-V only. Print raw register names instead of ABI mnemonic. (e.g. print x1 instead of ra)185 * ``att``: x86 only (default). Print in the AT&T syntax.186 * ``intel``: x86 only. Print in the intel syntax.187 188 189.. option:: --disassembler-color=<mode>190 191 Enable or disable disassembler color output.192 193 * ``off``: Disable disassembler color output.194 * ``on``: Enable disassembler color output.195 * ``terminal``: Enable disassembler color output if the terminal supports it (default).196 197.. option:: --mcpu=<cpu-name>198 199 Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display200 available CPUs.201 202.. option:: --mattr=<a1,+a2,-a3,...>203 204 Enable/disable target-specific attributes. Specify ``--mattr=help`` to display205 the available attributes.206 207.. option:: -mllvm <arg>208 209 Specify an argument to forward to LLVM's CommandLine library.210 211.. option:: --no-leading-addr, --no-addresses212 213 When disassembling, do not print leading addresses for instructions or inline214 relocations.215 216.. option:: --no-print-imm-hex217 218 Do not use hex format for immediate values in disassembly output.219 220.. option:: --no-show-raw-insn221 222 When disassembling, do not print the raw bytes of each instruction.223 224.. option:: --offloading225 226 Display the content of the LLVM offloading sections and HIP offload bundles.227 228.. option:: --prefix=<prefix>229 230 When disassembling with the :option:`--source` option, prepend ``prefix`` to231 absolute paths.232 233.. option:: --prefix-strip=<level>234 235 When disassembling with the :option:`--source` option, strip out ``level``236 initial directories from absolute paths. This option has no effect without237 :option:`--prefix`.238 239.. option:: --print-imm-hex240 241 Use hex format when printing immediate values in disassembly output (default).242 243.. option:: -S, --source244 245 When disassembling, display source interleaved with the disassembly. Implies246 :option:`--disassemble`.247 248.. option:: --show-all-symbols249 250 Show all symbols during disassembly, even if multiple symbols are defined at251 the same location.252 253.. option:: --show-lma254 255 Display the LMA column when dumping ELF section headers. Defaults to off256 unless any section has different VMA and LMAs.257 258.. option:: --start-address=<address>259 260 When disassembling, only disassemble from the specified address.261 262 When printing relocations, only print the relocations patching offsets from at least ``address``.263 264 When printing symbols, only print symbols with a value of at least ``address``.265 266.. option:: --stop-address=<address>267 268 When disassembling, only disassemble up to, but not including the specified address.269 270 When printing relocations, only print the relocations patching offsets up to ``address``.271 272 When printing symbols, only print symbols with a value up to ``address``.273 274.. option:: --symbolize-operands275 276 When disassembling, symbolize a branch target operand to print a label instead of a real address.277 278 When printing a PC-relative global symbol reference, print it as an offset from the leading symbol.279 280 When a bb-address-map section is present (i.e., the object file is built with281 ``-fbasic-block-address-map``), labels are retrieved from that section282 instead. If a pgo-analysis-map is present alongside the bb-address-map, any283 available analyses are printed after the relevant block label. By default,284 any analysis with a special representation (i.e. BlockFrequency,285 BranchProbability, etc) are printed as raw hex values.286 287 Only supported for AArch64, BPF, PowerPC, and X86.288 289 Example:290 A non-symbolized branch instruction with a local target and pc-relative memory access like291 292 .. code-block:: none293 294 cmp eax, dword ptr [rip + 4112]295 jge 0x20117e <_start+0x25>296 297 might become298 299 .. code-block:: none300 301 <L0>:302 cmp eax, dword ptr <g>303 jge <L0>304 305.. option:: --pretty-pgo-analysis-map306 307 When using :option:`--symbolize-operands` with bb-address-map and308 pgo-analysis-map, print analyses using the same format as their analysis309 passes would. An example of pretty format would be printing block frequencies310 relative to the entry block, the same as BFI.311 312 Only works when :option:`--symbolize-operands` is enabled.313 314.. option:: --triple=<string>315 316 Target triple to disassemble for, see ``--version`` for available targets.317 318.. option:: -w, --wide319 320 Ignored for compatibility with GNU objdump.321 322.. option:: --x86-asm-syntax=<style>323 324 Deprecated.325 When used with :option:`--disassemble`, choose style of code to emit from326 X86 backend. Supported values are:327 328 .. option:: att329 330 AT&T-style assembly331 332 .. option:: intel333 334 Intel-style assembly335 336 337 The default disassembly style is **att**.338 339.. option:: -z, --disassemble-zeroes340 341 Do not skip blocks of zeroes when disassembling.342 343.. option:: @<FILE>344 345 Read command-line options and commands from response file `<FILE>`.346 347MACH-O ONLY OPTIONS AND COMMANDS348--------------------------------349 350.. option:: --arch=<architecture>351 352 Specify the architecture to disassemble. see ``--version`` for available353 architectures.354 355.. option:: --archive-member-offsets356 357 Print the offset to each archive member for Mach-O archives (requires358 :option:`--archive-headers`).359 360.. option:: --bind361 362 Display binding info363 364.. option:: --data-in-code365 366 Display the data in code table.367 368.. option:: --dis-symname=<name>369 370 Disassemble just the specified symbol's instructions.371 372.. option:: --chained-fixups373 374 Print chained fixup information.375 376.. option:: --dyld-info377 378 Print bind and rebase information used by dyld to resolve external379 references in a final linked binary.380 381.. option:: --dylibs-used382 383 Display the shared libraries used for linked files.384 385.. option:: --dsym=<string>386 387 Use .dSYM file for debug info.388 389.. option:: --dylib-id390 391 Display the shared library's ID for dylib files.392 393.. option:: --exports-trie394 395 Display exported symbols.396 397.. option:: --function-starts [=<addrs|names|both>]398 399 Print the function starts table for Mach-O objects. Either ``addrs``400 (default) to print only the addresses of functions, ``names`` to print only401 the names of the functions (when available), or ``both`` to print the402 names beside the addresses.403 404.. option:: -g405 406 Print line information from debug info if available.407 408.. option:: --full-leading-addr409 410 Print the full leading address when disassembling.411 412.. option:: --indirect-symbols413 414 Display the indirect symbol table.415 416.. option:: --info-plist417 418 Display the info plist section as strings.419 420.. option:: --lazy-bind421 422 Display lazy binding info.423 424.. option:: --link-opt-hints425 426 Display the linker optimization hints.427 428.. option:: -m, --macho429 430 Use Mach-O specific object file parser. Commands and other options may behave431 differently when used with ``--macho``.432 433.. option:: --no-leading-headers434 435 Do not print any leading headers.436 437.. option:: --no-symbolic-operands438 439 Do not print symbolic operands when disassembling.440 441.. option:: --non-verbose442 443 Display the information for Mach-O objects in non-verbose or numeric form.444 445.. option:: --objc-meta-data446 447 Display the Objective-C runtime meta data.448 449.. option:: --private-header450 451 Display only the first format specific file header.452 453.. option:: --rebase454 455 Display rebasing information.456 457.. option:: --rpaths458 459 Display runtime search paths for the binary.460 461.. option:: --universal-headers462 463 Display universal headers.464 465.. option:: --weak-bind466 467 Display weak binding information.468 469XCOFF ONLY OPTIONS AND COMMANDS470---------------------------------471 472.. option:: --symbol-description473 474 Add symbol description to disassembly output.475 476.. option:: --traceback-table477 478 Decode traceback table in disassembly output. Implies :option:`--disassemble`.479 480BUGS481----482 483To report bugs, please visit <https://github.com/llvm/llvm-project/labels/tools:llvm-objdump/>.484 485SEE ALSO486--------487 488:manpage:`llvm-nm(1)`, :manpage:`llvm-otool(1)`, :manpage:`llvm-readelf(1)`,489:manpage:`llvm-readobj(1)`490