blob: 2730374d5810383715c7614bb1e8c5fa2f0ccbb9 [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
James Henderson8447b412019-07-09 12:41:39 +000030 Disassemble all text sections found in the input files.
Michael Trent7e660212019-01-15 20:41:30 +000031
James Hendersona8ed3542019-06-21 10:12:53 +000032.. option:: -D, --disassemble-all
Michael Trent7e660212019-01-15 20:41:30 +000033
James Henderson8447b412019-07-09 12:41:39 +000034 Disassemble all sections found in the input files.
James Hendersona8ed3542019-06-21 10:12:53 +000035
Fangrui Song0d673be2020-03-07 12:55:44 -080036.. option:: --disassemble-symbols=<symbol1[,symbol2,...]>
Michael Trent7e660212019-01-15 20:41:30 +000037
Yuanfang Chen2dcd2c22019-06-27 18:39:34 +000038 Disassemble only the specified symbols. Takes demangled symbol names when
39 :option:`--demangle` is specified, otherwise takes mangled symbol names.
40 Implies :option:`--disassemble`.
Michael Trent4a685862018-08-08 14:39:22 +000041
James Hendersona8ed3542019-06-21 10:12:53 +000042.. option:: --dwarf=<value>
Michael Trent4a685862018-08-08 14:39:22 +000043
James Hendersona8ed3542019-06-21 10:12:53 +000044 Dump the specified DWARF debug sections. The supported values are:
Michael Trent4a685862018-08-08 14:39:22 +000045
James Hendersona8ed3542019-06-21 10:12:53 +000046 `frames` - .debug_frame
Michael Trent4a685862018-08-08 14:39:22 +000047
James Hendersona8ed3542019-06-21 10:12:53 +000048.. option:: -f, --file-headers
Michael Trent4a685862018-08-08 14:39:22 +000049
James Hendersona8ed3542019-06-21 10:12:53 +000050 Display the contents of the overall file header.
Michael Trent4a685862018-08-08 14:39:22 +000051
James Hendersona8ed3542019-06-21 10:12:53 +000052.. option:: --fault-map-section
53
54 Display the content of the fault map section.
55
56.. option:: -h, --headers, --section-headers
Michael Trent4a685862018-08-08 14:39:22 +000057
58 Display summaries of the headers for each section.
59
James Hendersona8ed3542019-06-21 10:12:53 +000060.. option:: --help
61
62 Display usage information and exit. Does not stack with other commands.
63
64.. option:: -p, --private-headers
65
66 Display format-specific file headers.
67
68.. option:: -r, --reloc
69
70 Display the relocation entries in the file.
71
72.. option:: -R, --dynamic-reloc
73
74 Display the dynamic relocation entries in the file.
75
76.. option:: --raw-clang-ast
77
78 Dump the raw binary contents of the clang AST section.
79
80.. option:: -s, --full-contents
81
82 Display the contents of each section.
83
84.. option:: -t, --syms
Michael Trent4a685862018-08-08 14:39:22 +000085
86 Display the symbol table.
87
James Hendersona8ed3542019-06-21 10:12:53 +000088.. option:: -u, --unwind-info
89
90 Display the unwind info of the input(s).
91
92.. option:: --version
Michael Trent4a685862018-08-08 14:39:22 +000093
James Henderson778a5e52019-09-17 11:43:42 +000094 Display the version of the :program:`llvm-objdump` executable. Does not stack
95 with other commands.
Michael Trent7e660212019-01-15 20:41:30 +000096
James Hendersona8ed3542019-06-21 10:12:53 +000097.. option:: -x, --all-headers
98
99 Display all available header information. Equivalent to specifying
100 :option:`--archive-headers`, :option:`--file-headers`,
101 :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`,
102 and :option:`--syms`.
103
Michael Trent4a685862018-08-08 14:39:22 +0000104OPTIONS
105-------
106:program:`llvm-objdump` supports the following options:
107
James Hendersona8ed3542019-06-21 10:12:53 +0000108.. option:: --adjust-vma=<offset>
Michael Trent4a685862018-08-08 14:39:22 +0000109
James Hendersona8ed3542019-06-21 10:12:53 +0000110 Increase the displayed address in disassembly or section header printing by
111 the specified offset.
Michael Trent4a685862018-08-08 14:39:22 +0000112
James Hendersona8ed3542019-06-21 10:12:53 +0000113.. option:: --arch-name=<string>
Michael Trent4a685862018-08-08 14:39:22 +0000114
Yuanfang Chen2dcd2c22019-06-27 18:39:34 +0000115 Specify the target architecture when disassembling. Use :option:`--version`
James Hendersona8ed3542019-06-21 10:12:53 +0000116 for a list of available targets.
Michael Trent4a685862018-08-08 14:39:22 +0000117
James Hendersona8ed3542019-06-21 10:12:53 +0000118.. option:: -C, --demangle
Michael Trent4a685862018-08-08 14:39:22 +0000119
James Hendersona8ed3542019-06-21 10:12:53 +0000120 Demangle symbol names in the output.
Michael Trent4a685862018-08-08 14:39:22 +0000121
James Hendersona8ed3542019-06-21 10:12:53 +0000122.. option:: -j, --section=<section1[,section2,...]>
Michael Trent4a685862018-08-08 14:39:22 +0000123
James Henderson8447b412019-07-09 12:41:39 +0000124 Perform commands on the specified sections only. For Mach-O use
125 `segment,section` to specify the section name.
Michael Trent4a685862018-08-08 14:39:22 +0000126
James Hendersona8ed3542019-06-21 10:12:53 +0000127.. option:: -l, --line-numbers
Michael Trent4a685862018-08-08 14:39:22 +0000128
James Henderson8447b412019-07-09 12:41:39 +0000129 When disassembling, display source line numbers. Implies
James Hendersona8ed3542019-06-21 10:12:53 +0000130 :option:`--disassemble`.
Michael Trent4a685862018-08-08 14:39:22 +0000131
James Hendersona8ed3542019-06-21 10:12:53 +0000132.. option:: -M, --disassembler-options=<opt1[,opt2,...]>
Michael Trent4a685862018-08-08 14:39:22 +0000133
James Hendersona8ed3542019-06-21 10:12:53 +0000134 Pass target-specific disassembler options. Currently supported for ARM targets
135 only. Available options are ``reg-names-std`` and ``reg-names-raw``.
Michael Trent7e660212019-01-15 20:41:30 +0000136
James Hendersona8ed3542019-06-21 10:12:53 +0000137.. option:: --mcpu=<cpu-name>
Michael Trent4a685862018-08-08 14:39:22 +0000138
James Hendersona8ed3542019-06-21 10:12:53 +0000139 Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display
140 available CPUs.
Michael Trent4a685862018-08-08 14:39:22 +0000141
James Hendersona8ed3542019-06-21 10:12:53 +0000142.. option:: --mattr=<a1,+a2,-a3,...>
Michael Trent4a685862018-08-08 14:39:22 +0000143
James Hendersona8ed3542019-06-21 10:12:53 +0000144 Enable/disable target-specific attributes. Specify ``--mcpu=help`` to display
145 the available attributes.
Michael Trent7e660212019-01-15 20:41:30 +0000146
James Hendersona8ed3542019-06-21 10:12:53 +0000147.. option:: --no-leading-addr
Michael Trent4a685862018-08-08 14:39:22 +0000148
James Henderson8447b412019-07-09 12:41:39 +0000149 When disassembling, do not print leading addresses.
Michael Trent7e660212019-01-15 20:41:30 +0000150
James Hendersona8ed3542019-06-21 10:12:53 +0000151.. option:: --no-show-raw-insn
Michael Trent4a685862018-08-08 14:39:22 +0000152
James Henderson8447b412019-07-09 12:41:39 +0000153 When disassembling, do not print the raw bytes of each instruction.
James Hendersona8ed3542019-06-21 10:12:53 +0000154
155.. option:: --print-imm-hex
156
157 Use hex format when printing immediate values in disassembly output.
158
159.. option:: -S, --source
160
James Henderson8447b412019-07-09 12:41:39 +0000161 When disassembling, display source interleaved with the disassembly. Implies
162 :option:`--disassemble`.
James Hendersona8ed3542019-06-21 10:12:53 +0000163
164.. option:: --show-lma
165
166 Display the LMA column when dumping ELF section headers. Defaults to off
167 unless any section has different VMA and LMAs.
168
169.. option:: --start-address=<address>
170
171 When disassembling, only disassemble from the specified address.
172
173 When printing relocations, only print the relocations patching offsets from at least ``address``.
174
175 When printing symbols, only print symbols with a value of at least ``address``.
176
177.. option:: --stop-address=<address>
178
179 When disassembling, only disassemble up to, but not including the specified address.
180
181 When printing relocations, only print the relocations patching offsets up to ``address``.
182
183 When printing symbols, only print symbols with a value up to ``address``.
184
185.. option:: --triple=<string>
186
187 Target triple to disassemble for, see ``--version`` for available targets.
188
189.. option:: -w, --wide
190
191 Ignored for compatibility with GNU objdump.
192
193.. option:: --x86-asm-syntax=<style>
194
Yuanfang Chen2dcd2c22019-06-27 18:39:34 +0000195 When used with :option:`--disassemble`, choose style of code to emit from
Michael Trent4a685862018-08-08 14:39:22 +0000196 X86 backend. Supported values are:
197
198 .. option:: att
Michael Trent7e660212019-01-15 20:41:30 +0000199
Michael Trent4a685862018-08-08 14:39:22 +0000200 AT&T-style assembly
Michael Trent7e660212019-01-15 20:41:30 +0000201
Michael Trent4a685862018-08-08 14:39:22 +0000202 .. option:: intel
Michael Trent7e660212019-01-15 20:41:30 +0000203
Michael Trent4a685862018-08-08 14:39:22 +0000204 Intel-style assembly
205
Michael Trent7e660212019-01-15 20:41:30 +0000206
207 The default disassembly style is **att**.
Michael Trent4a685862018-08-08 14:39:22 +0000208
James Hendersona8ed3542019-06-21 10:12:53 +0000209.. option:: -z, --disassemble-zeroes
210
211 Do not skip blocks of zeroes when disassembling.
212
James Hendersonf7212db2019-06-21 14:41:36 +0000213.. option:: @<FILE>
214
215 Read command-line options and commands from response file `<FILE>`.
216
James Hendersona8ed3542019-06-21 10:12:53 +0000217MACH-O ONLY OPTIONS AND COMMANDS
218--------------------------------
219
220.. option:: --arch=<architecture>
221
222 Specify the architecture to disassemble. see ``--version`` for available
223 architectures.
224
225.. option:: --archive-member-offsets
226
227 Print the offset to each archive member for Mach-O archives (requires
228 :option:`--archive-headers`).
229
230.. option:: --bind
231
232 Display binding info
233
234.. option:: --cfg
235
236 Create a CFG for every symbol in the object file and write it to a graphviz
237 file.
238
239.. option:: --data-in-code
240
241 Display the data in code table.
242
243.. option:: --dis-symname=<name>
244
245 Disassemble just the specified symbol's instructions.
246
247.. option:: --dylibs-used
248
249 Display the shared libraries used for linked files.
250
251.. option:: --dsym=<string>
252
253 Use .dSYM file for debug info.
254
255.. option:: --dylib-id
256
257 Display the shared library's ID for dylib files.
258
259.. option:: --exports-trie
260
261 Display exported symbols.
262
263.. option:: -g
264
265 Print line information from debug info if available.
266
267.. option:: --full-leading-addr
268
269 Print the full leading address when disassembling.
270
271.. option:: --indirect-symbols
272
273 Display the indirect symbol table.
274
275.. option:: --info-plist
276
277 Display the info plist section as strings.
278
279.. option:: --lazy-bind
280
281 Display lazy binding info.
282
283.. option:: --link-opt-hints
284
285 Display the linker optimization hints.
286
287.. option:: -m, --macho
288
289 Use Mach-O specific object file parser. Commands and other options may behave
290 differently when used with ``--macho``.
291
292.. option:: --no-leading-headers
293
294 Do not print any leading headers.
295
296.. option:: --no-symbolic-operands
297
298 Do not print symbolic operands when disassembling.
299
300.. option:: --non-verbose
301
302 Display the information for Mach-O objects in non-verbose or numeric form.
303
304.. option:: --objc-meta-data
305
306 Display the Objective-C runtime meta data.
307
308.. option:: --private-header
309
310 Display only the first format specific file header.
311
312.. option:: --rebase
313
314 Display rebasing information.
315
316.. option:: --universal-headers
317
318 Display universal headers.
319
320.. option:: --weak-bind
321
322 Display weak binding information.
323
Michael Trent4a685862018-08-08 14:39:22 +0000324BUGS
325----
326
327To report bugs, please visit <http://llvm.org/bugs/>.
328
329SEE ALSO
330--------
331
James Henderson92b32a92019-06-27 15:18:15 +0000332:manpage:`llvm-nm(1)`, :manpage:`llvm-readelf(1)`, :manpage:`llvm-readobj(1)`