llvm-objdump.rst 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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. Display assembler mnemonics for the machine instructions. Disassembles all
  22. text sections found in the input file(s) by default.
  23. .. option:: -D, --disassemble-all
  24. Display assembler mnemonics for the machine instructions. Disassembles all
  25. sections found in the input file(s) by default.
  26. .. option:: --disassemble-functions=<func1[,func2,...]>
  27. Disassemble only the specified symbols. 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 this program. Does not stack with other commands.
  55. .. option:: -x, --all-headers
  56. Display all available header information. Equivalent to specifying
  57. :option:`--archive-headers`, :option:`--file-headers`,
  58. :option:`--private-headers`, :option:`--reloc`, :option:`--section-headers`,
  59. and :option:`--syms`.
  60. OPTIONS
  61. -------
  62. :program:`llvm-objdump` supports the following options:
  63. .. option:: --adjust-vma=<offset>
  64. Increase the displayed address in disassembly or section header printing by
  65. the specified offset.
  66. .. option:: --arch-name=<string>
  67. Specify the target architecture when disassembling. Use :option:``--version``
  68. for a list of available targets.
  69. .. option:: -C, --demangle
  70. Demangle symbol names in the output.
  71. .. option:: -j, --section=<section1[,section2,...]>
  72. Perform the specified command(s) on the specified section(s) only. For Mach-O
  73. use `segment,section` to specify the section name.
  74. .. option:: -l, --line-numbers
  75. When disassembling, display source line numbers with disassembly. Implies
  76. :option:`--disassemble`.
  77. .. option:: -M, --disassembler-options=<opt1[,opt2,...]>
  78. Pass target-specific disassembler options. Currently supported for ARM targets
  79. only. Available options are ``reg-names-std`` and ``reg-names-raw``.
  80. .. option:: --mcpu=<cpu-name>
  81. Target a specific CPU type for disassembly. Specify ``--mcpu=help`` to display
  82. available CPUs.
  83. .. option:: --mattr=<a1,+a2,-a3,...>
  84. Enable/disable target-specific attributes. Specify ``--mcpu=help`` to display
  85. the available attributes.
  86. .. option:: --no-leading-addr
  87. When disassembling, do not print the leading address in the disassembly
  88. output.
  89. .. option:: --no-show-raw-insn
  90. When disassembling instructions, do not print the raw bytes of the
  91. instruction.
  92. .. option:: --print-imm-hex
  93. Use hex format when printing immediate values in disassembly output.
  94. .. option:: -S, --source
  95. When disassembling, display source inlined with the disassembly.
  96. Implies :option:`--disassemble`.
  97. .. option:: --show-lma
  98. Display the LMA column when dumping ELF section headers. Defaults to off
  99. unless any section has different VMA and LMAs.
  100. .. option:: --start-address=<address>
  101. When disassembling, only disassemble from the specified address.
  102. When printing relocations, only print the relocations patching offsets from at least ``address``.
  103. When printing symbols, only print symbols with a value of at least ``address``.
  104. .. option:: --stop-address=<address>
  105. When disassembling, only disassemble up to, but not including the specified address.
  106. When printing relocations, only print the relocations patching offsets up to ``address``.
  107. When printing symbols, only print symbols with a value up to ``address``.
  108. .. option:: --triple=<string>
  109. Target triple to disassemble for, see ``--version`` for available targets.
  110. .. option:: -w, --wide
  111. Ignored for compatibility with GNU objdump.
  112. .. option:: --x86-asm-syntax=<style>
  113. When used with the ``--disassemble`` option, choose style of code to emit from
  114. X86 backend. Supported values are:
  115. .. option:: att
  116. AT&T-style assembly
  117. .. option:: intel
  118. Intel-style assembly
  119. The default disassembly style is **att**.
  120. .. option:: -z, --disassemble-zeroes
  121. Do not skip blocks of zeroes when disassembling.
  122. .. option:: @<FILE>
  123. Read command-line options and commands from response file `<FILE>`.
  124. MACH-O ONLY OPTIONS AND COMMANDS
  125. --------------------------------
  126. .. option:: --arch=<architecture>
  127. Specify the architecture to disassemble. see ``--version`` for available
  128. architectures.
  129. .. option:: --archive-member-offsets
  130. Print the offset to each archive member for Mach-O archives (requires
  131. :option:`--archive-headers`).
  132. .. option:: --bind
  133. Display binding info
  134. .. option:: --cfg
  135. Create a CFG for every symbol in the object file and write it to a graphviz
  136. file.
  137. .. option:: --data-in-code
  138. Display the data in code table.
  139. .. option:: --dis-symname=<name>
  140. Disassemble just the specified symbol's instructions.
  141. .. option:: --dylibs-used
  142. Display the shared libraries used for linked files.
  143. .. option:: --dsym=<string>
  144. Use .dSYM file for debug info.
  145. .. option:: --dylib-id
  146. Display the shared library's ID for dylib files.
  147. .. option:: --exports-trie
  148. Display exported symbols.
  149. .. option:: -g
  150. Print line information from debug info if available.
  151. .. option:: --full-leading-addr
  152. Print the full leading address when disassembling.
  153. .. option:: --indirect-symbols
  154. Display the indirect symbol table.
  155. .. option:: --info-plist
  156. Display the info plist section as strings.
  157. .. option:: --lazy-bind
  158. Display lazy binding info.
  159. .. option:: --link-opt-hints
  160. Display the linker optimization hints.
  161. .. option:: -m, --macho
  162. Use Mach-O specific object file parser. Commands and other options may behave
  163. differently when used with ``--macho``.
  164. .. option:: --no-leading-headers
  165. Do not print any leading headers.
  166. .. option:: --no-symbolic-operands
  167. Do not print symbolic operands when disassembling.
  168. .. option:: --non-verbose
  169. Display the information for Mach-O objects in non-verbose or numeric form.
  170. .. option:: --objc-meta-data
  171. Display the Objective-C runtime meta data.
  172. .. option:: --private-header
  173. Display only the first format specific file header.
  174. .. option:: --rebase
  175. Display rebasing information.
  176. .. option:: --universal-headers
  177. Display universal headers.
  178. .. option:: --weak-bind
  179. Display weak binding information.
  180. BUGS
  181. ----
  182. To report bugs, please visit <http://llvm.org/bugs/>.
  183. SEE ALSO
  184. --------
  185. :manpage:`llvm-nm(1)`, :manpage:`llvm-readelf(1)`, :manpage:`llvm-readobj(1)`