llvm-readobj.rst 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. llvm-readobj - LLVM Object Reader
  2. =================================
  3. .. program:: llvm-readobj
  4. SYNOPSIS
  5. --------
  6. :program:`llvm-readobj` [*options*] [*input...*]
  7. DESCRIPTION
  8. -----------
  9. The :program:`llvm-readobj` tool displays low-level format-specific information
  10. about one or more object files.
  11. If ``input`` is "``-``" or omitted, :program:`llvm-readobj` reads from standard
  12. input. Otherwise, it will read from the specified ``filenames``.
  13. DIFFERENCES TO LLVM-READELF
  14. ---------------------------
  15. :program:`llvm-readelf` is an alias for the :manpage:`llvm-readobj` tool with a
  16. slightly different command-line interface and output that is GNU compatible.
  17. Following is a list of differences between :program:`llvm-readelf` and
  18. :program:`llvm-readobj`:
  19. - :program:`llvm-readelf` uses `GNU` for the :option:`--elf-output-style` option
  20. by default. :program:`llvm-readobj` uses `LLVM`.
  21. - :program:`llvm-readelf` allows single-letter grouped flags (e.g.
  22. ``llvm-readelf -SW`` is the same as ``llvm-readelf -S -W``).
  23. :program:`llvm-readobj` does not allow grouping.
  24. - :program:`llvm-readelf` provides :option:`-s` as an alias for
  25. :option:`--symbols`, for GNU :program:`readelf` compatibility, whereas it is
  26. an alias for :option:`--section-headers` in :program:`llvm-readobj`.
  27. - :program:`llvm-readobj` provides ``-t`` as an alias for :option:`--symbols`.
  28. :program:`llvm-readelf` does not.
  29. - :program:`llvm-readobj` provides ``--sr``, ``--sd``, ``--st`` and ``--dt`` as
  30. aliases for :option:`--section-relocations`, :option:`--section-data`,
  31. :option:`--section-symbols` and :option:`--dyn-symbols` respectively.
  32. :program:`llvm-readelf` does not provide these aliases, to avoid conflicting
  33. with grouped flags.
  34. GENERAL AND MULTI-FORMAT OPTIONS
  35. --------------------------------
  36. These options are applicable to more than one file format, or are unrelated to
  37. file formats.
  38. .. option:: --all
  39. Equivalent to specifying all the main display options relevant to the file
  40. format.
  41. .. option:: --addrsig
  42. Display the address-significance table.
  43. .. option:: --color
  44. Use colors in the output for warnings and errors.
  45. .. option:: --expand-relocs
  46. When used with :option:`--relocations`, display each relocation in an expanded
  47. multi-line format.
  48. .. option:: --file-headers, -h
  49. Display file headers.
  50. .. option:: --headers, -e
  51. Equivalent to setting: :option:`--file-headers`, :option:`--program-headers`,
  52. and :option:`--sections`.
  53. .. option:: --help
  54. Display a summary of command line options.
  55. .. option:: --help-list
  56. Display an uncategorized summary of command line options.
  57. .. option:: --hex-dump=<section[,section,...]>, -x
  58. Display the specified section(s) as hexadecimal bytes. ``section`` may be a
  59. section index or section name.
  60. .. option:: --needed-libs
  61. Display the needed libraries.
  62. .. option:: --relocations, --relocs, -r
  63. Display the relocation entries in the file.
  64. .. option:: --sections, --section-headers, -s, -S
  65. Display all sections.
  66. .. option:: --section-data, --sd
  67. When used with :option:`--sections`, display section data for each section
  68. shown. This option has no effect for GNU style output.
  69. .. option:: --section-relocations, --sr
  70. When used with :option:`--sections`, display relocations for each section
  71. shown. This option has no effect for GNU style output.
  72. .. option:: --section-symbols, --st
  73. When used with :option:`--sections`, display symbols for each section shown.
  74. This option has no effect for GNU style output.
  75. .. option:: --stackmap
  76. Display contents of the stackmap section.
  77. .. option:: --string-dump=<section[,section,...]>, -p
  78. Display the specified section(s) as a list of strings. ``section`` may be a
  79. section index or section name.
  80. .. option:: --symbols, --syms, -t
  81. Display the symbol table.
  82. .. option:: --unwind, -u
  83. Display unwind information.
  84. .. option:: --version
  85. Display the version of the :program:`llvm-readobj` executable.
  86. .. option:: @<FILE>
  87. Read command-line options from response file `<FILE>`.
  88. ELF SPECIFIC OPTIONS
  89. --------------------
  90. The following options are implemented only for the ELF file format.
  91. .. option:: --arch-specific, -A
  92. Display architecture-specific information, e.g. the ARM attributes section on ARM.
  93. .. option:: --demangle, -C
  94. Display demangled symbol names in the output.
  95. .. option:: --dyn-relocations
  96. Display the dynamic relocation entries.
  97. .. option:: --dyn-symbols, --dyn-syms, --dt
  98. Display the dynamic symbol table.
  99. .. option:: --dynamic-table, --dynamic, -d
  100. Display the dynamic table.
  101. .. option:: --elf-cg-profile
  102. Display the callgraph profile section.
  103. .. option:: --elf-hash-histogram, --histogram, -I
  104. Display a bucket list histogram for dynamic symbol hash tables.
  105. .. option:: --elf-linker-options
  106. Display the linker options section.
  107. .. option:: --elf-output-style=<value>
  108. Format ELF information in the specified style. Valid options are ``LLVM`` and
  109. ``GNU``. ``LLVM`` output (the default) is an expanded and structured format,
  110. whilst ``GNU`` output mimics the equivalent GNU :program:`readelf` output.
  111. .. option:: --elf-section-groups, --section-groups, -g
  112. Display section groups.
  113. .. option:: --gnu-hash-table
  114. Display the GNU hash table for dynamic symbols.
  115. .. option:: --hash-symbols
  116. Display the expanded hash table with dynamic symbol data.
  117. .. option:: --hash-table
  118. Display the hash table for dynamic symbols.
  119. .. option:: --notes, -n
  120. Display all notes.
  121. .. option:: --program-headers, --segments, -l
  122. Display the program headers.
  123. .. option:: --raw-relr
  124. Do not decode relocations in RELR relocation sections when displaying them.
  125. .. option:: --section-mapping
  126. Display the section to segment mapping.
  127. .. option:: --stack-sizes
  128. Display the contents of the stack sizes section(s), i.e. pairs of function
  129. names and the size of their stack frames. Currently only implemented for GNU
  130. style output.
  131. .. option:: --version-info, -V
  132. Display version sections.
  133. MACH-O SPECIFIC OPTIONS
  134. -----------------------
  135. The following options are implemented only for the Mach-O file format.
  136. .. option:: --macho-data-in-code
  137. Display the Data in Code command.
  138. .. option:: --macho-dsymtab
  139. Display the Dsymtab command.
  140. .. option:: --macho-indirect-symbols
  141. Display indirect symbols.
  142. .. option:: --macho-linker-options
  143. Display the Mach-O-specific linker options.
  144. .. option:: --macho-segment
  145. Display the Segment command.
  146. .. option:: --macho-version-min
  147. Display the version min command.
  148. PE/COFF SPECIFIC OPTIONS
  149. ------------------------
  150. The following options are implemented only for the PE/COFF file format.
  151. .. option:: --codeview
  152. Display CodeView debug information.
  153. .. option:: --codeview-ghash
  154. Enable global hashing for CodeView type stream de-duplication.
  155. .. option:: --codeview-merged-types
  156. Display the merged CodeView type stream.
  157. .. option:: --codeview-subsection-bytes
  158. Dump raw contents of CodeView debug sections and records.
  159. .. option:: --coff-basereloc
  160. Display the .reloc section.
  161. .. option:: --coff-debug-directory
  162. Display the debug directory.
  163. .. option:: --coff-directives
  164. Display the .drectve section.
  165. .. option:: --coff-exports
  166. Display the export table.
  167. .. option:: --coff-imports
  168. Display the import table.
  169. .. option:: --coff-load-config
  170. Display the load config.
  171. .. option:: --coff-resources
  172. Display the .rsrc section.
  173. EXIT STATUS
  174. -----------
  175. :program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero
  176. exit code if there were any errors.
  177. SEE ALSO
  178. --------
  179. :manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`