blob: bb0827927c1c04e8ad2ec3074a4abb4c12ce67ad [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
104 When used with :option:`--sections`, display section data for each section shown.
105
106.. option:: --section-relocations, --sr
107
108 When used with :option:`--sections`, display relocations for each section shown.
109
110.. option:: --section-symbols, --st
111
112 When used with :option:`--sections`, display symbols for each section shown.
113
114.. option:: --stackmap
115
116 Display contents of the stackmap section.
117
118.. option:: --string-dump=<section[,section,...]>, -p
119
120 Display the specified section(s) as a list of strings. ``section`` may be a
121 section index or section name.
122
123.. option:: --symbols, --syms, -t
Nico Rieck51432432013-04-11 00:05:57 +0000124
125 Display the symbol table.
126
James Hendersonb96d9d82019-06-25 13:12:38 +0000127.. option:: --unwind, -u
Nico Rieck51432432013-04-11 00:05:57 +0000128
129 Display unwind information.
130
James Hendersonb96d9d82019-06-25 13:12:38 +0000131.. option:: --version
Nico Rieckf3f0b792013-04-12 04:01:52 +0000132
James Hendersonb96d9d82019-06-25 13:12:38 +0000133 Display the version of this program.
James Hendersone50d9cb2019-01-17 15:34:12 +0000134
James Henderson9485b262019-06-21 11:49:20 +0000135.. option:: @<FILE>
136
137 Read command-line options from response file `<FILE>`.
138
James Hendersonb96d9d82019-06-25 13:12:38 +0000139ELF SPECIFIC OPTIONS
140--------------------
141
142The following options are implemented only for the ELF file format.
143
144.. option:: --arm-attributes
145
146 Display the ARM attributes section. Only applicable for ARM architectures.
147
148.. option:: --demangle, -C
149
150 Display demangled symbol names in the output.
151
152.. option:: --dyn-relocations
153
154 Display the dynamic relocation entries.
155
156.. option:: --dyn-symbols, --dyn-syms, --dt
157
158 Display the dynamic symbol table.
159
160.. option:: --dynamic-table, --dynamic, -d
161
162 Display the dynamic table.
163
164.. option:: --elf-cg-profile
165
166 Display the callgraph profile section.
167
168.. option:: --elf-hash-histogram, --histogram, -I
169
170 Display a bucket list histogram for dynamic symbol hash tables.
171
172.. option:: --elf-linker-options
173
174 Display the linker options section.
175
176.. option:: --elf-output-style=<value>
177
178 Specify the style to dump ELF information in. Valid options are ``LLVM`` and
179 ``GNU``. ``LLVM`` output (the default) is an expanded and structured format,
180 whilst ``GNU`` output mimics the equivalent GNU :program:`readelf` output.
181
182.. option:: --elf-section-groups, --section-groups, -g
183
184 Display section groups.
185
186.. option:: --gnu-hash-table
187
188 Display the GNU hash table for dynamic symbols.
189
190.. option:: --hash-symbols
191
192 Display the dynamic symbols derived from the hash table.
193
194.. option:: --hash-table
195
196 Display the hash table for dynamic symbols.
197
198.. option:: --notes, -n
199
200 Display all notes.
201
202.. option:: --program-headers, --segments, -l
203
204 Display the program headers.
205
206.. option:: --raw-relr
207
208 Do not decode relocations in RELR relocation sections when displaying them.
209
210.. option:: --section-mapping
211
212 Display the section to segment mapping.
213
214.. option:: --version-info, -V
215
216 Display version sections.
217
218MACH-O SPECIFIC OPTIONS
219-----------------------
220
221The following options are implemented only for the Mach-O file format.
222
223.. option:: --macho-data-in-code
224
225 Display the Data in Code command.
226
227.. option:: --macho-dsymtab
228
229 Display the Dsymtab command.
230
231.. option:: --macho-indirect-symbols
232
233 Display indirect symbols.
234
235.. option:: --macho-linker-options
236
237 Display the Mach-O-specific linker options.
238
239.. option:: --macho-segment
240
241 Display the Segment command.
242
243.. option:: --macho-version-min
244
245 Display the version min command.
246
247PE/COFF SPECIFIC OPTIONS
248------------------------
249
250The following options are implemented only for the PE/COFF file format.
251
252.. option:: --codeview
253
254 Display CodeView debug information.
255
256.. option:: --codeview-ghash
257
258 Enable global hashing for CodeView type stream de-duplication.
259
260.. option:: --codeview-merged-types
261
262 Display the merged CodeView type stream.
263
264.. option:: --codeview-subsection-bytes
265
266 Dump raw contents of CodeView debug sections and records.
267
268.. option:: --coff-basereloc
269
270 Display the .reloc section.
271
272.. option:: --coff-debug-directory
273
274 Display the debug directory.
275
276.. option:: --coff-directives
277
278 Display the .drectve section.
279
280.. option:: --coff-exports
281
282 Display the export table.
283
284.. option:: --coff-imports
285
286 Display the import table.
287
288.. option:: --coff-load-config
289
290 Display the load config.
291
292.. option:: --coff-resources
293
294 Display the .rsrc section.
295
Nico Rieck51432432013-04-11 00:05:57 +0000296EXIT STATUS
297-----------
298
James Hendersonb96d9d82019-06-25 13:12:38 +0000299:program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero
300exit code if there were any errors.
301
302SEE ALSO
303--------
304
305:manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`