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,--mcpuor--mattris 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--demangleis 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 thellvm-objdumpexecutable. 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--versionfor 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-idsubdirectory 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 variableDEBUGINFOD_URLS. π--debug-vars=<format>β Print the locations (in registers or memory) of source-level variables alongside disassembly. format may beunicodeorascii, defaulting tounicodeif omitted. π§¬--debug-vars-indent=<width>β Distance to indent the source-level variable display, relative to the start of the disassembly. Defaults to52characters. π-j,--section=<section1[,section2,...]>β Perform commands on the specified sections only. ForMach-Ousesegment,sectionto 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, withr13/r14/r15replaced bysp/lr/pc. πͺreg-names-raw: ARM only. Userfollowed 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. printx1instead ofra) π’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=helpto display available CPUs. π§--mattr=<a1,+a2,-a3,...>β Enable/disable target-specific attributes. Specify--mattr=helpto 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--sourceoption, prepend prefix to absolute paths. π§·--prefix-strip=<level>β When disassembling with the--sourceoption, 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--versionfor 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 assemblyintelβ 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--versionfor 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-headersto 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.dSYMfile 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,namesprints only the names of the functions (when they're available), andbothprints 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. π
π COPYRIGHT π
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
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms