blob: 46a4b87d3fbded1d8d2836f62f958674e1f600a7 [file] [log] [blame]
Nico Rieck51432432013-04-11 00:05:57 +00001llvm-readobj - LLVM Object Reader
2=================================
3
James Hendersona0566842019-06-27 13:24:46 +00004.. program:: llvm-readobj
5
Nico Rieck51432432013-04-11 00:05:57 +00006SYNOPSIS
7--------
8
9:program:`llvm-readobj` [*options*] [*input...*]
10
11DESCRIPTION
12-----------
13
14The :program:`llvm-readobj` tool displays low-level format-specific information
James Hendersonb96d9d82019-06-25 13:12:38 +000015about one or more object files.
Nico Rieck51432432013-04-11 00:05:57 +000016
17If ``input`` is "``-``" or omitted, :program:`llvm-readobj` reads from standard
18input. Otherwise, it will read from the specified ``filenames``.
19
James Henderson90c57e02019-07-01 16:18:57 +000020DIFFERENCES TO LLVM-READELF
21---------------------------
22
23:program:`llvm-readelf` is an alias for the :manpage:`llvm-readobj` tool with a
24slightly different command-line interface and output that is GNU compatible.
25Following is a list of differences between :program:`llvm-readelf` and
26:program:`llvm-readobj`:
27
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
42 with grouped flags.
43
James Hendersonb96d9d82019-06-25 13:12:38 +000044GENERAL AND MULTI-FORMAT OPTIONS
45--------------------------------
Nico Rieck51432432013-04-11 00:05:57 +000046
James Hendersonb96d9d82019-06-25 13:12:38 +000047These options are applicable to more than one file format, or are unrelated to
48file formats.
Nico Rieck51432432013-04-11 00:05:57 +000049
James Hendersonb96d9d82019-06-25 13:12:38 +000050.. option:: --all
Nico Rieck51432432013-04-11 00:05:57 +000051
James Hendersonb96d9d82019-06-25 13:12:38 +000052 Equivalent to specifying all the main display options relevant to the file
53 format.
Nico Rieck51432432013-04-11 00:05:57 +000054
James Hendersonb96d9d82019-06-25 13:12:38 +000055.. option:: --addrsig
56
57 Display the address-significance table.
58
59.. option:: --color
60
61 Use colors in the output for warnings and errors.
62
63.. option:: --expand-relocs
64
65 When used with :option:`--relocations`, display each relocation in an expanded
66 multi-line format.
67
68.. option:: --file-headers, -h
Nico Rieck51432432013-04-11 00:05:57 +000069
70 Display file headers.
71
James Hendersonb96d9d82019-06-25 13:12:38 +000072.. option:: --headers, -e
Nico Rieck51432432013-04-11 00:05:57 +000073
James Hendersonb96d9d82019-06-25 13:12:38 +000074 Equivalent to setting: :option:`--file-headers`, :option:`--program-headers`,
75 and :option:`--sections`.
Nico Rieck51432432013-04-11 00:05:57 +000076
James Hendersonb96d9d82019-06-25 13:12:38 +000077.. option:: --help
Nico Rieck51432432013-04-11 00:05:57 +000078
James Hendersonb96d9d82019-06-25 13:12:38 +000079 Display a summary of command line options.
Nico Rieck51432432013-04-11 00:05:57 +000080
James Hendersonb96d9d82019-06-25 13:12:38 +000081.. option:: --help-list
Nico Rieck51432432013-04-11 00:05:57 +000082
James Hendersonb96d9d82019-06-25 13:12:38 +000083 Display an uncategorized summary of command line options.
Nico Rieck51432432013-04-11 00:05:57 +000084
James Hendersonb96d9d82019-06-25 13:12:38 +000085.. option:: --hex-dump=<section[,section,...]>, -x
Nico Rieck51432432013-04-11 00:05:57 +000086
James Hendersonb96d9d82019-06-25 13:12:38 +000087 Display the specified section(s) as hexadecimal bytes. ``section`` may be a
88 section index or section name.
Nico Rieck51432432013-04-11 00:05:57 +000089
James Hendersonb96d9d82019-06-25 13:12:38 +000090.. option:: --needed-libs
91
92 Display the needed libraries.
93
94.. option:: --relocations, --relocs, -r
Nico Rieck51432432013-04-11 00:05:57 +000095
96 Display the relocation entries in the file.
97
James Hendersonb96d9d82019-06-25 13:12:38 +000098.. option:: --sections, --section-headers, -s, -S
99
100 Display all sections.
101
102.. option:: --section-data, --sd
103
James Henderson9e38f512019-07-05 16:38:52 +0000104 When used with :option:`--sections`, display section data for each section
105 shown. This option has no effect for GNU style output.
James Hendersonb96d9d82019-06-25 13:12:38 +0000106
107.. option:: --section-relocations, --sr
108
James Henderson9e38f512019-07-05 16:38:52 +0000109 When used with :option:`--sections`, display relocations for each section
110 shown. This option has no effect for GNU style output.
James Hendersonb96d9d82019-06-25 13:12:38 +0000111
112.. option:: --section-symbols, --st
113
114 When used with :option:`--sections`, display symbols for each section shown.
James Henderson9e38f512019-07-05 16:38:52 +0000115 This option has no effect for GNU style output.
James Hendersonb96d9d82019-06-25 13:12:38 +0000116
117.. option:: --stackmap
118
119 Display contents of the stackmap section.
120
121.. option:: --string-dump=<section[,section,...]>, -p
122
123 Display the specified section(s) as a list of strings. ``section`` may be a
124 section index or section name.
125
126.. option:: --symbols, --syms, -t
Nico Rieck51432432013-04-11 00:05:57 +0000127
128 Display the symbol table.
129
James Hendersonb96d9d82019-06-25 13:12:38 +0000130.. option:: --unwind, -u
Nico Rieck51432432013-04-11 00:05:57 +0000131
132 Display unwind information.
133
James Hendersonb96d9d82019-06-25 13:12:38 +0000134.. option:: --version
Nico Rieckf3f0b792013-04-12 04:01:52 +0000135
James Henderson778a5e52019-09-17 11:43:42 +0000136 Display the version of the :program:`llvm-readobj` executable.
James Hendersone50d9cb2019-01-17 15:34:12 +0000137
James Henderson9485b262019-06-21 11:49:20 +0000138.. option:: @<FILE>
139
140 Read command-line options from response file `<FILE>`.
141
James Hendersonb96d9d82019-06-25 13:12:38 +0000142ELF SPECIFIC OPTIONS
143--------------------
144
145The following options are implemented only for the ELF file format.
146
Fangrui Song2d92c882019-10-01 01:31:15 +0000147.. option:: --arch-specific, -A
James Hendersonb96d9d82019-06-25 13:12:38 +0000148
Fangrui Song2d92c882019-10-01 01:31:15 +0000149 Display architecture-specific information, e.g. the ARM attributes section on ARM.
James Hendersonb96d9d82019-06-25 13:12:38 +0000150
151.. option:: --demangle, -C
152
153 Display demangled symbol names in the output.
154
Georgii Rymarcd2c4092019-11-25 16:04:58 +0300155.. option:: --dependent-libraries
156
157 Display the dependent libraries section.
158
James Hendersonb96d9d82019-06-25 13:12:38 +0000159.. option:: --dyn-relocations
160
161 Display the dynamic relocation entries.
162
163.. option:: --dyn-symbols, --dyn-syms, --dt
164
165 Display the dynamic symbol table.
166
167.. option:: --dynamic-table, --dynamic, -d
168
169 Display the dynamic table.
170
171.. option:: --elf-cg-profile
172
173 Display the callgraph profile section.
174
175.. option:: --elf-hash-histogram, --histogram, -I
176
177 Display a bucket list histogram for dynamic symbol hash tables.
178
179.. option:: --elf-linker-options
180
181 Display the linker options section.
182
183.. option:: --elf-output-style=<value>
184
James Hendersonb52a0c02019-07-08 15:46:26 +0000185 Format ELF information in the specified style. Valid options are ``LLVM`` and
James Hendersonb96d9d82019-06-25 13:12:38 +0000186 ``GNU``. ``LLVM`` output (the default) is an expanded and structured format,
187 whilst ``GNU`` output mimics the equivalent GNU :program:`readelf` output.
188
189.. option:: --elf-section-groups, --section-groups, -g
190
191 Display section groups.
192
193.. option:: --gnu-hash-table
194
195 Display the GNU hash table for dynamic symbols.
196
197.. option:: --hash-symbols
198
James Hendersonb52a0c02019-07-08 15:46:26 +0000199 Display the expanded hash table with dynamic symbol data.
James Hendersonb96d9d82019-06-25 13:12:38 +0000200
201.. option:: --hash-table
202
203 Display the hash table for dynamic symbols.
204
205.. option:: --notes, -n
206
207 Display all notes.
208
209.. option:: --program-headers, --segments, -l
210
211 Display the program headers.
212
213.. option:: --raw-relr
214
215 Do not decode relocations in RELR relocation sections when displaying them.
216
217.. option:: --section-mapping
218
219 Display the section to segment mapping.
220
James Hendersona2497b42019-09-13 15:01:39 +0000221.. option:: --stack-sizes
222
223 Display the contents of the stack sizes section(s), i.e. pairs of function
224 names and the size of their stack frames. Currently only implemented for GNU
225 style output.
226
James Hendersonb96d9d82019-06-25 13:12:38 +0000227.. option:: --version-info, -V
228
229 Display version sections.
230
231MACH-O SPECIFIC OPTIONS
232-----------------------
233
234The following options are implemented only for the Mach-O file format.
235
236.. option:: --macho-data-in-code
237
238 Display the Data in Code command.
239
240.. option:: --macho-dsymtab
241
242 Display the Dsymtab command.
243
244.. option:: --macho-indirect-symbols
245
246 Display indirect symbols.
247
248.. option:: --macho-linker-options
249
250 Display the Mach-O-specific linker options.
251
252.. option:: --macho-segment
253
254 Display the Segment command.
255
256.. option:: --macho-version-min
257
258 Display the version min command.
259
260PE/COFF SPECIFIC OPTIONS
261------------------------
262
263The following options are implemented only for the PE/COFF file format.
264
265.. option:: --codeview
266
267 Display CodeView debug information.
268
269.. option:: --codeview-ghash
270
271 Enable global hashing for CodeView type stream de-duplication.
272
273.. option:: --codeview-merged-types
274
275 Display the merged CodeView type stream.
276
277.. option:: --codeview-subsection-bytes
278
279 Dump raw contents of CodeView debug sections and records.
280
281.. option:: --coff-basereloc
282
283 Display the .reloc section.
284
285.. option:: --coff-debug-directory
286
287 Display the debug directory.
288
289.. option:: --coff-directives
290
291 Display the .drectve section.
292
293.. option:: --coff-exports
294
295 Display the export table.
296
297.. option:: --coff-imports
298
299 Display the import table.
300
301.. option:: --coff-load-config
302
303 Display the load config.
304
305.. option:: --coff-resources
306
307 Display the .rsrc section.
308
Nico Rieck51432432013-04-11 00:05:57 +0000309EXIT STATUS
310-----------
311
James Hendersonb96d9d82019-06-25 13:12:38 +0000312:program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero
313exit code if there were any errors.
314
315SEE ALSO
316--------
317
318:manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`