LLVM-OBJDUMP(1)
π 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--mcpuor--mattrto 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--demangleis 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 thellvm-objdumpexecutable. 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--versionfor 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 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. for Mach-O usesegment,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. the 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β 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--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.-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-mapsection 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. 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 assemblyintelβ 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--versionfor 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.dSYMfile 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.
πΈ COPYRIGHT πΈ
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
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-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