llvm-objdump.rst 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. llvm-objdump - LLVM's object file dumper
  2. ========================================
  3. .. program:: llvm-objdump
  4. SYNOPSIS
  5. --------
  6. :program:`llvm-objdump` [*commands*] [*options*] [*filenames...*]
  7. DESCRIPTION
  8. -----------
  9. The :program:`llvm-objdump` utility prints the contents of object files and
  10. final linked images named on the command line. If no file name is specified,
  11. :program:`llvm-objdump` will attempt to read from *a.out*. If *-* is used as a
  12. file name, :program:`llvm-objdump` will process a file on its standard input
  13. stream.
  14. COMMANDS
  15. --------
  16. At least one of the following commands are required, and some commands can be
  17. combined with other commands:
  18. .. option:: -a, --archive-headers
  19. Display the information contained within an archive's headers.
  20. .. option:: -d, --disassemble
  21. Disassemble all text sections found in the input files.
  22. .. option:: -D, --disassemble-all
  23. Disassemble all sections found in the input files.
  24. .. option:: --disassemble-functions=<symbol1[,symbol2,...]>
  25. Disassemble only the specified symbols. Takes demangled symbol names when
  26. :option:`--demangle` is specified, otherwise takes mangled symbol names.
  27. Implies :option:`--disassemble`.
  28. .. option:: --dwarf=<value>
  29. Dump the specified DWARF debug sections. The supported values are:
  30. `frames` - .debug_frame
  31. .. option:: -f, --file-headers
  32. Display the contents of the overall file header.
  33. .. option:: --fault-map-section
  34. Display the content of the fault map section.
  35. .. option:: -h, --headers, --section-headers
  36. Display summaries of the headers for each section.
  37. .. option:: --help
  38. Display usage information and exit. Does not stack with other commands.
  39. .. option:: -p, --private-headers
  40. Display format-specific file headers.
  41. .. option:: -r, --reloc
  42. Display the relocation entries in the file.
  43. .. option:: -R, --dynamic-reloc
  44. Display the dynamic relocation entries in the file.
  45. .. option:: --raw-clang-ast
  46. Dump the raw binary contents of the clang AST section.
  47. .. option:: -s, --full-contents
  48. Display the contents of each section.
  49. .. option:: -t, --syms
  50. Display the symbol table.
  51. .. option:: -u, --unwind-info
  52. Display the unwind info of the input(s).
  53. .. option:: --version
  54. Display the version of the :program:`llvm-objdump` executable. Does not stack
  55. with other commands.
  56. .. option:: -x, --all-headers
  57. Display all available header information. Equivalent to specifying
  58. :option:`--archive-headers`, :option:`--file-headers`,
  59. :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`,
  60. and :option:`--syms`.
  61. OPTIONS
  62. -------
  63. :program:`llvm-objdump` supports the following options:
  64. .. option:: --adjust-vma=<offset>
  65. Increase the displayed address in disassembly or section header printing by
  66. the specified offset.
  67. .. option:: --arch-name=<string>
  68. Specify the target architecture when disassembling. Use :option:`--version`
  69. for a list of available targets.
  70. .. option:: -C, --demangle
  71. Demangle symbol names in the output.
  72. .. option:: -j, --section=<section1[,section2,...]>
  73. Perform commands on the specified sections only. For Mach-O use
  74. `segment,section` to specify the section name.
  75. .. option:: -l, --line-numbers
  76. When disassembling, display source line numbers. Implies
  77. :option:`--disassemble`.
  78. .. option:: -M, --disassembler-options=<opt1[,opt2,...]>
  79. Pass target-specific disassembler options. Currently supported for ARM targets
  80. only. Available options are ``reg-names-std`` and ``reg-names-raw``.
  81. .. option:: --mcpu=<cpu-name>
  82. Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display
  83. available CPUs.
  84. .. option:: --mattr=<a1,+a2,-a3,...>
  85. Enable/disable target-specific attributes. Specify ``--mcpu=help`` to display
  86. the available attributes.
  87. .. option:: --no-leading-addr
  88. When disassembling, do not print leading addresses.
  89. .. option:: --no-show-raw-insn
  90. When disassembling, do not print the raw bytes of each instruction.
  91. .. option:: --print-imm-hex
  92. Use hex format when printing immediate values in disassembly output.
  93. .. option:: -S, --source
  94. When disassembling, display source interleaved with the disassembly. Implies
  95. :option:`--disassemble`.
  96. .. option:: --show-lma
  97. Display the LMA column when dumping ELF section headers. Defaults to off
  98. unless any section has different VMA and LMAs.
  99. .. option:: --start-address=<address>
  100. When disassembling, only disassemble from the specified address.
  101. When printing relocations, only print the relocations patching offsets from at least ``address``.
  102. When printing symbols, only print symbols with a value of at least ``address``.
  103. .. option:: --stop-address=<address>
  104. When disassembling, only disassemble up to, but not including the specified address.
  105. When printing relocations, only print the relocations patching offsets up to ``address``.
  106. When printing symbols, only print symbols with a value up to ``address``.
  107. .. option:: --triple=<string>
  108. Target triple to disassemble for, see ``--version`` for available targets.
  109. .. option:: -w, --wide
  110. Ignored for compatibility with GNU objdump.
  111. .. option:: --x86-asm-syntax=<style>
  112. When used with :option:`--disassemble`, choose style of code to emit from
  113. X86 backend. Supported values are:
  114. .. option:: att
  115. AT&T-style assembly
  116. .. option:: intel
  117. Intel-style assembly
  118. The default disassembly style is **att**.
  119. .. option:: -z, --disassemble-zeroes
  120. Do not skip blocks of zeroes when disassembling.
  121. .. option:: @<FILE>
  122. Read command-line options and commands from response file `<FILE>`.
  123. MACH-O ONLY OPTIONS AND COMMANDS
  124. --------------------------------
  125. .. option:: --arch=<architecture>
  126. Specify the architecture to disassemble. see ``--version`` for available
  127. architectures.
  128. .. option:: --archive-member-offsets
  129. Print the offset to each archive member for Mach-O archives (requires
  130. :option:`--archive-headers`).
  131. .. option:: --bind
  132. Display binding info
  133. .. option:: --cfg
  134. Create a CFG for every symbol in the object file and write it to a graphviz
  135. file.
  136. .. option:: --data-in-code
  137. Display the data in code table.
  138. .. option:: --dis-symname=<name>
  139. Disassemble just the specified symbol's instructions.
  140. .. option:: --dylibs-used
  141. Display the shared libraries used for linked files.
  142. .. option:: --dsym=<string>
  143. Use .dSYM file for debug info.
  144. .. option:: --dylib-id
  145. Display the shared library's ID for dylib files.
  146. .. option:: --exports-trie
  147. Display exported symbols.
  148. .. option:: -g
  149. Print line information from debug info if available.
  150. .. option:: --full-leading-addr
  151. Print the full leading address when disassembling.
  152. .. option:: --indirect-symbols
  153. Display the indirect symbol table.
  154. .. option:: --info-plist
  155. Display the info plist section as strings.
  156. .. option:: --lazy-bind
  157. Display lazy binding info.
  158. .. option:: --link-opt-hints
  159. Display the linker optimization hints.
  160. .. option:: -m, --macho
  161. Use Mach-O specific object file parser. Commands and other options may behave
  162. differently when used with ``--macho``.
  163. .. option:: --no-leading-headers
  164. Do not print any leading headers.
  165. .. option:: --no-symbolic-operands
  166. Do not print symbolic operands when disassembling.
  167. .. option:: --non-verbose
  168. Display the information for Mach-O objects in non-verbose or numeric form.
  169. .. option:: --objc-meta-data
  170. Display the Objective-C runtime meta data.
  171. .. option:: --private-header
  172. Display only the first format specific file header.
  173. .. option:: --rebase
  174. Display rebasing information.
  175. .. option:: --universal-headers
  176. Display universal headers.
  177. .. option:: --weak-bind
  178. Display weak binding information.
  179. BUGS
  180. ----
  181. To report bugs, please visit <http://llvm.org/bugs/>.
  182. SEE ALSO
  183. --------
  184. :manpage:`llvm-nm(1)`, :manpage:`llvm-readelf(1)`, :manpage:`llvm-readobj(1)`