blob: 5e1887254a564176e44127aad2dae9a3d539a177 [file] [log] [blame]
Michael Trent4a685862018-08-08 14:39:22 +00001llvm-objdump - LLVM's object file dumper
2========================================
3
James Hendersona0566842019-06-27 13:24:46 +00004.. program:: llvm-objdump
5
Michael Trent4a685862018-08-08 14:39:22 +00006SYNOPSIS
7--------
8
9:program:`llvm-objdump` [*commands*] [*options*] [*filenames...*]
10
11DESCRIPTION
12-----------
13The :program:`llvm-objdump` utility prints the contents of object files and
14final linked images named on the command line. If no file name is specified,
15:program:`llvm-objdump` will attempt to read from *a.out*. If *-* is used as a
16file name, :program:`llvm-objdump` will process a file on its standard input
17stream.
18
19COMMANDS
20--------
Michael Trent7e660212019-01-15 20:41:30 +000021At least one of the following commands are required, and some commands can be
22combined with other commands:
Michael Trent4a685862018-08-08 14:39:22 +000023
James Hendersona8ed3542019-06-21 10:12:53 +000024.. option:: -a, --archive-headers
25
26 Display the information contained within an archive's headers.
27
28.. option:: -d, --disassemble
Michael Trent4a685862018-08-08 14:39:22 +000029
Michael Trent7e660212019-01-15 20:41:30 +000030 Display assembler mnemonics for the machine instructions. Disassembles all
James Hendersona8ed3542019-06-21 10:12:53 +000031 text sections found in the input file(s) by default.
Michael Trent7e660212019-01-15 20:41:30 +000032
James Hendersona8ed3542019-06-21 10:12:53 +000033.. option:: -D, --disassemble-all
Michael Trent7e660212019-01-15 20:41:30 +000034
35 Display assembler mnemonics for the machine instructions. Disassembles all
James Hendersona8ed3542019-06-21 10:12:53 +000036 sections found in the input file(s) by default.
37
Yuanfang Chen2dcd2c22019-06-27 18:39:34 +000038.. option:: --disassemble-functions=<symbol1[,symbol2,...]>
Michael Trent7e660212019-01-15 20:41:30 +000039
Yuanfang Chen2dcd2c22019-06-27 18:39:34 +000040 Disassemble only the specified symbols. Takes demangled symbol names when
41 :option:`--demangle` is specified, otherwise takes mangled symbol names.
42 Implies :option:`--disassemble`.
Michael Trent4a685862018-08-08 14:39:22 +000043
James Hendersona8ed3542019-06-21 10:12:53 +000044.. option:: --dwarf=<value>
Michael Trent4a685862018-08-08 14:39:22 +000045
James Hendersona8ed3542019-06-21 10:12:53 +000046 Dump the specified DWARF debug sections. The supported values are:
Michael Trent4a685862018-08-08 14:39:22 +000047
James Hendersona8ed3542019-06-21 10:12:53 +000048 `frames` - .debug_frame
Michael Trent4a685862018-08-08 14:39:22 +000049
James Hendersona8ed3542019-06-21 10:12:53 +000050.. option:: -f, --file-headers
Michael Trent4a685862018-08-08 14:39:22 +000051
James Hendersona8ed3542019-06-21 10:12:53 +000052 Display the contents of the overall file header.
Michael Trent4a685862018-08-08 14:39:22 +000053
James Hendersona8ed3542019-06-21 10:12:53 +000054.. option:: --fault-map-section
55
56 Display the content of the fault map section.
57
58.. option:: -h, --headers, --section-headers
Michael Trent4a685862018-08-08 14:39:22 +000059
60 Display summaries of the headers for each section.
61
James Hendersona8ed3542019-06-21 10:12:53 +000062.. option:: --help
63
64 Display usage information and exit. Does not stack with other commands.
65
66.. option:: -p, --private-headers
67
68 Display format-specific file headers.
69
70.. option:: -r, --reloc
71
72 Display the relocation entries in the file.
73
74.. option:: -R, --dynamic-reloc
75
76 Display the dynamic relocation entries in the file.
77
78.. option:: --raw-clang-ast
79
80 Dump the raw binary contents of the clang AST section.
81
82.. option:: -s, --full-contents
83
84 Display the contents of each section.
85
86.. option:: -t, --syms
Michael Trent4a685862018-08-08 14:39:22 +000087
88 Display the symbol table.
89
James Hendersona8ed3542019-06-21 10:12:53 +000090.. option:: -u, --unwind-info
91
92 Display the unwind info of the input(s).
93
94.. option:: --version
Michael Trent4a685862018-08-08 14:39:22 +000095
96 Display the version of this program. Does not stack with other commands.
Michael Trent7e660212019-01-15 20:41:30 +000097
James Hendersona8ed3542019-06-21 10:12:53 +000098.. option:: -x, --all-headers
99
100 Display all available header information. Equivalent to specifying
101 :option:`--archive-headers`, :option:`--file-headers`,
102 :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`,
103 and :option:`--syms`.
104
Michael Trent4a685862018-08-08 14:39:22 +0000105OPTIONS
106-------
107:program:`llvm-objdump` supports the following options:
108
James Hendersona8ed3542019-06-21 10:12:53 +0000109.. option:: --adjust-vma=<offset>
Michael Trent4a685862018-08-08 14:39:22 +0000110
James Hendersona8ed3542019-06-21 10:12:53 +0000111 Increase the displayed address in disassembly or section header printing by
112 the specified offset.
Michael Trent4a685862018-08-08 14:39:22 +0000113
James Hendersona8ed3542019-06-21 10:12:53 +0000114.. option:: --arch-name=<string>
Michael Trent4a685862018-08-08 14:39:22 +0000115
Yuanfang Chen2dcd2c22019-06-27 18:39:34 +0000116 Specify the target architecture when disassembling. Use :option:`--version`
James Hendersona8ed3542019-06-21 10:12:53 +0000117 for a list of available targets.
Michael Trent4a685862018-08-08 14:39:22 +0000118
James Hendersona8ed3542019-06-21 10:12:53 +0000119.. option:: -C, --demangle
Michael Trent4a685862018-08-08 14:39:22 +0000120
James Hendersona8ed3542019-06-21 10:12:53 +0000121 Demangle symbol names in the output.
Michael Trent4a685862018-08-08 14:39:22 +0000122
James Hendersona8ed3542019-06-21 10:12:53 +0000123.. option:: -j, --section=<section1[,section2,...]>
Michael Trent4a685862018-08-08 14:39:22 +0000124
James Hendersona8ed3542019-06-21 10:12:53 +0000125 Perform the specified command(s) on the specified section(s) only. For Mach-O
126 use `segment,section` to specify the section name.
Michael Trent4a685862018-08-08 14:39:22 +0000127
James Hendersona8ed3542019-06-21 10:12:53 +0000128.. option:: -l, --line-numbers
Michael Trent4a685862018-08-08 14:39:22 +0000129
James Hendersona8ed3542019-06-21 10:12:53 +0000130 When disassembling, display source line numbers with disassembly. Implies
131 :option:`--disassemble`.
Michael Trent4a685862018-08-08 14:39:22 +0000132
James Hendersona8ed3542019-06-21 10:12:53 +0000133.. option:: -M, --disassembler-options=<opt1[,opt2,...]>
Michael Trent4a685862018-08-08 14:39:22 +0000134
James Hendersona8ed3542019-06-21 10:12:53 +0000135 Pass target-specific disassembler options. Currently supported for ARM targets
136 only. Available options are ``reg-names-std`` and ``reg-names-raw``.
Michael Trent7e660212019-01-15 20:41:30 +0000137
James Hendersona8ed3542019-06-21 10:12:53 +0000138.. option:: --mcpu=<cpu-name>
Michael Trent4a685862018-08-08 14:39:22 +0000139
James Hendersona8ed3542019-06-21 10:12:53 +0000140 Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display
141 available CPUs.
Michael Trent4a685862018-08-08 14:39:22 +0000142
James Hendersona8ed3542019-06-21 10:12:53 +0000143.. option:: --mattr=<a1,+a2,-a3,...>
Michael Trent4a685862018-08-08 14:39:22 +0000144
James Hendersona8ed3542019-06-21 10:12:53 +0000145 Enable/disable target-specific attributes. Specify ``--mcpu=help`` to display
146 the available attributes.
Michael Trent7e660212019-01-15 20:41:30 +0000147
James Hendersona8ed3542019-06-21 10:12:53 +0000148.. option:: --no-leading-addr
Michael Trent4a685862018-08-08 14:39:22 +0000149
James Hendersona8ed3542019-06-21 10:12:53 +0000150 When disassembling, do not print the leading address in the disassembly
151 output.
Michael Trent7e660212019-01-15 20:41:30 +0000152
James Hendersona8ed3542019-06-21 10:12:53 +0000153.. option:: --no-show-raw-insn
Michael Trent4a685862018-08-08 14:39:22 +0000154
James Hendersona8ed3542019-06-21 10:12:53 +0000155 When disassembling instructions, do not print the raw bytes of the
156 instruction.
157
158.. option:: --print-imm-hex
159
160 Use hex format when printing immediate values in disassembly output.
161
162.. option:: -S, --source
163
164 When disassembling, display source inlined with the disassembly.
165 Implies :option:`--disassemble`.
166
167.. option:: --show-lma
168
169 Display the LMA column when dumping ELF section headers. Defaults to off
170 unless any section has different VMA and LMAs.
171
172.. option:: --start-address=<address>
173
174 When disassembling, only disassemble from the specified address.
175
176 When printing relocations, only print the relocations patching offsets from at least ``address``.
177
178 When printing symbols, only print symbols with a value of at least ``address``.
179
180.. option:: --stop-address=<address>
181
182 When disassembling, only disassemble up to, but not including the specified address.
183
184 When printing relocations, only print the relocations patching offsets up to ``address``.
185
186 When printing symbols, only print symbols with a value up to ``address``.
187
188.. option:: --triple=<string>
189
190 Target triple to disassemble for, see ``--version`` for available targets.
191
192.. option:: -w, --wide
193
194 Ignored for compatibility with GNU objdump.
195
196.. option:: --x86-asm-syntax=<style>
197
Yuanfang Chen2dcd2c22019-06-27 18:39:34 +0000198 When used with :option:`--disassemble`, choose style of code to emit from
Michael Trent4a685862018-08-08 14:39:22 +0000199 X86 backend. Supported values are:
200
201 .. option:: att
Michael Trent7e660212019-01-15 20:41:30 +0000202
Michael Trent4a685862018-08-08 14:39:22 +0000203 AT&T-style assembly
Michael Trent7e660212019-01-15 20:41:30 +0000204
Michael Trent4a685862018-08-08 14:39:22 +0000205 .. option:: intel
Michael Trent7e660212019-01-15 20:41:30 +0000206
Michael Trent4a685862018-08-08 14:39:22 +0000207 Intel-style assembly
208
Michael Trent7e660212019-01-15 20:41:30 +0000209
210 The default disassembly style is **att**.
Michael Trent4a685862018-08-08 14:39:22 +0000211
James Hendersona8ed3542019-06-21 10:12:53 +0000212.. option:: -z, --disassemble-zeroes
213
214 Do not skip blocks of zeroes when disassembling.
215
James Hendersonf7212db2019-06-21 14:41:36 +0000216.. option:: @<FILE>
217
218 Read command-line options and commands from response file `<FILE>`.
219
James Hendersona8ed3542019-06-21 10:12:53 +0000220MACH-O ONLY OPTIONS AND COMMANDS
221--------------------------------
222
223.. option:: --arch=<architecture>
224
225 Specify the architecture to disassemble. see ``--version`` for available
226 architectures.
227
228.. option:: --archive-member-offsets
229
230 Print the offset to each archive member for Mach-O archives (requires
231 :option:`--archive-headers`).
232
233.. option:: --bind
234
235 Display binding info
236
237.. option:: --cfg
238
239 Create a CFG for every symbol in the object file and write it to a graphviz
240 file.
241
242.. option:: --data-in-code
243
244 Display the data in code table.
245
246.. option:: --dis-symname=<name>
247
248 Disassemble just the specified symbol's instructions.
249
250.. option:: --dylibs-used
251
252 Display the shared libraries used for linked files.
253
254.. option:: --dsym=<string>
255
256 Use .dSYM file for debug info.
257
258.. option:: --dylib-id
259
260 Display the shared library's ID for dylib files.
261
262.. option:: --exports-trie
263
264 Display exported symbols.
265
266.. option:: -g
267
268 Print line information from debug info if available.
269
270.. option:: --full-leading-addr
271
272 Print the full leading address when disassembling.
273
274.. option:: --indirect-symbols
275
276 Display the indirect symbol table.
277
278.. option:: --info-plist
279
280 Display the info plist section as strings.
281
282.. option:: --lazy-bind
283
284 Display lazy binding info.
285
286.. option:: --link-opt-hints
287
288 Display the linker optimization hints.
289
290.. option:: -m, --macho
291
292 Use Mach-O specific object file parser. Commands and other options may behave
293 differently when used with ``--macho``.
294
295.. option:: --no-leading-headers
296
297 Do not print any leading headers.
298
299.. option:: --no-symbolic-operands
300
301 Do not print symbolic operands when disassembling.
302
303.. option:: --non-verbose
304
305 Display the information for Mach-O objects in non-verbose or numeric form.
306
307.. option:: --objc-meta-data
308
309 Display the Objective-C runtime meta data.
310
311.. option:: --private-header
312
313 Display only the first format specific file header.
314
315.. option:: --rebase
316
317 Display rebasing information.
318
319.. option:: --universal-headers
320
321 Display universal headers.
322
323.. option:: --weak-bind
324
325 Display weak binding information.
326
Michael Trent4a685862018-08-08 14:39:22 +0000327BUGS
328----
329
330To report bugs, please visit <http://llvm.org/bugs/>.
331
332SEE ALSO
333--------
334
James Henderson92b32a92019-06-27 15:18:15 +0000335:manpage:`llvm-nm(1)`, :manpage:`llvm-readelf(1)`, :manpage:`llvm-readobj(1)`