1llvm-objdump - LLVM's object file dumper
2========================================
3
4.. program:: llvm-objdump
5
6SYNOPSIS
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--------
21At least one of the following commands are required, and some commands can be
22combined with other commands:
23
24.. option:: -a, --archive-headers
25
26  Display the information contained within an archive's headers.
27
28.. option:: -d, --disassemble
29
30  Disassemble all text sections found in the input files.
31
32.. option:: -D, --disassemble-all
33
34  Disassemble all sections found in the input files.
35
36.. option:: --disassemble-symbols=<symbol1[,symbol2,...]>
37
38  Disassemble only the specified symbols. Takes demangled symbol names when
39  :option:`--demangle` is specified, otherwise takes mangled symbol names.
40  Implies :option:`--disassemble`.
41
42.. option:: --dwarf=<value>
43
44  Dump the specified DWARF debug sections. The supported values are:
45
46  `frames` - .debug_frame
47
48.. option:: -f, --file-headers
49
50  Display the contents of the overall file header.
51
52.. option:: --fault-map-section
53
54  Display the content of the fault map section.
55
56.. option:: -h, --headers, --section-headers
57
58  Display summaries of the headers for each section.
59
60.. 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
85
86  Display the symbol table.
87
88.. option:: -T, --dynamic-syms
89
90  Display the contents of the dynamic symbol table.
91
92.. option:: -u, --unwind-info
93
94  Display the unwind info of the input(s).
95
96.. option:: -v, --version
97
98  Display the version of the :program:`llvm-objdump` executable. Does not stack
99  with other commands.
100
101.. option:: -x, --all-headers
102
103  Display all available header information. Equivalent to specifying
104  :option:`--archive-headers`, :option:`--file-headers`,
105  :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`,
106  and :option:`--syms`.
107
108OPTIONS
109-------
110:program:`llvm-objdump` supports the following options:
111
112.. option:: --adjust-vma=<offset>
113
114  Increase the displayed address in disassembly or section header printing by
115  the specified offset.
116
117.. option:: --arch-name=<string>
118
119  Specify the target architecture when disassembling. Use :option:`--version`
120  for a list of available targets.
121
122.. option:: -C, --demangle
123
124  Demangle symbol names in the output.
125
126.. option:: --debug-vars=<format>
127
128  Print the locations (in registers or memory) of source-level variables
129  alongside disassembly. ``format`` may be ``unicode`` or ``ascii``, defaulting
130  to ``unicode`` if omitted.
131
132.. option:: --debug-vars-indent=<width>
133
134  Distance to indent the source-level variable display, relative to the start
135  of the disassembly. Defaults to 40 characters.
136
137.. option:: -j, --section=<section1[,section2,...]>
138
139  Perform commands on the specified sections only. For Mach-O use
140  `segment,section` to specify the section name.
141
142.. option:: -l, --line-numbers
143
144  When disassembling, display source line numbers. Implies
145  :option:`--disassemble`.
146
147.. option:: -M, --disassembler-options=<opt1[,opt2,...]>
148
149  Pass target-specific disassembler options. Available options:
150
151  * ``reg-names-std``: ARM only (default). Print in ARM 's instruction set documentation, with r13/r14/r15 replaced by sp/lr/pc.
152  * ``reg-names-raw``: ARM only. Use r followed by the register number.
153  * ``no-aliases``: AArch64 and RISC-V only. Print raw instruction mnemonic instead of pesudo instruction mnemonic.
154  * ``numeric``: RISC-V only. Print raw register names instead of ABI mnemonic. (e.g. print x1 instead of ra)
155  * ``att``: x86 only (default). Print in the AT&T syntax.
156  * ``intel``: x86 only. Print in the intel syntax.
157
158.. option:: --mcpu=<cpu-name>
159
160  Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display
161  available CPUs.
162
163.. option:: --mattr=<a1,+a2,-a3,...>
164
165  Enable/disable target-specific attributes. Specify ``--mattr=help`` to display
166  the available attributes.
167
168.. option:: --no-leading-addr
169
170  When disassembling, do not print leading addresses.
171
172.. option:: --no-show-raw-insn
173
174  When disassembling, do not print the raw bytes of each instruction.
175
176.. option:: --prefix=<prefix>
177
178  When disassembling with the :option:`--source` option, prepend ``prefix`` to
179  absolute paths.
180
181.. option:: --prefix-strip=<level>
182
183  When disassembling with the :option:`--source` option, strip out ``level``
184  initial directories from absolute paths. This option has no effect without
185  :option:`--prefix`.
186
187.. option:: --print-imm-hex
188
189  Use hex format when printing immediate values in disassembly output.
190
191.. option:: -S, --source
192
193  When disassembling, display source interleaved with the disassembly. Implies
194  :option:`--disassemble`.
195
196.. option:: --show-lma
197
198  Display the LMA column when dumping ELF section headers. Defaults to off
199  unless any section has different VMA and LMAs.
200
201.. option:: --start-address=<address>
202
203  When disassembling, only disassemble from the specified address.
204
205  When printing relocations, only print the relocations patching offsets from at least ``address``.
206
207  When printing symbols, only print symbols with a value of at least ``address``.
208
209.. option:: --stop-address=<address>
210
211  When disassembling, only disassemble up to, but not including the specified address.
212
213  When printing relocations, only print the relocations patching offsets up to ``address``.
214
215  When printing symbols, only print symbols with a value up to ``address``.
216
217.. option:: --symbolize-operands
218
219  When disassembling, symbolize a branch target operand to print a label instead of a real address.
220
221  When printing a PC-relative global symbol reference, print it as an offset from the leading symbol.
222
223  Only works with an X86 linked image.
224
225  Example:
226    A non-symbolized branch instruction with a local target and pc-relative memory access like
227
228  .. code-block:: none
229
230      cmp eax, dword ptr [rip + 4112]
231      jge 0x20117e <_start+0x25>
232
233  might become
234
235  .. code-block:: none
236
237     <L0>:
238       cmp eax, dword ptr <g>
239       jge	<L0>
240
241.. option:: --triple=<string>
242
243  Target triple to disassemble for, see ``--version`` for available targets.
244
245.. option:: -w, --wide
246
247  Ignored for compatibility with GNU objdump.
248
249.. option:: --x86-asm-syntax=<style>
250
251  Deprecated.
252  When used with :option:`--disassemble`, choose style of code to emit from
253  X86 backend. Supported values are:
254
255   .. option:: att
256
257    AT&T-style assembly
258
259   .. option:: intel
260
261    Intel-style assembly
262
263
264  The default disassembly style is **att**.
265
266.. option:: -z, --disassemble-zeroes
267
268  Do not skip blocks of zeroes when disassembling.
269
270.. option:: @<FILE>
271
272  Read command-line options and commands from response file `<FILE>`.
273
274MACH-O ONLY OPTIONS AND COMMANDS
275--------------------------------
276
277.. option:: --arch=<architecture>
278
279  Specify the architecture to disassemble. see ``--version`` for available
280  architectures.
281
282.. option:: --archive-member-offsets
283
284  Print the offset to each archive member for Mach-O archives (requires
285  :option:`--archive-headers`).
286
287.. option:: --bind
288
289  Display binding info
290
291.. option:: --data-in-code
292
293  Display the data in code table.
294
295.. option:: --dis-symname=<name>
296
297  Disassemble just the specified symbol's instructions.
298
299.. option:: --dylibs-used
300
301  Display the shared libraries used for linked files.
302
303.. option:: --dsym=<string>
304
305  Use .dSYM file for debug info.
306
307.. option:: --dylib-id
308
309  Display the shared library's ID for dylib files.
310
311.. option:: --exports-trie
312
313  Display exported symbols.
314
315.. option:: --function-starts
316
317  Print the function starts table for Mach-O objects.
318
319.. option:: -g
320
321  Print line information from debug info if available.
322
323.. option:: --full-leading-addr
324
325  Print the full leading address when disassembling.
326
327.. option:: --indirect-symbols
328
329  Display the indirect symbol table.
330
331.. option:: --info-plist
332
333  Display the info plist section as strings.
334
335.. option:: --lazy-bind
336
337  Display lazy binding info.
338
339.. option:: --link-opt-hints
340
341  Display the linker optimization hints.
342
343.. option:: -m, --macho
344
345  Use Mach-O specific object file parser. Commands and other options may behave
346  differently when used with ``--macho``.
347
348.. option:: --no-leading-headers
349
350  Do not print any leading headers.
351
352.. option:: --no-symbolic-operands
353
354  Do not print symbolic operands when disassembling.
355
356.. option:: --non-verbose
357
358  Display the information for Mach-O objects in non-verbose or numeric form.
359
360.. option:: --objc-meta-data
361
362  Display the Objective-C runtime meta data.
363
364.. option:: --private-header
365
366  Display only the first format specific file header.
367
368.. option:: --rebase
369
370  Display rebasing information.
371
372.. option:: --rpaths
373
374  Display runtime search paths for the binary.
375
376.. option:: --universal-headers
377
378  Display universal headers.
379
380.. option:: --weak-bind
381
382  Display weak binding information.
383
384XCOFF ONLY OPTIONS AND COMMANDS
385---------------------------------
386
387.. option:: --symbol-description
388
389  Add symbol description to disassembly output.
390
391BUGS
392----
393
394To report bugs, please visit <https://bugs.llvm.org/>.
395
396SEE ALSO
397--------
398
399:manpage:`llvm-nm(1)`, :manpage:`llvm-otool(1)`, :manpage:`llvm-readelf(1)`,
400:manpage:`llvm-readobj(1)`
401