2013-04-11 08:05:57 +08:00
|
|
|
llvm-readobj - LLVM Object Reader
|
|
|
|
=================================
|
|
|
|
|
[docs][tools] Add missing "program" tags to rst files
Sphinx allows for definitions of command-line options using
`.. option <name>` and references to those options via `:option:<name>`.
However, it looks like there is no scoping of these options by default,
meaning that links can end up pointing to incorrect documents. See for
example the llvm-mca document, which contains references to -o that,
prior to this patch, pointed to a different document. What's worse is
that these links appear to be non-deterministic in which one is picked
(on my machine, some references end up pointing to opt, whereas on the
live docs, they point to llvm-dwarfdump, for example).
The fix is to add the .. program <name> tag. This essentially namespaces
the options (definitions and references) to the named program, ensuring
that the links are kept correct.
Reviwed by: andreadb
Differential Revision: https://reviews.llvm.org/D63873
llvm-svn: 364538
2019-06-27 21:24:46 +08:00
|
|
|
.. program:: llvm-readobj
|
|
|
|
|
2013-04-11 08:05:57 +08:00
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
|
|
|
|
:program:`llvm-readobj` [*options*] [*input...*]
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
|
|
|
The :program:`llvm-readobj` tool displays low-level format-specific information
|
2019-06-25 21:12:38 +08:00
|
|
|
about one or more object files.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2020-07-20 15:47:11 +08:00
|
|
|
If ``input`` is "``-``", :program:`llvm-readobj` reads from standard
|
2013-04-11 08:05:57 +08:00
|
|
|
input. Otherwise, it will read from the specified ``filenames``.
|
|
|
|
|
2019-07-02 00:18:57 +08:00
|
|
|
DIFFERENCES TO LLVM-READELF
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
:program:`llvm-readelf` is an alias for the :manpage:`llvm-readobj` tool with a
|
|
|
|
slightly different command-line interface and output that is GNU compatible.
|
|
|
|
Following is a list of differences between :program:`llvm-readelf` and
|
|
|
|
:program:`llvm-readobj`:
|
|
|
|
|
|
|
|
- :program:`llvm-readelf` uses `GNU` for the :option:`--elf-output-style` option
|
|
|
|
by default. :program:`llvm-readobj` uses `LLVM`.
|
|
|
|
- :program:`llvm-readelf` allows single-letter grouped flags (e.g.
|
|
|
|
``llvm-readelf -SW`` is the same as ``llvm-readelf -S -W``).
|
|
|
|
:program:`llvm-readobj` does not allow grouping.
|
|
|
|
- :program:`llvm-readelf` provides :option:`-s` as an alias for
|
|
|
|
:option:`--symbols`, for GNU :program:`readelf` compatibility, whereas it is
|
|
|
|
an alias for :option:`--section-headers` in :program:`llvm-readobj`.
|
|
|
|
- :program:`llvm-readobj` provides ``-t`` as an alias for :option:`--symbols`.
|
|
|
|
:program:`llvm-readelf` does not.
|
|
|
|
- :program:`llvm-readobj` provides ``--sr``, ``--sd``, ``--st`` and ``--dt`` as
|
|
|
|
aliases for :option:`--section-relocations`, :option:`--section-data`,
|
|
|
|
:option:`--section-symbols` and :option:`--dyn-symbols` respectively.
|
|
|
|
:program:`llvm-readelf` does not provide these aliases, to avoid conflicting
|
|
|
|
with grouped flags.
|
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
GENERAL AND MULTI-FORMAT OPTIONS
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
These options are applicable to more than one file format, or are unrelated to
|
|
|
|
file formats.
|
|
|
|
|
|
|
|
.. option:: --all
|
|
|
|
|
|
|
|
Equivalent to specifying all the main display options relevant to the file
|
|
|
|
format.
|
|
|
|
|
|
|
|
.. option:: --addrsig
|
|
|
|
|
|
|
|
Display the address-significance table.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --color
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Use colors in the output for warnings and errors.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --expand-relocs
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
When used with :option:`--relocations`, display each relocation in an expanded
|
|
|
|
multi-line format.
|
|
|
|
|
|
|
|
.. option:: --file-headers, -h
|
2013-04-11 08:05:57 +08:00
|
|
|
|
|
|
|
Display file headers.
|
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --headers, -e
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Equivalent to setting: :option:`--file-headers`, :option:`--program-headers`,
|
|
|
|
and :option:`--sections`.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --help
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Display a summary of command line options.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --help-list
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Display an uncategorized summary of command line options.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --hex-dump=<section[,section,...]>, -x
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Display the specified section(s) as hexadecimal bytes. ``section`` may be a
|
|
|
|
section index or section name.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --needed-libs
|
|
|
|
|
|
|
|
Display the needed libraries.
|
|
|
|
|
|
|
|
.. option:: --relocations, --relocs, -r
|
2013-04-11 08:05:57 +08:00
|
|
|
|
|
|
|
Display the relocation entries in the file.
|
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --sections, --section-headers, -s, -S
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Display all sections.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --section-data, --sd
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-07-06 00:38:52 +08:00
|
|
|
When used with :option:`--sections`, display section data for each section
|
|
|
|
shown. This option has no effect for GNU style output.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --section-relocations, --sr
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-07-06 00:38:52 +08:00
|
|
|
When used with :option:`--sections`, display relocations for each section
|
|
|
|
shown. This option has no effect for GNU style output.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --section-symbols, --st
|
2013-04-12 12:01:52 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
When used with :option:`--sections`, display symbols for each section shown.
|
2019-07-06 00:38:52 +08:00
|
|
|
This option has no effect for GNU style output.
|
2013-04-12 12:01:52 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --stackmap
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Display contents of the stackmap section.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --string-dump=<section[,section,...]>, -p
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Display the specified section(s) as a list of strings. ``section`` may be a
|
|
|
|
section index or section name.
|
2013-04-11 08:05:57 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --symbols, --syms, -t
|
2013-04-12 12:07:39 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Display the symbol table.
|
2013-04-12 12:07:39 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --unwind, -u
|
2016-01-27 03:46:39 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
Display unwind information.
|
2016-01-27 03:46:39 +08:00
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --version
|
2019-01-17 23:34:12 +08:00
|
|
|
|
2019-09-17 19:43:42 +08:00
|
|
|
Display the version of the :program:`llvm-readobj` executable.
|
2019-01-17 23:34:12 +08:00
|
|
|
|
2019-06-21 19:49:20 +08:00
|
|
|
.. option:: @<FILE>
|
|
|
|
|
|
|
|
Read command-line options from response file `<FILE>`.
|
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
ELF SPECIFIC OPTIONS
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
The following options are implemented only for the ELF file format.
|
|
|
|
|
2019-10-01 09:31:15 +08:00
|
|
|
.. option:: --arch-specific, -A
|
2019-06-25 21:12:38 +08:00
|
|
|
|
2019-10-01 09:31:15 +08:00
|
|
|
Display architecture-specific information, e.g. the ARM attributes section on ARM.
|
2019-06-25 21:12:38 +08:00
|
|
|
|
|
|
|
.. option:: --demangle, -C
|
|
|
|
|
|
|
|
Display demangled symbol names in the output.
|
|
|
|
|
2019-11-25 21:04:58 +08:00
|
|
|
.. option:: --dependent-libraries
|
|
|
|
|
|
|
|
Display the dependent libraries section.
|
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --dyn-relocations
|
|
|
|
|
|
|
|
Display the dynamic relocation entries.
|
|
|
|
|
|
|
|
.. option:: --dyn-symbols, --dyn-syms, --dt
|
|
|
|
|
|
|
|
Display the dynamic symbol table.
|
|
|
|
|
|
|
|
.. option:: --dynamic-table, --dynamic, -d
|
|
|
|
|
|
|
|
Display the dynamic table.
|
|
|
|
|
2020-06-16 01:21:47 +08:00
|
|
|
.. option:: --cg-profile
|
2019-06-25 21:12:38 +08:00
|
|
|
|
|
|
|
Display the callgraph profile section.
|
|
|
|
|
|
|
|
.. option:: --elf-hash-histogram, --histogram, -I
|
|
|
|
|
|
|
|
Display a bucket list histogram for dynamic symbol hash tables.
|
|
|
|
|
|
|
|
.. option:: --elf-linker-options
|
|
|
|
|
|
|
|
Display the linker options section.
|
|
|
|
|
|
|
|
.. option:: --elf-output-style=<value>
|
|
|
|
|
2019-07-08 23:46:26 +08:00
|
|
|
Format ELF information in the specified style. Valid options are ``LLVM`` and
|
2019-06-25 21:12:38 +08:00
|
|
|
``GNU``. ``LLVM`` output (the default) is an expanded and structured format,
|
|
|
|
whilst ``GNU`` output mimics the equivalent GNU :program:`readelf` output.
|
|
|
|
|
|
|
|
.. option:: --elf-section-groups, --section-groups, -g
|
|
|
|
|
|
|
|
Display section groups.
|
|
|
|
|
|
|
|
.. option:: --gnu-hash-table
|
|
|
|
|
|
|
|
Display the GNU hash table for dynamic symbols.
|
|
|
|
|
|
|
|
.. option:: --hash-symbols
|
|
|
|
|
2019-07-08 23:46:26 +08:00
|
|
|
Display the expanded hash table with dynamic symbol data.
|
2019-06-25 21:12:38 +08:00
|
|
|
|
|
|
|
.. option:: --hash-table
|
|
|
|
|
|
|
|
Display the hash table for dynamic symbols.
|
|
|
|
|
|
|
|
.. option:: --notes, -n
|
|
|
|
|
|
|
|
Display all notes.
|
|
|
|
|
|
|
|
.. option:: --program-headers, --segments, -l
|
|
|
|
|
|
|
|
Display the program headers.
|
|
|
|
|
|
|
|
.. option:: --raw-relr
|
|
|
|
|
|
|
|
Do not decode relocations in RELR relocation sections when displaying them.
|
|
|
|
|
|
|
|
.. option:: --section-mapping
|
|
|
|
|
|
|
|
Display the section to segment mapping.
|
|
|
|
|
2019-09-13 23:01:39 +08:00
|
|
|
.. option:: --stack-sizes
|
|
|
|
|
|
|
|
Display the contents of the stack sizes section(s), i.e. pairs of function
|
|
|
|
names and the size of their stack frames. Currently only implemented for GNU
|
|
|
|
style output.
|
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --version-info, -V
|
|
|
|
|
|
|
|
Display version sections.
|
|
|
|
|
|
|
|
MACH-O SPECIFIC OPTIONS
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
The following options are implemented only for the Mach-O file format.
|
|
|
|
|
|
|
|
.. option:: --macho-data-in-code
|
|
|
|
|
|
|
|
Display the Data in Code command.
|
|
|
|
|
|
|
|
.. option:: --macho-dsymtab
|
|
|
|
|
|
|
|
Display the Dsymtab command.
|
|
|
|
|
|
|
|
.. option:: --macho-indirect-symbols
|
|
|
|
|
|
|
|
Display indirect symbols.
|
|
|
|
|
|
|
|
.. option:: --macho-linker-options
|
|
|
|
|
|
|
|
Display the Mach-O-specific linker options.
|
|
|
|
|
|
|
|
.. option:: --macho-segment
|
|
|
|
|
|
|
|
Display the Segment command.
|
|
|
|
|
|
|
|
.. option:: --macho-version-min
|
|
|
|
|
|
|
|
Display the version min command.
|
|
|
|
|
|
|
|
PE/COFF SPECIFIC OPTIONS
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
The following options are implemented only for the PE/COFF file format.
|
|
|
|
|
|
|
|
.. option:: --codeview
|
|
|
|
|
|
|
|
Display CodeView debug information.
|
|
|
|
|
|
|
|
.. option:: --codeview-ghash
|
|
|
|
|
|
|
|
Enable global hashing for CodeView type stream de-duplication.
|
|
|
|
|
|
|
|
.. option:: --codeview-merged-types
|
|
|
|
|
|
|
|
Display the merged CodeView type stream.
|
|
|
|
|
|
|
|
.. option:: --codeview-subsection-bytes
|
|
|
|
|
|
|
|
Dump raw contents of CodeView debug sections and records.
|
|
|
|
|
|
|
|
.. option:: --coff-basereloc
|
|
|
|
|
|
|
|
Display the .reloc section.
|
|
|
|
|
|
|
|
.. option:: --coff-debug-directory
|
|
|
|
|
|
|
|
Display the debug directory.
|
|
|
|
|
2020-10-08 16:43:50 +08:00
|
|
|
.. option:: --coff-tls-directory
|
|
|
|
|
|
|
|
Display the TLS directory.
|
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
.. option:: --coff-directives
|
|
|
|
|
|
|
|
Display the .drectve section.
|
|
|
|
|
|
|
|
.. option:: --coff-exports
|
|
|
|
|
|
|
|
Display the export table.
|
|
|
|
|
|
|
|
.. option:: --coff-imports
|
|
|
|
|
|
|
|
Display the import table.
|
|
|
|
|
|
|
|
.. option:: --coff-load-config
|
|
|
|
|
|
|
|
Display the load config.
|
|
|
|
|
|
|
|
.. option:: --coff-resources
|
|
|
|
|
|
|
|
Display the .rsrc section.
|
|
|
|
|
2013-04-11 08:05:57 +08:00
|
|
|
EXIT STATUS
|
|
|
|
-----------
|
|
|
|
|
2019-06-25 21:12:38 +08:00
|
|
|
:program:`llvm-readobj` returns 0 under normal operation. It returns a non-zero
|
|
|
|
exit code if there were any errors.
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
|
|
|
|
:manpage:`llvm-nm(1)`, :manpage:`llvm-objdump(1)`, :manpage:`llvm-readelf(1)`
|