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