LLVM-OBJDUMP(1)

πŸ’– LLVM-OBJDUMP(1) πŸ’–

okay bestie, welcome to the manual for llvm-objdump β€” aka LLVM's object file dumper. This is the whole vibe, no cap. πŸ’…


✨ NAME ✨

llvm-objdump β€” LLVM's object file dumper. That's the name, that's the game. 🫢

🌈 SYNOPSIS 🌈

llvm-objdump [commands] [options] [filenames...]

✨ DESCRIPTION ✨

okay so the way that llvm-objdump works is: it prints the contents of object files and final linked images named on the command line. If no file name is specified, llvm-objdump will attempt to read from a.out. If - is used as a file name, llvm-objdump will process a file on its standard input stream. That's the tea. πŸ“

πŸ’… COMMANDS πŸ’…

bestie, you need at least one of the following commands, and some commands can be combined with other commands:

  • -a, --archive-headers β€” Display the information contained within an archive's headers. πŸ“¦
  • -d, --disassemble β€” Disassemble all executable sections found in the input files. On some architectures (AArch64, PowerPC, x86), all known instructions are disassembled by default. On the others, --mcpu or --mattr is needed to enable some instruction sets. Disabled instructions are displayed as <unknown>. πŸ”
  • -D, --disassemble-all β€” Disassemble all sections found in the input files. all of them, periodt. πŸ’…
  • --disassemble-symbols=<symbol1[,symbol2,...]> β€” Disassemble only the specified symbols. Takes demangled symbol names when --demangle is specified, otherwise takes mangled symbol names. Implies --disassemble. 🎯
  • --dwarf=<value> β€” Dump the specified DWARF debug sections. The supported values are:
    • frames β€” .debug_frame 🧚
  • -f, --file-headers β€” Display the contents of the overall file header. πŸ“„
  • --fault-map-section β€” Display the content of the fault map section. πŸ—ΊοΈ
  • -h, --headers, --section-headers β€” Display summaries of the headers for each section. 🧾
  • --help β€” Display usage information and exit. Does not stack with other commands. solo moment only. πŸšͺ
  • -p, --private-headers β€” Display format-specific file headers. πŸ”
  • -r, --reloc β€” Display the relocation entries in the file. πŸ”
  • -R, --dynamic-reloc β€” Display the dynamic relocation entries in the file. πŸ”‚
  • --raw-clang-ast β€” Dump the raw binary contents of the clang AST section. 🌳
  • -s, --full-contents β€” Display the contents of each section. πŸ“š
  • -t, --syms β€” Display the symbol table. πŸ”£
  • -T, --dynamic-syms β€” Display the contents of the dynamic symbol table. 🌟
  • -u, --unwind-info β€” Display the unwind info of the input(s).

This operation is only currently supported for COFF and Mach-O object files. ⚠️

  • -v, --version β€” Display the version of the llvm-objdump executable. Does not stack with other commands. 🏷️
  • -x, --all-headers β€” Display all available header information. Equivalent to specifying --archive-headers, --file-headers, --private-headers, --reloc, --section-headers, and --syms. πŸ‘‘

πŸ› οΈ OPTIONS πŸ› οΈ

