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:: --decompress, -z
61 Dump decompressed section content when used with ``-x`` or ``-p``.
62 If the section(s) are not compressed, they are displayed as is.
64 .. option:: --demangle, -C
66 Display demangled symbol names in the output. This option is only for ELF and
69 .. option:: --expand-relocs
71 When used with :option:`--relocs`, display each relocation in an expanded
74 .. option:: --file-header, -h
78 .. option:: --headers, -e
80 Equivalent to setting: :option:`--file-header`, :option:`--program-headers`,
81 and :option:`--sections`.
85 Display a summary of command line options.
87 .. option:: --hex-dump=<section[,section,...]>, -x
89 Display the specified section(s) as hexadecimal bytes. ``section`` may be a
90 section index or section name.
94 Display information about memory tagging present in the binary. This includes
95 various memtag-specific dynamic entries, decoded global descriptor sections,
96 and decoded Android-specific ELF notes.
98 .. option:: --needed-libs
100 Display the needed libraries.
102 .. option:: --no-demangle
104 Do not demangle symbol names in the output. This option is only for ELF and
105 XCOFF file formats. The option is enabled by default.
107 .. option:: --relocations, --relocs, -r
109 Display the relocation entries in the file.
111 .. option:: --sections, --section-headers, -S
113 Display all sections.
115 .. option:: --section-data, --sd
117 When used with :option:`--sections`, display section data for each section
118 shown. This option has no effect for GNU style output.
120 .. option:: --section-relocations, --sr
122 When used with :option:`--sections`, display relocations for each section
123 shown. This option has no effect for GNU style output.
125 .. option:: --section-symbols, --st
127 When used with :option:`--sections`, display symbols for each section shown.
128 This option has no effect for GNU style output.
130 .. option:: --sort-symbols=<sort_key[,sort_key]>
132 Specify the keys to sort symbols before displaying symtab.
133 Valid values for sort_key are ``name`` and ``type``.
134 .. option:: --stackmap
136 Display contents of the stackmap section.
138 .. option:: --string-dump=<section[,section,...]>, -p
140 Display the specified section(s) as a list of strings. ``section`` may be a
141 section index or section name.
143 .. option:: --string-table
145 Display contents of the string table.
147 .. option:: --symbols, --syms, -s
149 Display the symbol table.
151 .. option:: --unwind, -u
153 Display unwind information.
155 .. option:: --version
157 Display the version of the :program:`llvm-readobj` executable.
161 Read command-line options from response file `<FILE>`.
166 The following options are implemented only for the ELF file format.
168 .. option:: --arch-specific, -A
170 Display architecture-specific information, e.g. the ARM attributes section on ARM.
172 .. option:: --bb-addr-map
174 Display the contents of the basic block address map section(s), which contain the
175 address of each function, along with the relative offset of each basic block.
177 When pgo analysis maps are present, all analyses are printed as their raw
180 .. option:: --pretty-pgo-analysis-map
182 When pgo analysis maps are present in the basic block address map section(s),
183 analyses with special formats (i.e. BlockFrequency, BranchProbability, etc)
184 are printed using the same format as their respective analysis pass.
186 Requires :option:`--bb-addr-map` to have an effect.
188 .. option:: --dependent-libraries
190 Display the dependent libraries section.
192 .. option:: --dyn-relocations
194 Display the dynamic relocation entries.
196 .. option:: --dyn-symbols, --dyn-syms, --dt
198 Display the dynamic symbol table.
200 .. option:: --dynamic-table, --dynamic, -d
202 Display the dynamic table.
204 .. option:: --cg-profile
206 Display the callgraph profile section.
208 .. option:: --histogram, -I
210 Display a bucket list histogram for dynamic symbol hash tables.
212 .. option:: --elf-linker-options
214 Display the linker options section.
216 .. option:: --elf-output-style=<value>
218 Format ELF information in the specified style. Valid options are ``LLVM``,
219 ``GNU``, and ``JSON``. ``LLVM`` output (the default) is an expanded and
220 structured format. ``GNU`` output mimics the equivalent GNU :program:`readelf`
221 output. ``JSON`` is JSON formatted output intended for machine consumption.
223 .. option:: --section-groups, -g
225 Display section groups.
227 .. option:: --gnu-hash-table
229 Display the GNU hash table for dynamic symbols.
231 .. option:: --hash-symbols
233 Display the expanded hash table with dynamic symbol data.
235 .. option:: --hash-table
237 Display the hash table for dynamic symbols.
241 Display information about memory tagging present in the binary. This includes
242 various dynamic entries, decoded global descriptor sections, and decoded
243 Android-specific ELF notes.
245 .. option:: --notes, -n
249 .. option:: --pretty-print
251 When used with :option:`--elf-output-style`, JSON output will be formatted in
252 a more readable format.
254 .. option:: --program-headers, --segments, -l
256 Display the program headers.
258 .. option:: --section-mapping
260 Display the section to segment mapping.
262 .. option:: --stack-sizes
264 Display the contents of the stack sizes section(s), i.e. pairs of function
265 names and the size of their stack frames. Currently only implemented for GNU
268 .. option:: --version-info, -V
270 Display version sections.
272 MACH-O SPECIFIC OPTIONS
273 -----------------------
275 The following options are implemented only for the Mach-O file format.
277 .. option:: --macho-data-in-code
279 Display the Data in Code command.
281 .. option:: --macho-dsymtab
283 Display the Dsymtab command.
285 .. option:: --macho-indirect-symbols
287 Display indirect symbols.
289 .. option:: --macho-linker-options
291 Display the Mach-O-specific linker options.
293 .. option:: --macho-segment
295 Display the Segment command.
297 .. option:: --macho-version-min
299 Display the version min command.
301 PE/COFF SPECIFIC OPTIONS
302 ------------------------
304 The following options are implemented only for the PE/COFF file format.
306 .. option:: --codeview
308 Display CodeView debug information.
310 .. option:: --codeview-ghash
312 Enable global hashing for CodeView type stream de-duplication.
314 .. option:: --codeview-merged-types
316 Display the merged CodeView type stream.
318 .. option:: --codeview-subsection-bytes
320 Dump raw contents of CodeView debug sections and records.
322 .. option:: --coff-basereloc
324 Display the .reloc section.
326 .. option:: --coff-debug-directory
328 Display the debug directory.
330 .. option:: --coff-tls-directory
332 Display the TLS directory.
334 .. option:: --coff-directives
336 Display the .drectve section.
338 .. option:: --coff-exports
340 Display the export table.
342 .. option:: --coff-imports
344 Display the import table.
346 .. option:: --coff-load-config
348 Display the load config.
350 .. option:: --coff-resources
352 Display the .rsrc section.
354 XCOFF SPECIFIC OPTIONS
355 ----------------------
357 The following options are implemented only for the XCOFF file format.
359 .. option:: --auxiliary-header
361 Display XCOFF Auxiliary header.
363 .. option:: --exception-section
365 Display XCOFF exception section entries.
367 .. option:: --loader-section-header
369 Display XCOFF loader section header.
371 .. option:: --loader-section-symbols
373 Display symbol table of loader section.
375 .. option:: --loader-section-relocations
377 Display relocation entries of loader section.
382 :program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero
383 exit code if there were any errors.
388 :manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`