068808e42c4dd3255d706ba411aa3b482a7e45c5
[platform/upstream/llvm.git] / llvm / docs / CommandGuide / llvm-readobj.rst
1 llvm-readobj - LLVM Object Reader
2 =================================
3
4 .. program:: llvm-readobj
5
6 SYNOPSIS
7 --------
8
9 :program:`llvm-readobj` [*options*] [*input...*]
10
11 DESCRIPTION
12 -----------
13
14 The :program:`llvm-readobj` tool displays low-level format-specific information
15 about one or more object files.
16
17 If ``input`` is "``-``", :program:`llvm-readobj` reads from standard
18 input. Otherwise, it will read from the specified ``filenames``.
19
20 DIFFERENCES TO LLVM-READELF
21 ---------------------------
22
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`:
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
44 GENERAL AND MULTI-FORMAT OPTIONS
45 --------------------------------
46
47 These options are applicable to more than one file format, or are unrelated to
48 file formats.
49
50 .. option:: --all
51
52  Equivalent to specifying all the main display options relevant to the file
53  format.
54
55 .. option:: --addrsig
56
57  Display the address-significance table.
58
59 .. option:: --expand-relocs
60
61  When used with :option:`--relocs`, display each relocation in an expanded
62  multi-line format.
63
64 .. option:: --file-header, -h
65
66  Display file headers.
67
68 .. option:: --headers, -e
69
70  Equivalent to setting: :option:`--file-header`, :option:`--program-headers`,
71  and :option:`--sections`.
72
73 .. option:: --help
74
75  Display a summary of command line options.
76
77 .. option:: --hex-dump=<section[,section,...]>, -x
78
79  Display the specified section(s) as hexadecimal bytes. ``section`` may be a
80  section index or section name.
81
82 .. option:: --needed-libs
83
84  Display the needed libraries.
85
86 .. option:: --relocations, --relocs, -r
87
88  Display the relocation entries in the file.
89
90 .. option:: --sections, --section-headers, -S
91
92  Display all sections.
93
94 .. option:: --section-data, --sd
95
96  When used with :option:`--sections`, display section data for each section
97  shown. This option has no effect for GNU style output.
98
99 .. option:: --section-relocations, --sr
100
101  When used with :option:`--sections`, display relocations for each section
102  shown. This option has no effect for GNU style output.
103
104 .. option:: --section-symbols, --st
105
106  When used with :option:`--sections`, display symbols for each section shown.
107  This option has no effect for GNU style output.
108
109 .. option:: --stackmap
110
111  Display contents of the stackmap section.
112
113 .. option:: --string-dump=<section[,section,...]>, -p
114
115  Display the specified section(s) as a list of strings. ``section`` may be a
116  section index or section name.
117
118 .. option:: --string-table
119  
120  Display contents of the string table.
121
122 .. option:: --symbols, --syms, -s
123
124  Display the symbol table.
125
126 .. option:: --unwind, -u
127
128  Display unwind information.
129
130 .. option:: --version
131
132  Display the version of the :program:`llvm-readobj` executable.
133
134 .. option:: @<FILE>
135
136  Read command-line options from response file `<FILE>`.
137
138 ELF SPECIFIC OPTIONS
139 --------------------
140
141 The following options are implemented only for the ELF file format.
142
143 .. option:: --arch-specific, -A
144
145  Display architecture-specific information, e.g. the ARM attributes section on ARM.
146
147 .. option:: --bb-addr-map
148
149  Display the contents of the basic block address map section(s), which contain the
150  address of each function, along with the relative offset of each basic block.
151
152 .. option:: --demangle, -C
153
154  Display demangled symbol names in the output.
155
156 .. option:: --dependent-libraries
157
158  Display the dependent libraries section.
159
160 .. option:: --dyn-relocations
161
162  Display the dynamic relocation entries.
163
164 .. option:: --dyn-symbols, --dyn-syms, --dt
165
166  Display the dynamic symbol table.
167
168 .. option:: --dynamic-table, --dynamic, -d
169
170  Display the dynamic table.
171
172 .. option:: --cg-profile
173
174  Display the callgraph profile section.
175
176 .. option:: --histogram, -I
177
178  Display a bucket list histogram for dynamic symbol hash tables.
179
180 .. option:: --elf-linker-options
181
182  Display the linker options section.
183
184 .. option:: --elf-output-style=<value>
185
186  Format ELF information in the specified style. Valid options are ``LLVM`` and
187  ``GNU``. ``LLVM`` output (the default) is an expanded and structured format,
188  whilst ``GNU`` output mimics the equivalent GNU :program:`readelf` output.
189
190 .. option:: --section-groups, -g
191
192  Display section groups.
193
194 .. option:: --gnu-hash-table
195
196  Display the GNU hash table for dynamic symbols.
197
198 .. option:: --hash-symbols
199
200  Display the expanded hash table with dynamic symbol data.
201
202 .. option:: --hash-table
203
204  Display the hash table for dynamic symbols.
205
206 .. option:: --notes, -n
207
208  Display all notes.
209
210 .. option:: --program-headers, --segments, -l
211
212  Display the program headers.
213
214 .. option:: --raw-relr
215
216  Do not decode relocations in RELR relocation sections when displaying them.
217
218 .. option:: --section-mapping
219
220  Display the section to segment mapping.
221
222 .. option:: --stack-sizes
223
224  Display the contents of the stack sizes section(s), i.e. pairs of function
225  names and the size of their stack frames. Currently only implemented for GNU
226  style output.
227
228 .. option:: --version-info, -V
229
230  Display version sections.
231
232 MACH-O SPECIFIC OPTIONS
233 -----------------------
234
235 The following options are implemented only for the Mach-O file format.
236
237 .. option:: --macho-data-in-code
238
239  Display the Data in Code command.
240
241 .. option:: --macho-dsymtab
242
243  Display the Dsymtab command.
244
245 .. option:: --macho-indirect-symbols
246
247  Display indirect symbols.
248
249 .. option:: --macho-linker-options
250
251  Display the Mach-O-specific linker options.
252
253 .. option:: --macho-segment
254
255  Display the Segment command.
256
257 .. option:: --macho-version-min
258
259  Display the version min command.
260
261 PE/COFF SPECIFIC OPTIONS
262 ------------------------
263
264 The following options are implemented only for the PE/COFF file format.
265
266 .. option:: --codeview
267
268  Display CodeView debug information.
269
270 .. option:: --codeview-ghash
271
272  Enable global hashing for CodeView type stream de-duplication.
273
274 .. option:: --codeview-merged-types
275
276  Display the merged CodeView type stream.
277
278 .. option:: --codeview-subsection-bytes
279
280  Dump raw contents of CodeView debug sections and records.
281
282 .. option:: --coff-basereloc
283
284  Display the .reloc section.
285
286 .. option:: --coff-debug-directory
287
288  Display the debug directory.
289
290 .. option:: --coff-tls-directory
291
292  Display the TLS directory.
293
294 .. option:: --coff-directives
295
296  Display the .drectve section.
297
298 .. option:: --coff-exports
299
300  Display the export table.
301
302 .. option:: --coff-imports
303
304  Display the import table.
305
306 .. option:: --coff-load-config
307
308  Display the load config.
309
310 .. option:: --coff-resources
311
312  Display the .rsrc section.
313
314 XCOFF SPECIFIC OPTIONS
315 ----------------------
316
317 The following options are implemented only for the XCOFF file format.
318
319 .. option:: --auxiliary-header
320
321   Display XCOFF Auxiliary header.
322
323 EXIT STATUS
324 -----------
325
326 :program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero
327 exit code if there were any errors.
328
329 SEE ALSO
330 --------
331
332 :manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`