LLVM-OBJDUMP(1)

🌸 NAME 🌸

okay bestie, meet llvm-objdump β€” manual page LLVM-OBJDUMP(1) from the LLVM fam. She is literally LLVM's object file dumper, and yes that is the whole name. iconic. 🫢

✨ SYNOPSIS ✨

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

πŸ’– DESCRIPTION πŸ’–

The llvm-objdump utility 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. stdin girlie behavior, we love.

πŸŽ€ COMMANDS πŸŽ€

At least one of these commands is required, and some commands can be combined with other commands. Pick your fighter(s).

  • -a, --archive-headers β€” Display the information contained within an archive's headers. Archive header tea, served.
  • -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>. not the jumpscare 😭
  • -D, --disassemble-all β€” Disassemble all sections found in the input files.
  • --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. one-job icon behavior.
  • -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. the β€œgive me everything” combo meal πŸ’…

πŸ’… 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.
  • --disassembler-color=<mode> β€” Enable or disable disassembler color output.
    • off: Disable disassembler color output.
    • on: Enable disassembler color output.
    • terminal: Enable disassembler color output if the terminal supports it (default).
  • --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.
  • -mllvm <arg> β€” Specify an argument to forward to LLVM's CommandLine library.
  • --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. If a pgo-analysis-map is present alongside the bb-address-map, any available analyses are printed after the relevant block label. By default, any analysis with a special representation (i.e. BlockFrequency, BranchProbability, etc) are printed as raw hex values. 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>
  • --pretty-pgo-analysis-map β€” When using --symbolize-operands with bb-address-map and pgo-analysis-map, print analyses using the same format as their analysis passes would. An example of pretty format would be printing block frequencies relative to the entry block, the same as BFI. Only works when --symbolize-operands is enabled.
  • --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.
  • @<FILE> β€” Read command-line options and commands from response file <FILE>.

🍎 MACH-O ONLY OPTIONS AND COMMANDS 🍎

Okay so this whole chunk? Apple girlies only. Every single one of these is Mach-O flavored, so if you're not poking at a Mach-O binary these are just gonna sit there looking pretty. πŸ’…

  • --arch=<architecture> β€” tells it which architecture to disassemble, bestie. And where do you find the list of available architectures? --version, obviously. Go look. ✨
  • --archive-member-offsets β€” prints the offset to each archive member for Mach-O archives. Heads up though: this one requires --archive-headers. No cap, it will not work solo.
  • --bind β€” shows you the binding info. πŸ‘€
  • --data-in-code β€” displays the data in code table. Yes queen, the table.
  • --dis-symname=<name> β€” disassembles just the instructions of the symbol you named. One (1) symbol. Nothing else. Main character energy fr.
  • --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. That's the stuff dyld needs, and now you get to see it. 🫢
  • --dylibs-used β€” displays the shared libraries used for linked files.
  • --dsym=<string> β€” use a .dSYM file for debug info. Give it the string, get the debug info. πŸŽ€
  • --dylib-id β€” displays the shared library's ID, for dylib files specifically.
  • --exports-trie β€” displays exported symbols. The whole trie, slay. 🌈
  • --function-starts [=<addrs|names|both>] β€” prints the function starts table for Mach-O objects. You got options, babe:
    • addrs β€” print only the addresses of functions. This is the default, iykyk.
    • names β€” print only the names of the functions (when available).
    • both β€” print the names beside the addresses. Best of both worlds honestly. ✨
  • -g β€” prints line information from debug info, if available. πŸ’œ
  • --full-leading-addr β€” prints the full leading address when disassembling. No truncation, we love a full glow-up.
  • --indirect-symbols β€” displays the indirect symbol table.
  • --info-plist β€” displays the info plist section as strings. πŸ“
  • --lazy-bind β€” displays lazy binding info. (Lazy, but make it informational.)
  • --link-opt-hints β€” displays the linker optimization hints.
  • -m, --macho β€” use the Mach-O specific object file parser. Real talk: commands and other options may behave differently when used with --macho, so don't come for me when the output changes. It's giving "different parser, different rules". πŸ’€
  • --no-leading-headers β€” does not print any leading headers. Gone. Skipped. πŸ™ˆ
  • --no-symbolic-operands β€” does not print symbolic operands when disassembling. Just the raw stuff.
  • --non-verbose β€” displays info for Mach-O objects in non-verbose or numeric form. Numbers over nouns, honestly iconic.
  • --objc-meta-data β€” displays the Objective-C runtime meta data. πŸ‘‘
  • --private-header β€” displays only the first format specific file header. Just the one. First only. That's it.
  • --rebase β€” displays rebasing information.
  • --rpaths β€” displays runtime search paths for the binary. 🧚
  • --universal-headers β€” displays universal headers. Universal! Fancy!
  • --weak-bind β€” displays weak binding information. Weak bind, strong opinions. 😭

🌸 XCOFF ONLY OPTIONS AND COMMANDS 🌸

Tiny section, huge vibes β€” two options, that's the whole roster:

  • --symbol-description β€” adds the symbol description to the disassembly output. Nice little extra detail, we love context. πŸ’–
  • --traceback-table β€” decodes the traceback table in the disassembly output. And guess what? It implies --disassemble. You don't even have to ask, it's already doing it. πŸ¦‹

πŸ› BUGS πŸ›

Found a bug? First of all, thank you for your service. 🫑 To report bugs, please visit https://github.com/llvm/llvm-project/labels/tools:llvm-objdump/.

Go on, click it, the LLVM girlies genuinely want to know. πŸ₯Ί

πŸ‘€ SEE ALSO πŸ‘€

Your reading list, bestie β€” go be nosy:


πŸ’œ AUTHOR πŸ’œ

Maintained by the LLVM Team (https://llvm.org/). Absolute legends, no notes. πŸ‘‘


2003-2025, LLVM Project


And that's a wrap on the whole page, babe! 🌟 This lil doc is from the llvm-objdump source, dated 2025-01-17, and it's page 19 of the manual, in case you were wondering. Now go disassemble something gorgeous and think of me. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from