blob: d533ae57e538574d355a6e0cd8af516b7879a782 [file] [log] [blame]
Nico Rieck51432432013-04-11 00:05:57 +00001llvm-readobj - LLVM Object Reader
2=================================
3
4SYNOPSIS
5--------
6
7:program:`llvm-readobj` [*options*] [*input...*]
8
9DESCRIPTION
10-----------
11
12The :program:`llvm-readobj` tool displays low-level format-specific information
James Hendersonb96d9d82019-06-25 13:12:38 +000013about one or more object files.
Nico Rieck51432432013-04-11 00:05:57 +000014
15If ``input`` is "``-``" or omitted, :program:`llvm-readobj` reads from standard
16input. Otherwise, it will read from the specified ``filenames``.
17
James Hendersonb96d9d82019-06-25 13:12:38 +000018GENERAL AND MULTI-FORMAT OPTIONS
19--------------------------------
Nico Rieck51432432013-04-11 00:05:57 +000020
James Hendersonb96d9d82019-06-25 13:12:38 +000021These options are applicable to more than one file format, or are unrelated to
22file formats.
Nico Rieck51432432013-04-11 00:05:57 +000023
James Hendersonb96d9d82019-06-25 13:12:38 +000024.. option:: --all
Nico Rieck51432432013-04-11 00:05:57 +000025
James Hendersonb96d9d82019-06-25 13:12:38 +000026 Equivalent to specifying all the main display options relevant to the file
27 format.
Nico Rieck51432432013-04-11 00:05:57 +000028
James Hendersonb96d9d82019-06-25 13:12:38 +000029.. option:: --addrsig
30
31 Display the address-significance table.
32
33.. option:: --color
34
35 Use colors in the output for warnings and errors.
36
37.. option:: --expand-relocs
38
39 When used with :option:`--relocations`, display each relocation in an expanded
40 multi-line format.
41
42.. option:: --file-headers, -h
Nico Rieck51432432013-04-11 00:05:57 +000043
44 Display file headers.
45
James Hendersonb96d9d82019-06-25 13:12:38 +000046.. option:: --headers, -e
Nico Rieck51432432013-04-11 00:05:57 +000047
James Hendersonb96d9d82019-06-25 13:12:38 +000048 Equivalent to setting: :option:`--file-headers`, :option:`--program-headers`,
49 and :option:`--sections`.
Nico Rieck51432432013-04-11 00:05:57 +000050
James Hendersonb96d9d82019-06-25 13:12:38 +000051.. option:: --help
Nico Rieck51432432013-04-11 00:05:57 +000052
James Hendersonb96d9d82019-06-25 13:12:38 +000053 Display a summary of command line options.
Nico Rieck51432432013-04-11 00:05:57 +000054
James Hendersonb96d9d82019-06-25 13:12:38 +000055.. option:: --help-list
Nico Rieck51432432013-04-11 00:05:57 +000056
James Hendersonb96d9d82019-06-25 13:12:38 +000057 Display an uncategorized summary of command line options.
Nico Rieck51432432013-04-11 00:05:57 +000058
James Hendersonb96d9d82019-06-25 13:12:38 +000059.. option:: --hex-dump=<section[,section,...]>, -x
Nico Rieck51432432013-04-11 00:05:57 +000060
James Hendersonb96d9d82019-06-25 13:12:38 +000061 Display the specified section(s) as hexadecimal bytes. ``section`` may be a
62 section index or section name.
Nico Rieck51432432013-04-11 00:05:57 +000063
James Hendersonb96d9d82019-06-25 13:12:38 +000064.. option:: --needed-libs
65
66 Display the needed libraries.
67
68.. option:: --relocations, --relocs, -r
Nico Rieck51432432013-04-11 00:05:57 +000069
70 Display the relocation entries in the file.
71
James Hendersonb96d9d82019-06-25 13:12:38 +000072.. option:: --sections, --section-headers, -s, -S
73
74 Display all sections.
75
76.. option:: --section-data, --sd
77
78 When used with :option:`--sections`, display section data for each section shown.
79
80.. option:: --section-relocations, --sr
81
82 When used with :option:`--sections`, display relocations for each section shown.
83
84.. option:: --section-symbols, --st
85
86 When used with :option:`--sections`, display symbols for each section shown.
87
88.. option:: --stackmap
89
90 Display contents of the stackmap section.
91
92.. option:: --string-dump=<section[,section,...]>, -p
93
94 Display the specified section(s) as a list of strings. ``section`` may be a
95 section index or section name.
96
97.. option:: --symbols, --syms, -t
Nico Rieck51432432013-04-11 00:05:57 +000098
99 Display the symbol table.
100
James Hendersonb96d9d82019-06-25 13:12:38 +0000101.. option:: --unwind, -u
Nico Rieck51432432013-04-11 00:05:57 +0000102
103 Display unwind information.
104
James Hendersonb96d9d82019-06-25 13:12:38 +0000105.. option:: --version
Nico Rieckf3f0b792013-04-12 04:01:52 +0000106
James Hendersonb96d9d82019-06-25 13:12:38 +0000107 Display the version of this program.
James Hendersone50d9cb2019-01-17 15:34:12 +0000108
James Henderson9485b262019-06-21 11:49:20 +0000109.. option:: @<FILE>
110
111 Read command-line options from response file `<FILE>`.
112
James Hendersonb96d9d82019-06-25 13:12:38 +0000113ELF SPECIFIC OPTIONS
114--------------------
115
116The following options are implemented only for the ELF file format.
117
118.. option:: --arm-attributes
119
120 Display the ARM attributes section. Only applicable for ARM architectures.
121
122.. option:: --demangle, -C
123
124 Display demangled symbol names in the output.
125
126.. option:: --dyn-relocations
127
128 Display the dynamic relocation entries.
129
130.. option:: --dyn-symbols, --dyn-syms, --dt
131
132 Display the dynamic symbol table.
133
134.. option:: --dynamic-table, --dynamic, -d
135
136 Display the dynamic table.
137
138.. option:: --elf-cg-profile
139
140 Display the callgraph profile section.
141
142.. option:: --elf-hash-histogram, --histogram, -I
143
144 Display a bucket list histogram for dynamic symbol hash tables.
145
146.. option:: --elf-linker-options
147
148 Display the linker options section.
149
150.. option:: --elf-output-style=<value>
151
152 Specify the style to dump ELF information in. Valid options are ``LLVM`` and
153 ``GNU``. ``LLVM`` output (the default) is an expanded and structured format,
154 whilst ``GNU`` output mimics the equivalent GNU :program:`readelf` output.
155
156.. option:: --elf-section-groups, --section-groups, -g
157
158 Display section groups.
159
160.. option:: --gnu-hash-table
161
162 Display the GNU hash table for dynamic symbols.
163
164.. option:: --hash-symbols
165
166 Display the dynamic symbols derived from the hash table.
167
168.. option:: --hash-table
169
170 Display the hash table for dynamic symbols.
171
172.. option:: --notes, -n
173
174 Display all notes.
175
176.. option:: --program-headers, --segments, -l
177
178 Display the program headers.
179
180.. option:: --raw-relr
181
182 Do not decode relocations in RELR relocation sections when displaying them.
183
184.. option:: --section-mapping
185
186 Display the section to segment mapping.
187
188.. option:: --version-info, -V
189
190 Display version sections.
191
192MACH-O SPECIFIC OPTIONS
193-----------------------
194
195The following options are implemented only for the Mach-O file format.
196
197.. option:: --macho-data-in-code
198
199 Display the Data in Code command.
200
201.. option:: --macho-dsymtab
202
203 Display the Dsymtab command.
204
205.. option:: --macho-indirect-symbols
206
207 Display indirect symbols.
208
209.. option:: --macho-linker-options
210
211 Display the Mach-O-specific linker options.
212
213.. option:: --macho-segment
214
215 Display the Segment command.
216
217.. option:: --macho-version-min
218
219 Display the version min command.
220
221PE/COFF SPECIFIC OPTIONS
222------------------------
223
224The following options are implemented only for the PE/COFF file format.
225
226.. option:: --codeview
227
228 Display CodeView debug information.
229
230.. option:: --codeview-ghash
231
232 Enable global hashing for CodeView type stream de-duplication.
233
234.. option:: --codeview-merged-types
235
236 Display the merged CodeView type stream.
237
238.. option:: --codeview-subsection-bytes
239
240 Dump raw contents of CodeView debug sections and records.
241
242.. option:: --coff-basereloc
243
244 Display the .reloc section.
245
246.. option:: --coff-debug-directory
247
248 Display the debug directory.
249
250.. option:: --coff-directives
251
252 Display the .drectve section.
253
254.. option:: --coff-exports
255
256 Display the export table.
257
258.. option:: --coff-imports
259
260 Display the import table.
261
262.. option:: --coff-load-config
263
264 Display the load config.
265
266.. option:: --coff-resources
267
268 Display the .rsrc section.
269
Nico Rieck51432432013-04-11 00:05:57 +0000270EXIT STATUS
271-----------
272
James Hendersonb96d9d82019-06-25 13:12:38 +0000273:program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero
274exit code if there were any errors.
275
276SEE ALSO
277--------
278
279:manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`