LLVM-OBJDUMP(1)

πŸ“¦ version 15.0.7, in opensuse-leap 16.0

πŸ’– LLVM-OBJUMP β€” wait no, LLVM-OBJDUMP πŸ’–

okay bestie, welcome to the llvm-objdump(1) page from the LLVM manual β€” the one and only. grab a boba, we're reading object files together 🧚✨


🌸 NAME 🌸

llvm-objdump β€” literally LLVM's object file dumper, no cap πŸ’…


✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so llvm-objdump prints out the contents of object files and final linked images β€” the ones you name on the command line, bestie. if you don't specify a file name at all, llvm-objdump will attempt to read from a.out (default behavior, iconic). and if you pass - as a file name, llvm-objdump will process a file on its standard input stream. stdin queen πŸ™ˆ


πŸŽ€ COMMANDS πŸŽ€

you need at least one of these bad boys, and some commands can be combined with other commands (stacking is allowed, we love a group activity 🫢):

  • -a, --archive-headers β€” display the info contained within an archive's headers.
  • -d, --disassemble β€” disassemble all executable sections found in the input files. on some architectures (AArch64, PPC64, x86), all known instructions are disassembled by default. on the others, you need --mcpu or --mattr to enable some instruction sets. disabled instructions get displayed as <unknown> πŸ’€
  • -D, --disassemble-all β€” disassemble all sections found in the input files. all of them. every last one.
  • --disassemble-symbols=<symbol1[,symbol2,...]> β€” disassemble only the specified symbols. takes demangled symbol names when --demangle is specified, otherwise takes mangled symbol names. implies --disassemble (it's giving package deal).
  • --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, so pick a lane bestie.
  • -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, so don't come for it if your format isn't on the list 😭
  • -v, --version β€” display the version of the llvm-objdump executable. does not stack with other commands either. solo act.
  • -x, --all-headers β€” display all available header information. equivalent to specifying --archive-headers, --file-headers, --private-headers, --reloc, --section-headers, and --syms. the whole combo meal πŸ”₯

πŸ’œ OPTIONS πŸ’œ

llvm-objdump supports the following options (yes, all of them, we're going the full distance):

  • --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 πŸ‘‘
  • -C, --demangle β€” demangle symbol names in the output.
  • --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. the 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 β€” when disassembling, do not print leading addresses.
  • --no-print-imm-hex β€” do not use hex format for immediate values in disassembly output (default).
  • --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.
  • -S, --source β€” when disassembling, display source interleaved with the disassembly. implies --disassemble.
  • --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. it's just there to vibe 🫢
  • --x86-asm-syntax=<style> β€” deprecated. ⚠️ when used with --disassemble, choose style of code to emit from X86 backend. supported values:
    • 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 πŸ“

apple girlies, this section is for you:

  • --arch=<architecture> β€” specify the architecture to disassemble. see --version for available architectures.
  • --archive-member-offsets β€” print the offset to each archive member for Mach-O archives (requires --archive-headers).
  • --bind β€” display binding info.
  • --data-in-code β€” display the data in code table.
  • --dis-symname=<name> β€” disassemble just the specified symbol's instructions.
  • --dyld_info β€” print bind and rebase information used by dyld to resolve external references in a final linked binary.
  • --dylibs-used β€” display the shared libraries used for linked files.
  • --dsym=<string> β€” use .dSYM file for debug info.
  • --dylib-id β€” display the shared library's ID for dylib files.
  • --exports-trie β€” display exported symbols.
  • --function-starts β€” print the function starts table for Mach-O objects.
  • -g β€” print line information from debug info if available.
  • --full-leading-addr β€” print the full leading address when disassembling.
  • --indirect-symbols β€” display the indirect symbol table.
  • --info-plist β€” display the info plist section as strings.
  • --lazy-bind β€” display lazy binding info.
  • --link-opt-hints β€” display the linker optimization hints.
  • -m, --macho β€” use Mach-O specific object file parser. commands and other options may behave differently when used with --macho πŸ‘€
  • --no-leading-headers β€” do not print any leading headers.
  • --no-symbolic-operands β€” do not print symbolic operands when disassembling.
  • --non-verbose β€” display the information for Mach-O objects in non-verbose or numeric form.
  • --objc-meta-data β€” display the Objective-C runtime meta data.
  • --private-header β€” display only the first format specific file header.
  • --rebase β€” display rebasing information.
  • --rpaths β€” display runtime search paths for the binary.
  • --universal-headers β€” display universal headers.
  • --weak-bind β€” display weak binding information.

🌈 XCOFF ONLY OPTIONS AND COMMANDS 🌈

just the one, and it eats:

  • --symbol-description β€” add symbol description to disassembly output.

πŸ’€ BUGS πŸ’€

to report bugs, please visit https://github.com/llvm/llvm-project/labels/tools:llvm-objdump/. be nice, be specific, files attached, periodt ✨


πŸ”₯ SEE ALSO πŸ”₯

llvm-nm(1), llvm-otool(1), llvm-readelf(1), llvm-readobj(1) β€” your new friend group, fr fr 🫢


πŸ‘‘ AUTHOR πŸ‘‘

maintained by the LLVM Team (https://llvm.org/). legends, honestly.


2003-2023, LLVM Project


okay that's the whole page bestie, you ate that πŸ’…

and for the cute sign-off: this lil doc is page 15, dated 2023-01-14, living under LLVM-OBJDUMP(1) from LLVM β€” bye, ily, go dump some objects πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from