llvm-objdump supports the following options:

  • --adjust-vma=<offset> β€” Increase the displayed address in disassembly or section header printing by the specified offset. πŸ“
  • --arch-name=<string> β€” Specify the target architecture when disassembling. Use --version for a list of available targets. πŸ—οΈ
  • --build-id=<string> β€” Look up the object using the given build ID, specified as a hexadecimal string. The found object is handled as if it were an input filename. πŸ†”
  • -C, --demangle β€” Demangle symbol names in the output. πŸͺ„
  • --debug-file-directory <path> β€” Provide a path to a directory with a .build-id subdirectory to search for debug information for stripped binaries. Multiple instances of this argument are searched in the order given. πŸ“‚
  • --debuginfod, --no-debuginfod β€” Whether or not to try debuginfod lookups for debug binaries. Unless specified, debuginfod is only enabled if libcurl was compiled in (LLVM_ENABLE_CURL) and at least one server URL was provided by the environment variable DEBUGINFOD_URLS. 🌐
  • --debug-vars=<format> β€” Print the locations (in registers or memory) of source-level variables alongside disassembly. format may be unicode or ascii, defaulting to unicode if omitted. 🧬
  • --debug-vars-indent=<width> β€” Distance to indent the source-level variable display, relative to the start of the disassembly. Defaults to 52 characters. πŸ“
  • -j, --section=<section1[,section2,...]> β€” Perform commands on the specified sections only. For Mach-O use segment,section to specify the section name. 🎚️
  • -l, --line-numbers β€” When disassembling, display source line numbers. Implies --disassemble. πŸ”’
  • -M, --disassembler-options=<opt1[,opt2,...]> β€” Pass target-specific disassembler options. Available options:
    • reg-names-std: ARM only (default). Print in ARM's instruction set documentation, with r13/r14/r15 replaced by sp/lr/pc. πŸ’ͺ
    • reg-names-raw: ARM only. Use r followed by the register number. πŸ”€
    • no-aliases: AArch64 and RISC-V only. Print raw instruction mnemonic instead of pseudo instruction mnemonic. 🚫
    • numeric: RISC-V only. Print raw register names instead of ABI mnemonic. (e.g. print x1 instead of ra) πŸ”’
    • att: x86 only (default). Print in the AT&T syntax. 🧑
    • intel: x86 only. Print in the intel syntax. πŸ’™
  • --mcpu=<cpu-name> β€” Target a specific CPU type for disassembly. Specify --mcpu=help to display available CPUs. 🧠
  • --mattr=<a1,+a2,-a3,...> β€” Enable/disable target-specific attributes. Specify --mattr=help to display the available attributes. βš™οΈ
  • --no-leading-addr, --no-addresses β€” When disassembling, do not print leading addresses for instructions or inline relocations. πŸš«πŸ“Œ
  • --no-print-imm-hex β€” Do not use hex format for immediate values in disassembly output. πŸ”Ÿ
  • --no-show-raw-insn β€” When disassembling, do not print the raw bytes of each instruction. πŸ™ˆ
  • --offloading β€” Display the content of the LLVM offloading section. πŸš€
  • --prefix=<prefix> β€” When disassembling with the --source option, prepend prefix to absolute paths. 🧷
  • --prefix-strip=<level> β€” When disassembling with the --source option, strip out level initial directories from absolute paths. This option has no effect without --prefix. βœ‚οΈ
  • --print-imm-hex β€” Use hex format when printing immediate values in disassembly output (default). πŸ”₯
  • -S, --source β€” When disassembling, display source interleaved with the disassembly. Implies --disassemble. πŸ“
  • --show-all-symbols β€” Show all symbols during disassembly, even if multiple symbols are defined at the same location. πŸ‘―
  • --show-lma β€” Display the LMA column when dumping ELF section headers. Defaults to off unless any section has different VMA and LMAs. 🧭
  • --start-address=<address> β€” When disassembling, only disassemble from the specified address.

When printing relocations, only print the relocations patching offsets from at least address.

When printing symbols, only print symbols with a value of at least address. 🏁

  • --stop-address=<address> β€” When disassembling, only disassemble up to, but not including the specified address.

When printing relocations, only print the relocations patching offsets up to address.

When printing symbols, only print symbols with a value up to address. πŸ›‘

  • --symbolize-operands β€” When disassembling, symbolize a branch target operand to print a label instead of a real address.

When printing a PC-relative global symbol reference, print it as an offset from the leading symbol.

When a bb-address-map section is present (i.e., the object file is built with -fbasic-block-sections=labels), labels are retrieved from that section instead.

Only works with PowerPC objects or X86 linked images.

Example: A non-symbolized branch instruction with a local target and pc-relative memory access like

cmp eax, dword ptr [rip + 4112]
jge 0x20117e <_start+0x25>

might become

<L0>:
  cmp eax, dword ptr <g>
  jge      <L0>
  • --triple=<string> β€” Target triple to disassemble for, see --version for available targets. 🌍
  • -w, --wide β€” Ignored for compatibility with GNU objdump. 😴
  • --x86-asm-syntax=<style> β€” Deprecated. When used with --disassemble, choose style of code to emit from X86 backend. Supported values are:
    • att β€” AT&T-style assembly
    • intel β€” Intel-style assembly

The default disassembly style is att. ⚠️

  • -z, --disassemble-zeroes β€” Do not skip blocks of zeroes when disassembling. 0️⃣
  • @<FILE> β€” Read command-line options and commands from response file <FILE>. πŸ“œ

