llvm-objdump.rst 7.9 KB

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