llvm-readobj1
Llvm object reader
Usage
llvm-readobj [options]
[input ...]
Overview
The llvm-readobj tool displays low-level format-specific information about one or more object files.
If input is "-", llvm-readobj reads from standard input. Otherwise, it will read from the specified filenames.
Differences to LLVM-readelf
llvm-readelf is an alias for the llvm-readobj <llvm-readobj.html> tool with a slightly different command-line interface and output that is GNU compatible. Following is a list of differences between llvm-readelf and llvm-readobj:
- •
-
llvm-readelfuses GNU for the--elf-output-styleoption by default.llvm-readobjuses LLVM.
- •
-
llvm-readelfallows single-letter grouped flags (e.g. llvm-readelf -SW is the same as llvm-readelf -S -W).llvm-readobjdoes not allow grouping.
- •
-
llvm-readelfprovides-sas an alias for--symbols, for GNUreadelfcompatibility, whereas it is an alias for--section-headersinllvm-readobj.
- •
-
llvm-readobjprovides-tas an alias for--symbols.llvm-readelfdoes not.
- •
-
llvm-readobjprovides--sr,--sd,--stand--dtas aliases for--section-relocations,--section-data,--section-symbolsand--dyn-symbolsrespectively.llvm-readelfdoes not provide these aliases, to avoid conflicting with grouped flags.
Options
These options are applicable to more than one file format, or are unrelated to file formats.
-
--addrsig -
Display the address-significance table.
-
--all -
Equivalent to specifying all the main display options relevant to the file format.
-
--decompress, -z -
Dump decompressed section content when used with
-xor-p. If the section(s) are not compressed, they are displayed as is.
-
--demangle, -C -
Display demangled symbol names in the output. This option is only for ELF and XCOFF file formats.
-
--expand-relocs -
When used with
--relocs, display each relocation in an expanded multi-line format.
-
--file-header, -h -
Display file headers.
-
--headers, -e -
Equivalent to setting:
--file-header,--program-headers, and--sections.
-
--help -
Display a summary of command line options.
-
--hex-dump=<section[,section,...]>, -x -
Display the specified section(s) as hexadecimal bytes.
sectionmay be a section index or section name.
-
--needed-libs -
Display the needed libraries.
-
--no-demangle -
Do not demangle symbol names in the output. This option is only for ELF and XCOFF file formats. The option is enabled by default.
-
--offloading -
Display list of HIP offload bundles.
-
--relocations, --relocs, -r -
Display the relocation entries in the file.
-
--section-data, --sd -
When used with
--sections, display section data for each section shown. This option has no effect for GNU style output.
-
--section-relocations, --sr -
When used with
--sections, display relocations for each section shown. This option has no effect for GNU style output.
-
--sections, --section-headers, -S -
Display all sections.
-
--section-symbols, --st -
When used with
--sections, display symbols for each section shown. This option has no effect for GNU style output.
-
--sort-symbols=<sort_key[,sort_key]> -
Specify the keys to sort symbols before displaying symtab. Valid values for sort_key are
nameandtype.
-
--stackmap -
Display contents of the stackmap section.
-
--string-dump=<section[,section,...]>, -p -
Display the specified section(s) as a list of strings.
sectionmay be a section index or section name.
-
--string-table -
Display contents of the string table.
-
--symbols, --syms, -s -
Display the symbol table.
-
--unwind, -u -
Display unwind information.
-
--version -
Display the version of the
llvm-readobjexecutable.
- @<FILE>
-
Read command-line options from response file <FILE>.
Options
The following options are implemented only for the ELF file format.
-
--arch-specific, -A -
Display architecture-specific information, e.g. the ARM attributes section on ARM.
-
--bb-addr-map -
Display the contents of the basic block address map section(s), which contain the address of each function, along with the relative offset of each basic block.
When pgo analysis maps are present, all analyses are printed as their raw value.
-
--call-graph-info -
Display the call graph section entries i.e. for each function its identifying information, each of its direct callees' information and for each indirect callee a 64-bit number representing the callee's function signature. This information can be used to reconstruct the program call graph.
-
--cg-profile -
Display the callgraph profile section.
-
--dependent-libraries -
Display the dependent libraries section.
-
--dynamic-table, --dynamic, -d -
Display the dynamic table.
-
--dyn-relocations -
Display the dynamic relocation entries.
-
--dyn-symbols, --dyn-syms, --dt -
Display the dynamic symbol table.
-
--elf-linker-options -
Display the linker options section.
-
--elf-output-style=<value> -
Format ELF information in the specified style. Valid options are LLVM, GNU, and JSON. LLVM output (the default) is an expanded and structured format. GNU output mimics the equivalent GNU
readelfoutput. JSON is JSON formatted output intended for machine consumption.
-
--gnu-hash-table -
Display the GNU hash table for dynamic symbols.
-
--hash-symbols -
Display the expanded hash table with dynamic symbol data.
-
--hash-table -
Display the hash table for dynamic symbols.
-
--histogram, -I -
Display a bucket list histogram for dynamic symbol hash tables.
-
--memtag -
Display information about memory tagging present in the binary. This includes various dynamic entries, decoded global descriptor sections, and decoded Android-specific ELF notes.
-
--notes, -n -
Display all notes.
-
--pretty-pgo-analysis-map -
When pgo analysis maps are present in the basic block address map section(s), analyses with special formats (i.e. BlockFrequency, BranchProbability, etc) are printed using the same format as their respective analysis pass.
Requires
--bb-addr-mapto have an effect.
-
--pretty-print -
When used with
--elf-output-style, JSON output will be formatted in a more readable format.
-
--program-headers, --segments, -l -
Display the program headers.
-
--section-groups, -g -
Display section groups.
-
--section-mapping -
Display the section to segment mapping.
-
--stack-sizes -
Display the contents of the stack sizes section(s), i.e. pairs of function names and the size of their stack frames. Currently only implemented for GNU style output.
-
--version-info, -V -
Display version sections.
Options
The following options are implemented only for the Mach-O file format.
-
--macho-data-in-code -
Display the Data in Code command.
-
--macho-dsymtab -
Display the Dsymtab command.
-
--macho-indirect-symbols -
Display indirect symbols.
-
--macho-linker-options -
Display the Mach-O-specific linker options.
-
--macho-segment -
Display the Segment command.
-
--macho-version-min -
Display the version min command.
Options
The following options are implemented only for the PE/COFF file format.
-
--codeview -
Display CodeView debug information.
-
--codeview-ghash -
Enable global hashing for CodeView type stream de-duplication.
-
--codeview-merged-types -
Display the merged CodeView type stream.
-
--codeview-subsection-bytes -
Dump raw contents of CodeView debug sections and records.
-
--coff-basereloc -
Display the .reloc section.
-
--coff-debug-directory -
Display the debug directory.
-
--coff-directives -
Display the .drectve section.
-
--coff-exports -
Display the export table.
-
--coff-imports -
Display the import table.
-
--coff-load-config -
Display the load config.
-
--coff-resources -
Display the .rsrc section.
-
--coff-tls-directory -
Display the TLS directory.
Options
The following options are implemented only for the XCOFF file format.
-
--auxiliary-header -
Display XCOFF Auxiliary header.
-
--exception-section -
Display XCOFF exception section entries.
-
--loader-section-header -
Display XCOFF loader section header.
-
--loader-section-relocations -
Display relocation entries of loader section.
-
--loader-section-symbols -
Display symbol table of loader section.
Exit status
llvm-readobj returns 0 under normal operation. It returns a non-zero exit code if there were any errors.
Releases
4 releases since Debian 10 (Buster); the text changed 3 times.
--addrsig since Debian 12 (Bookworm);
--all since Debian 12 (Bookworm);
--arch-specific since Debian 12 (Bookworm);
--auxiliary-header since Debian 12 (Bookworm);
--bb-addr-map since Debian 12 (Bookworm);
--call-graph-info since Arch Linux 2026-11-01;
--cg-profile since Debian 12 (Bookworm);
--codeview since Debian 12 (Bookworm);
--codeview-ghash since Debian 12 (Bookworm);
--codeview-merged-types since Debian 12 (Bookworm);
--codeview-subsection-bytes since Debian 12 (Bookworm);
--coff-basereloc since Debian 12 (Bookworm);
--coff-debug-directory since Debian 12 (Bookworm);
--coff-directives since Debian 12 (Bookworm);
--coff-exports since Debian 12 (Bookworm);
--coff-imports since Debian 12 (Bookworm);
--coff-load-config since Debian 12 (Bookworm);
--coff-resources since Debian 12 (Bookworm);
--coff-tls-directory since Debian 12 (Bookworm);
--decompress since Debian 13 (Trixie);
--demangle since Debian 12 (Bookworm);
--dependent-libraries since Debian 12 (Bookworm);
--dt since Debian 12 (Bookworm);
--dyn-relocations since Debian 12 (Bookworm);
--dyn-symbols since Debian 12 (Bookworm);
--dyn-syms since Debian 12 (Bookworm);
--dynamic since Debian 12 (Bookworm);
--dynamic-table since Debian 12 (Bookworm);
--elf-linker-options since Debian 12 (Bookworm);
--elf-output-style since Debian 12 (Bookworm);
--exception-section since Debian 13 (Trixie);
--expand-relocs since Debian 12 (Bookworm);
--file-header since Debian 12 (Bookworm);
--gnu-hash-table since Debian 12 (Bookworm);
--hash-symbols since Debian 12 (Bookworm);
--hash-table since Debian 12 (Bookworm);
--headers since Debian 12 (Bookworm);
--help since Debian 12 (Bookworm);
--hex-dump since Debian 12 (Bookworm);
--histogram since Debian 12 (Bookworm);
--loader-section-header since Debian 13 (Trixie);
--loader-section-relocations since Debian 13 (Trixie);
--loader-section-symbols since Debian 13 (Trixie);
--macho-data-in-code since Debian 12 (Bookworm);
--macho-dsymtab since Debian 12 (Bookworm);
--macho-indirect-symbols since Debian 12 (Bookworm);
--macho-linker-options since Debian 12 (Bookworm);
--macho-segment since Debian 12 (Bookworm);
--macho-version-min since Debian 12 (Bookworm);
--memtag since Debian 13 (Trixie);
--needed-libs since Debian 12 (Bookworm);
--no-demangle since Debian 13 (Trixie);
--notes since Debian 12 (Bookworm);
--offloading since Arch Linux 2026-11-01;
--pretty-pgo-analysis-map since Debian 13 (Trixie);
--pretty-print since Debian 12 (Bookworm);
--program-headers since Debian 12 (Bookworm);
--relocations since Debian 12 (Bookworm);
--relocs since Debian 12 (Bookworm);
--sd since Debian 12 (Bookworm);
--section-data since Debian 12 (Bookworm);
--section-groups since Debian 12 (Bookworm);
--section-headers since Debian 12 (Bookworm);
--section-mapping since Debian 12 (Bookworm);
--section-relocations since Debian 12 (Bookworm);
--section-symbols since Debian 12 (Bookworm);
--sections since Debian 12 (Bookworm);
--segments since Debian 12 (Bookworm);
--sort-symbols since Debian 13 (Trixie);
--sr since Debian 12 (Bookworm);
--st since Debian 12 (Bookworm);
--stack-sizes since Debian 12 (Bookworm);
--stackmap since Debian 12 (Bookworm);
--string-dump since Debian 12 (Bookworm);
--string-table since Debian 12 (Bookworm);
--symbols since Debian 12 (Bookworm);
--syms since Debian 12 (Bookworm);
--unwind since Debian 12 (Bookworm);
--version since Debian 12 (Bookworm);
--version-info since Debian 12 (Bookworm);
-A since Debian 12 (Bookworm);
-C since Debian 12 (Bookworm);
-I since Debian 12 (Bookworm);
-S since Debian 12 (Bookworm);
-V since Debian 12 (Bookworm);
-d since Debian 12 (Bookworm);
-e since Debian 12 (Bookworm);
-l since Debian 12 (Bookworm);
-n since Debian 12 (Bookworm);
-p since Debian 12 (Bookworm);
-x since Debian 12 (Bookworm);
-z since Debian 13 (Trixie).
--raw-relr until Debian 12 (Bookworm);
-dyn-symbols until Debian 10 (Buster);
-dynamic-table until Debian 10 (Buster);
-elf-section-groups until Debian 10 (Buster);
-expand-relocs until Debian 10 (Buster);
-file-headers until Debian 10 (Buster);
-help until Debian 10 (Buster);
-needed-libs until Debian 10 (Buster);
-program-headers until Debian 10 (Buster);
-relocations until Debian 10 (Buster);
-sd until Debian 10 (Buster);
-section-data until Debian 10 (Buster);
-section-relocations until Debian 10 (Buster);
-section-symbols until Debian 10 (Buster);
-sections until Debian 10 (Buster);
-sr until Debian 10 (Buster);
-st until Debian 10 (Buster);
-symbols until Debian 10 (Buster);
-t until Debian 10 (Buster);
-unwind until Debian 10 (Buster);
-version until Debian 10 (Buster).