1 llvm-readobj - LLVM Object Reader
2 =================================
4 .. program:: llvm-readobj
9 :program:`llvm-readobj` [*options*] [*input...*]
14 The :program:`llvm-readobj` tool displays low-level format-specific information
15 about one or more object files.
17 If ``input`` is "``-``", :program:`llvm-readobj` reads from standard
18 input. Otherwise, it will read from the specified ``filenames``.
20 DIFFERENCES TO LLVM-READELF
21 ---------------------------
23 :program:`llvm-readelf` is an alias for the :manpage:`llvm-readobj` tool with a
24 slightly different command-line interface and output that is GNU compatible.
25 Following is a list of differences between :program:`llvm-readelf` and
26 :program:`llvm-readobj`:
28 - :program:`llvm-readelf` uses `GNU` for the :option:`--elf-output-style` option
29 by default. :program:`llvm-readobj` uses `LLVM`.
30 - :program:`llvm-readelf` allows single-letter grouped flags (e.g.
31 ``llvm-readelf -SW`` is the same as ``llvm-readelf -S -W``).
32 :program:`llvm-readobj` does not allow grouping.
33 - :program:`llvm-readelf` provides :option:`-s` as an alias for
34 :option:`--symbols`, for GNU :program:`readelf` compatibility, whereas it is
35 an alias for :option:`--section-headers` in :program:`llvm-readobj`.
36 - :program:`llvm-readobj` provides ``-t`` as an alias for :option:`--symbols`.
37 :program:`llvm-readelf` does not.
38 - :program:`llvm-readobj` provides ``--sr``, ``--sd``, ``--st`` and ``--dt`` as
39 aliases for :option:`--section-relocations`, :option:`--section-data`,
40 :option:`--section-symbols` and :option:`--dyn-symbols` respectively.
41 :program:`llvm-readelf` does not provide these aliases, to avoid conflicting
44 GENERAL AND MULTI-FORMAT OPTIONS
45 --------------------------------
47 These options are applicable to more than one file format, or are unrelated to
52 Equivalent to specifying all the main display options relevant to the file
57 Display the address-significance table.
59 .. option:: --expand-relocs
61 When used with :option:`--relocs`, display each relocation in an expanded
64 .. option:: --file-header, -h
68 .. option:: --headers, -e
70 Equivalent to setting: :option:`--file-header`, :option:`--program-headers`,
71 and :option:`--sections`.
75 Display a summary of command line options.
77 .. option:: --hex-dump=<section[,section,...]>, -x
79 Display the specified section(s) as hexadecimal bytes. ``section`` may be a
80 section index or section name.
84 Display information about memory tagging present in the binary. This includes
85 various memtag-specific dynamic entries, decoded global descriptor sections,
86 and decoded Android-specific ELF notes.
88 .. option:: --needed-libs
90 Display the needed libraries.
92 .. option:: --relocations, --relocs, -r
94 Display the relocation entries in the file.
96 .. option:: --sections, --section-headers, -S
100 .. option:: --section-data, --sd
102 When used with :option:`--sections`, display section data for each section
103 shown. This option has no effect for GNU style output.
105 .. option:: --section-relocations, --sr
107 When used with :option:`--sections`, display relocations for each section
108 shown. This option has no effect for GNU style output.
110 .. option:: --section-symbols, --st
112 When used with :option:`--sections`, display symbols for each section shown.
113 This option has no effect for GNU style output.
115 .. option:: --sort-symbols=<sort_key[,sort_key]>
117 Specify the keys to sort symbols before displaying symtab.
118 Valid values for sort_key are ``name`` and ``type``.
119 .. option:: --stackmap
121 Display contents of the stackmap section.
123 .. option:: --string-dump=<section[,section,...]>, -p
125 Display the specified section(s) as a list of strings. ``section`` may be a
126 section index or section name.
128 .. option:: --string-table
130 Display contents of the string table.
132 .. option:: --symbols, --syms, -s
134 Display the symbol table.
136 .. option:: --unwind, -u
138 Display unwind information.
140 .. option:: --version
142 Display the version of the :program:`llvm-readobj` executable.
146 Read command-line options from response file `<FILE>`.
151 The following options are implemented only for the ELF file format.
153 .. option:: --arch-specific, -A
155 Display architecture-specific information, e.g. the ARM attributes section on ARM.
157 .. option:: --bb-addr-map
159 Display the contents of the basic block address map section(s), which contain the
160 address of each function, along with the relative offset of each basic block.
162 .. option:: --demangle, -C
164 Display demangled symbol names in the output.
166 .. option:: --dependent-libraries
168 Display the dependent libraries section.
170 .. option:: --dyn-relocations
172 Display the dynamic relocation entries.
174 .. option:: --dyn-symbols, --dyn-syms, --dt
176 Display the dynamic symbol table.
178 .. option:: --dynamic-table, --dynamic, -d
180 Display the dynamic table.
182 .. option:: --cg-profile
184 Display the callgraph profile section.
186 .. option:: --histogram, -I
188 Display a bucket list histogram for dynamic symbol hash tables.
190 .. option:: --elf-linker-options
192 Display the linker options section.
194 .. option:: --elf-output-style=<value>
196 Format ELF information in the specified style. Valid options are ``LLVM``,
197 ``GNU``, and ``JSON``. ``LLVM`` output (the default) is an expanded and
198 structured format. ``GNU`` output mimics the equivalent GNU :program:`readelf`
199 output. ``JSON`` is JSON formatted output intended for machine consumption.
201 .. option:: --section-groups, -g
203 Display section groups.
205 .. option:: --gnu-hash-table
207 Display the GNU hash table for dynamic symbols.
209 .. option:: --hash-symbols
211 Display the expanded hash table with dynamic symbol data.
213 .. option:: --hash-table
215 Display the hash table for dynamic symbols.
219 Display information about memory tagging present in the binary. This includes
220 various dynamic entries, decoded global descriptor sections, and decoded
221 Android-specific ELF notes.
223 .. option:: --notes, -n
227 .. option:: --pretty-print
229 When used with :option:`--elf-output-style`, JSON output will be formatted in
230 a more readable format.
232 .. option:: --program-headers, --segments, -l
234 Display the program headers.
236 .. option:: --raw-relr
238 Do not decode relocations in RELR relocation sections when displaying them.
240 .. option:: --section-mapping
242 Display the section to segment mapping.
244 .. option:: --stack-sizes
246 Display the contents of the stack sizes section(s), i.e. pairs of function
247 names and the size of their stack frames. Currently only implemented for GNU
250 .. option:: --version-info, -V
252 Display version sections.
254 MACH-O SPECIFIC OPTIONS
255 -----------------------
257 The following options are implemented only for the Mach-O file format.
259 .. option:: --macho-data-in-code
261 Display the Data in Code command.
263 .. option:: --macho-dsymtab
265 Display the Dsymtab command.
267 .. option:: --macho-indirect-symbols
269 Display indirect symbols.
271 .. option:: --macho-linker-options
273 Display the Mach-O-specific linker options.
275 .. option:: --macho-segment
277 Display the Segment command.
279 .. option:: --macho-version-min
281 Display the version min command.
283 PE/COFF SPECIFIC OPTIONS
284 ------------------------
286 The following options are implemented only for the PE/COFF file format.
288 .. option:: --codeview
290 Display CodeView debug information.
292 .. option:: --codeview-ghash
294 Enable global hashing for CodeView type stream de-duplication.
296 .. option:: --codeview-merged-types
298 Display the merged CodeView type stream.
300 .. option:: --codeview-subsection-bytes
302 Dump raw contents of CodeView debug sections and records.
304 .. option:: --coff-basereloc
306 Display the .reloc section.
308 .. option:: --coff-debug-directory
310 Display the debug directory.
312 .. option:: --coff-tls-directory
314 Display the TLS directory.
316 .. option:: --coff-directives
318 Display the .drectve section.
320 .. option:: --coff-exports
322 Display the export table.
324 .. option:: --coff-imports
326 Display the import table.
328 .. option:: --coff-load-config
330 Display the load config.
332 .. option:: --coff-resources
334 Display the .rsrc section.
336 XCOFF SPECIFIC OPTIONS
337 ----------------------
339 The following options are implemented only for the XCOFF file format.
341 .. option:: --auxiliary-header
343 Display XCOFF Auxiliary header.
345 .. option:: --exception-section
347 Display XCOFF exception section entries.
349 .. option:: --loader-section-header
351 Display XCOFF loader section header.
353 .. option:: --loader-section-symbols
355 Display symbol table of loader section.
357 .. option:: --loader-section-relocations
359 Display relocation entries of loader section.
364 :program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero
365 exit code if there were any errors.
370 :manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`