🍎 MACH-O ONLY OPTIONS AND COMMANDS 🍎

Okay bestie, this whole cluster is Apple-flavoured β€” Mach-O is the file format macOS is obsessed with, and these flags only make sense when you're poking at it. πŸ’…

  • --arch=<architecture> β€” picks which architecture to disassemble. Not sure what you've got? Peek at --version for the list of available architectures. ✨
  • --archive-member-offsets β€” prints the offset of every archive member in Mach-O archives. Heads up though: this one requires --archive-headers to be on too. No sneaky solo runs. πŸ™ˆ
  • --bind β€” shows the binding info. Like, all of it.
  • --data-in-code β€” displays the data in code table. Yes, data. In code. It's a whole thing.
  • --dis-symname=<name> β€” disassembles just the instructions of the symbol you name. One symbol, main character energy only. πŸ‘‘
  • --chained-fixups β€” prints chained fixup information.
  • --dyld-info β€” prints the bind and rebase info that dyld uses to resolve external references in a final linked binary. This is the lore behind how your binary's external refs actually get found. πŸ”₯
  • --dylibs-used β€” shows the shared libraries used for linked files.
  • --dsym=<string> β€” use a .dSYM file for debug info. Give it the string, get the debug tea. πŸ«–
  • --dylib-id β€” for dylib files, displays the shared library's ID.
  • --exports-trie β€” displays exported symbols.
  • --function-starts [=<addrs|names|both>] β€” prints the function starts table for Mach-O objects. Pick your flavour: addrs (and this is the default!) prints only the addresses of functions, names prints only the names of the functions (when they're available), and both prints the names right beside the addresses. Choose your fighter. ✨
  • -g β€” prints line information from debug info, if it's available. If it's not available… well. 😭
  • --full-leading-addr β€” prints the full leading address when disassembling. No truncation, no shame.
  • --indirect-symbols β€” displays the indirect symbol table.
  • --info-plist β€” displays the info plist section as strings. Very demure, very stringy. πŸŽ€
  • --lazy-bind β€” displays lazy binding info.
  • --link-opt-hints β€” displays the linker optimization hints.
  • -m, --macho β€” uses the Mach-O specific object file parser. Fair warning: commands and other options may behave differently when you use them together with --macho. It's giving "different parser, different rules". πŸ’€
  • --no-leading-headers β€” does not print any leading headers. Zero headers, all vibes.
  • --no-symbolic-operands β€” does not print symbolic operands when disassembling.
  • --non-verbose β€” displays the info for Mach-O objects in non-verbose or numeric form. For when you want the numbers, not the narration. πŸ”’
  • --objc-meta-data β€” displays the Objective-C runtime meta data. Yes, the Objective-C of it all. 🍎
  • --private-header β€” displays only the first format specific file header. Just the one. One single header.
  • --rebase β€” displays rebasing information.
  • --rpaths β€” displays the runtime search paths for the binary.
  • --universal-headers β€” displays universal headers. 🌈
  • --weak-bind β€” displays weak binding information. (Weak bind, strong opinions.)

πŸ¦‹ XCOFF ONLY OPTIONS AND COMMANDS πŸ¦‹

XCOFF is the AIX side of the family β€” much smaller guest list, but every bit as iconic.

  • --symbol-description β€” adds symbol description to the disassembly output. Extra detail, no notes. πŸ’–
  • --traceback-table β€” decodes the traceback table in the disassembly output. Also, important: this one implies --disassemble, so you don't have to ask twice. 🧚

πŸ’€ BUGS πŸ’€

Found a bug? First of all, thank you for your service. Report it here, and please visit:

https://github.com/llvm/llvm-project/labels/tools:llvm-objdump/
ngl, bug reports are the love language of open source. Don't be shy β€” drop the link in the group chat. 🫢

πŸ‘€ SEE ALSO πŸ‘€

The whole friend group, in alphabetical-ish order:


🌸 AUTHOR 🌸

Maintained by the LLVM Team (https://llvm.org/). Literally the keepers of the whole kingdom. πŸ‘‘


2003-2023, LLVM Project


And that's the whole page, bestie!! This one's from LLVM-OBJDUMP(1), version 17, dated 2023-12-01 β€” so if you're citing your sources, that's your receipt. 🧾✨ Now go forth and dump some objects, you absolute icon. πŸ’…πŸ’–πŸ¦‹

πŸ“¦ where this page comes from