summaryrefslogtreecommitdiff
path: root/llvm/docs/CommandGuide/llvm-readobj.rst
AgeCommit message (Collapse)Author
2025-09-29Add --offoading option to llvm-readobj (#143342)David Salinas
Utilize new extensions to LLVM Offloading API to handle offloading fatbin Bundles. The tool will output a list of available offload bundles using URI syntax. --------- Co-authored-by: dsalinas_amdeng <david.salinas@amd.com>
2024-04-22[llvm-readobj] Remove --raw-relrFangrui Song
https://reviews.llvm.org/D47919 dumped RELR relocations as `R_*_RELATIVE` and added --raw-relr (not in GNU) for testing purposes (more readable than `llvm-readelf -x .relr.dyn`). The option is obsolete after `llvm-readelf -r` output gets improved (#89162). Since --raw-relr never seems to get more adoption. Let's remove it to avoid some complexity. Pull Request: https://github.com/llvm/llvm-project/pull/89426
2024-03-01[llvm-readobj] enable demangle option for the xcoff object file (#78455)zhijian lin
enable `--demangle` option for the xcoff object file for llvm-readobj
2024-02-27[SHT_LLVM_BB_ADDR_MAP] Adds pretty printing of BFI and BPI for PGO Analysis ↵Micah Weston
Map in tools. (#82292) Primary change is to add a flag `--pretty-pgo-analysis-map` to llvm-readobj and llvm-objdump that prints block frequencies and branch probabilities in the same manner as BFI and BPI respectively. This can be helpful if you are manually inspecting the outputs from the tools. In order to print, I moved the `printBlockFreqImpl` function from Analysis to Support and renamed it to `printRelativeBlockFreq`.
2024-02-22[llvm-readobj,ELF] Support --decompress/-z (#82594)Fangrui Song
When a section has the SHF_COMPRESSED flag, -p/-x dump the compressed content by default. In GNU readelf, if --decompress/-z is specified, -p/-x will dump the decompressed content. This patch implements the option. Close #82507
2023-03-01[llvm-readobj] Add --memtagMitch Phillips
This adds functionality to readelf/readobj to specifically handle MTE-related bits, like the AARCH64_MEMTAG_* dynamic entries, and a decoder for the Android-specific ELF note. Reviewed By: jhenderson, MaskRay Differential Revision: https://reviews.llvm.org/D143693
2022-12-14[XCOFF] Decode the relocation entries of loader section of xcoff for ↵zhijian
llvm-readobj Summary: support decoding the relocation entries of loader section of xcoff for llvm-readobj https://www.ibm.com/docs/en/aix/7.2?topic=formats-xcoff-object-file-format#XCOFF__vra3i31ejbau Reviewers: James Henderson, Esme Yi Differential Revision: https://reviews.llvm.org/D136787
2022-11-21[XCOFF] llvm-readobj support display symbol table of loader section of xcoff ↵zhijian
object file. Reviewers: James Henderson, Esme Yi Differential Revision: https://reviews.llvm.org/D135887
2022-11-19Revert "[XCOFF] llvvm-readobj support display symbol table of loader section ↵Vitaly Buka
of xcoff object file." Use of uninitialized value. This reverts commit 037f5c283a2278ef156189be48db0738323206bd.
2022-11-18[XCOFF] llvvm-readobj support display symbol table of loader section of ↵zhijian
xcoff object file. Reviewers: James Henderson, Esme Yi Differential Revision: https://reviews.llvm.org/D135887
2022-10-24[XCOFF] llvm-readobj support decoding the loader section header field for ↵zhijian
XCOFF object file. Reviewers: James Henderson, Esme Yi Differential Revision: https://reviews.llvm.org/D134883
2022-09-19[AIX] llvm-readobj support a new option --exception-section for xcoff object ↵zhijian
file. Summary: llvm-readobj support a new option --exception-section for xcoff object file. https://www.ibm.com/docs/en/aix/7.2?topic=formats-xcoff-object-file-format#XCOFF__iua3i23ajbau Reviewers: James Henderson,Paul Scoropan Differential Revision: https://reviews.llvm.org/D133030
2022-03-31Reland "[llvm-readobj][MachO] Add option to sort the symbol table before ↵Vy Nguyen
dumping (MachO only, for now)." https://reviews.llvm.org/D116787 This reverts commit 33b3c86afab06ad61d46456c85c0b565cfff8287. New change: fixed build failures: - in stabs-sorted:restore the the ERR-KEY statements, which were accidentally deleted during refactoring - in ObjDumper.h/MachODumper.cpp: refactor so that current dumpers which didn't provide an impl that accept a SymCom still works
2022-03-31Revert "[llvm-readobj][MachO] Add option to sort the symbol table before ↵Vy Nguyen
dumping (MachO only, for now)." This reverts commit ea9cf2dc96c765773ee574a9189d529175a57751. Broke LLDB - reverting to investigage
2022-03-31[llvm-readobj][MachO] Add option to sort the symbol table before dumping ↵Vy Nguyen
(MachO only, for now). This would help making tests less brittle as the order will be fixed. (see also PR/53026) Differential Revision: https://reviews.llvm.org/D116787
2021-12-10[llvm-readobj] Add JSONScopedPrinter to llvm-readelfJayson Yan
Adds JSONScopedPrinter to llvm-readelf. It includes an empty JSONELFDumper class which will be used to override any LLVMELFDumper methods which utilize startLine() which JSONScopedPrinter cannot provide. This introduces a change where calls to llvm-readelf with non-ELF object files that specify --elf-output-style=GNU will now print file summary information where it previously didn't. Fixes previous Windows test failure which occured due to JSON escaping of '\' by not relying on LIT substitution. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D114225
2021-12-10Revert "[llvm-readobj] Add JSONScopedPrinter to llvm-readelf"Jayson Yan
This reverts commit 824eef231a853d7054d55010c16654f6f20e0394. file-summary-json.test and pretty-print.test fails on Windows.
2021-12-10[llvm-readobj] Add JSONScopedPrinter to llvm-readelfJayson Yan
Adds JSONScopedPrinter to llvm-readelf. It includes an empty JSONELFDumper class which will be used to override any LLVMELFDumper methods which utilize startLine() which JSONScopedPrinter cannot provide. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D114225
2021-11-15[NFC] Trim trailing whitespace in *.rstShao-Ce SUN
2021-10-26[AIX][XCOFF] parsing xcoff object file auxiliary headerzhijian
Summary: The patch supports parsing the xcoff object file auxiliary header with llvm-readobj with option "auxiliary-headers" the format of auxiliary header as https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/filesreference/XCOFF.html#XCOFF__fyovh386shar Reviewers: James Henderson, Jason Liu, Hubert Tong, Esme yi, Sean Fertile. Differential Revision: https://reviews.llvm.org/D82549
2021-07-12[llvm-readobj] Switch command line parsing from llvm::cl to OptTableFangrui Song
Users should generally observe no difference as long as they don't use unintended option forms. Behavior changes: * `-t=d` is removed. Use `-t d` instead. * `--demangle=false` and `--demangle=0` cannot be used. Omit the option or use `--no-demangle`. Other flag-style options don't have `--no-` forms. * `--help-list` is removed. This is a `cl::` specific option. * llvm-readobj now supports grouped short options as well. * `--color` is removed. This is generally not useful (only apply to errors/warnings) but was inherited from Support. Some adjustment to the canonical forms (usually from GNU readelf; currently llvm-readobj has too many redundant aliases): * --dyn-syms is canonical. --dyn-symbols is a hidden alias * --file-header is canonical. --file-headers is a hidden alias * --histogram is canonical. --elf-hash-histogram is a hidden alias * --relocs is canonical. --relocations is a hidden alias * --section-groups is canonical. --elf-section-groups is a hidden alias OptTable avoids global option collision if we decide to support multiplexing for binary utilities. * Most one-dash long options are still supported. `-dt, -sd, -st, -sr` are dropped due to their conflict with grouped short options. * `--section-mapping=false` (D57365) is strange but is kept for now. * Many `cl::opt` variables were unnecessarily external. I added `static` whenever appropriate. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D105532
2021-07-05[llvm-readobj][XCOFF] Add support for printing the String Table.Esme-Yi
Summary: The patch adds the StringTable dumping to llvm-readobj. Currently only XCOFF is supported. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D104613
2021-06-29[llvm-readobj] Make -s and -t match llvm-readelfFangrui Song
llvm-readobj is an internal testing tool for binary formats. Its output and command line options do not need to be stable. It isn't supposed to be part of a build process. llvm-readelf was created as a user-facing utility and its interface intends to be compatible with GNU readelf (unless there are good reasons not to). The two tools have mostly compatible options. -s and -t are noticeable exceptions due to history. I think the cost of keeping the inconsistency overweighs the little history-compatible benefit and hinders transition from cl::opt to OptTable, so let's change it. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D105055
2021-03-08[llvm-readelf] Support dumping the BB address map section with --bb-addr-map.Rahman Lavaee
This patch lets llvm-readelf dump the content of the BB address map section in the following format: ``` Function { At: <address> BB entries [ { Offset: <offset> Size: <size> Metadata: <metadata> }, ... ] } ... ``` Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D95511
2020-10-08[llvm-readobj] Add --coff-tls-directory flag to print TLS Directory & test.Luqman Aden
Akin to dumpbin's /TLS option, this will print out the TLS directory, if present, in the image. Example output: ``` > llvm-readobj --coff-tls-directory test.exe File: test.exe Format: COFF-x86-64 Arch: x86_64 AddressSize: 64bit TLSDirectory { StartAddressOfRawData: 0x140004000 EndAddressOfRawData: 0x140004040 AddressOfIndex: 0x140002000 AddressOfCallBacks: 0x0 SizeOfZeroFill: 0x0 Characteristics [ (0x0) ] } ``` Reviewed By: jhenderson, grimar Differential Revision: https://reviews.llvm.org/D88635
2020-07-20[llvm-readobj] Print error when executed with no input filesElvina Yakubova
This patch changes llvm-readelf (and llvm-readobj for consistency) behavior to print an error when executed with no input files. Reading from stdin can be achieved via a '-' for the input object. Fixes https://bugs.llvm.org/show_bug.cgi?id=46400 Differential Revision: https://reviews.llvm.org/D83704 Reviewed by: jhenderson, MaskRay, sbc, jyknight
2020-06-17[llvm-readobj] set --elf-cg-profile as alias of --cg-profileZequan Wu
Summary: Rename --elf-cg-profile to --cg-profile and keep --elf-cg-profile as an alias of --cg-profile. Reviewers: jhenderson, MaskRay, espindola, hans Reviewed By: jhenderson, MaskRay Subscribers: emaste, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D81855
2019-12-06[llvm-readobj] - Implement --dependent-libraries flag.Georgii Rymar
There is no way to dump SHT_LLVM_DEPENDENT_LIBRARIES sections currently. This patch implements this. The section is described here: https://llvm.org/docs/Extensions.html#sht-llvm-dependent-libraries-section-dependent-libraries Differential revision: https://reviews.llvm.org/D70665
2019-10-01[llvm-readobj/llvm-readelf] Delete --arm-attributes (alias for --arch-specific)Fangrui Song
D68110 added --arch-specific (supported by GNU readelf) and made --arm-attributes an alias for it. The tests were later migrated to use --arch-specific. Note, llvm-readelf --arch-specific currently just uses llvm-readobj style output for ARM attributes. The readelf-style output is not implemented. Reviewed By: compnerd, kongyi, rupprecht Differential Revision: https://reviews.llvm.org/D68196 llvm-svn: 373291
2019-09-17[docs] Make --version text more correctJames Henderson
Follow-up to r371983. Referring to "this program" in the description of the --version option in the documentation isn't exactly correct, because the docs are not part of the program, and so "this program" doesn't really refer to anything. This patch brings the other users of this terminology into line with the new updates to llvm-size and llvm-strings. Reviewed by: alexshap, MaskRay Differential Revision: https://reviews.llvm.org/D67618 llvm-svn: 372107
2019-09-13[docs][llvm-readelf][llvm-readobj] Improve --stack-sizes documentationJames Henderson
llvm-readobj's document was missing --stack-sizes entirely from its document, so this patch adds it. It also adds a note to the llvm-readelf description that the switch is only implemented for GNU style output currently. For reference, --stack-sizes was added in r367942. Reviewed by: MaskRay Differential Revision: https://reviews.llvm.org/D67548 llvm-svn: 371862
2019-07-08[docs][llvm-readobj][llvm-readelf] Improve wordingJames Henderson
llvm-svn: 365335
2019-07-05[docs][llvm-readobj] Add a note to options that do nothing in GNU outputJames Henderson
--section-data, --section-relocations and --section-symbols have no effect for GNU style ouput. This patch changes the docs to point this out, as it has caught me out on a couple of occasions. See also https://bugs.llvm.org/show_bug.cgi?id=42522. llvm-svn: 365221
2019-07-01[docs][llvm-readelf] Expand llvm-readelf documentationJames Henderson
Previously, the llvm-readelf documentation was essentially just a list of differences to llvm-readobj. Since llvm-readelf is the more likely goto tool for many people migrating to the LLVM toolchain, it seems like it would be helpful to document all the switches in the llvm-readelf document too. This change expands the options listed accordingly. Additionally, they are unlikely to care what the differences are to llvm-readobj, since they won't be familiar with the latter as there is no GNU equivalent, so this change moves the "differences" section to llvm-readobj's documentation. Reviewed by: peter.smith Differential Revision: https://reviews.llvm.org/D63826 llvm-svn: 364800
2019-06-27[docs][tools] Add missing "program" tags to rst filesJames Henderson
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-25[docs][llvm-readobj] Improve llvm-readobj documentationJames Henderson
There were a number of issues with the llvm-readobj documentation. The following points were raised in https://bugs.llvm.org/show_bug.cgi?id=42255, and have been fixed in this patch: 1. The description section claimed "The tool and its output is primarily designed for use in FileCheck-based tests" which is not really the case any more. 2. The documentation used single-dash long options for option names, but references in the help text to other options exclusively used double-dashes. Fixed by standardising on double-dashes for all long-form options. 3. The majority of options available and in the help text were not present in the documentation. This patch adds them. 4. Several aliases, both long and short, were missing, e.g. --relocs. Additionally, this patch improves the documentation by: 1. Splitting the options into categories based on the file format they are specific to. 2. Updating the Exit Status section to correctly mention that errors lead to a non-zero exit code. 3. Adding a See Also section referencing other similar LLVM tools. 4. Improving/correcting some of the descriptions of options that did not quite match up with what llvm-readobj does. Reviewed by: peter.smith, MaskRay, mtrent Differential Revision: https://reviews.llvm.org/D63719 llvm-svn: 364306
2019-06-21[binutils] Add response file option to help and docsJames Henderson
Many LLVM-based tools already support response files (i.e. files containing a list of options, specified with '@'). This change simply updates the documentation and help text for some of these tools to include it. I haven't attempted to fix all tools, just a selection that I am interested in. I've taken the opportunity to add some tests for --help behaviour, where they were missing. We could expand these tests, but I don't think that's within scope of this patch. This fixes https://bugs.llvm.org/show_bug.cgi?id=42233 and https://bugs.llvm.org/show_bug.cgi?id=42236. Reviewed by: grimar, MaskRay, jkorous Differential Revision: https://reviews.llvm.org/D63597 llvm-svn: 364036
2019-01-17[llvm-readobj][ELF]Add demangling supportJames Henderson
This change adds demangling support to the ELF side of llvm-readobj, under the switch --demangle/-C. The following places are demangled: symbol table dumps (static and dynamic), relocation dumps (static and dynamic), addrsig dumps, call graph profile dumps, and group section signature symbols. Although GNU readelf doesn't support demangling, it is still a useful feature to have, and brings it on a par with llvm-objdump's capabilities. This fixes https://bugs.llvm.org/show_bug.cgi?id=40054. Reviewed by: grimar, rupprecht Differential Revision: https://reviews.llvm.org/D56791 llvm-svn: 351450
2016-01-26[llvm-readobj] Add -elf-section-groups optionHemant Kulkarni
Adds a way to inspect SHT_GROUP sections in ELF objects. Displays signature, member sections of these sections. Differential revision: http://reviews.llvm.org/D16555 llvm-svn: 258845
2013-04-12Teach llvm-readobj to print ELF program headersNico Rieck
llvm-svn: 179363
2013-04-12Add -expand-relocs to llvm-readobjNico Rieck
This option expands shown relocations from single line to a dictionary format: Relocation { Offset: 0x4 Type: R_386_32 (1) Symbol: sym Info: 0x0 } llvm-svn: 179359
2013-04-11Add man page for llvm-readobjNico Rieck
llvm-svn: 179244