summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-readobj] - Apply clang format. NFC.George Rimar2019-05-141-587/+564
| | | | | | I am a bit tired of the formatting issues. llvm-svn: 360676
* [Object] Change SymbolicFile::printSymbolName to use ErrorFangrui Song2019-05-101-1/+1
| | | | llvm-svn: 360414
* [Object][XCOFF] Add an XCOFF dumper for llvm-readobj.Sean Fertile2019-05-034-0/+128
| | | | | | | | | | | Patch adds support for dumping of file headers with llvm-readobj. XCOFF object files are added to test dumping a well formed file, and dumping both negative timestamps and negative symbol counts, both of which are allowed in the XCOFF definition. Differential Revision: https://reviews.llvm.org/D60878 llvm-svn: 359878
* [llvm-readobj] Delete and inline relocAddressLessFangrui Song2019-05-023-7/+3
| | | | | | | It is used only once in COFFDumper.cpp. Deleting it from the public interface seems better. llvm-svn: 359775
* [Object] Change getSectionName() to return Expected<StringRef>Fangrui Song2019-05-023-30/+22
| | | | | | | | | | Summary: It currently receives an output parameter and returns std::error_code. Expected<StringRef> fits for this purpose perfectly. Differential Revision: https://reviews.llvm.org/D61421 llvm-svn: 359774
* [llvm-readobj] Change -long-option to --long-option in tests. NFCFangrui Song2019-05-011-57/+57
| | | | | | | | | | We use both -long-option and --long-option in tests. Switch to --long-option for consistency. In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf. While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf). llvm-svn: 359649
* [WebAssembly] Support EXPLICIT_NAME symbols in llvm-readobjDan Gohman2019-04-301-0/+1
| | | | | | | | | Teach llvm-readobj about WASM_SYMBOL_EXPLICIT_NAME. Differential Revision: https://reviews.llvm.org/D61323 Reviewer: sbc100 llvm-svn: 359602
* Minor formatting tweak, no behavior changeNico Weber2019-04-261-4/+7
| | | | llvm-svn: 359295
* llvm-cvtres: Make new dupe resource error a bit friendlierNico Weber2019-04-241-26/+3
| | | | | | | | | | | | For well-known type IDs, include the name of the type. To not duplicate the ID->name map, make llvm-readobj call this new function as well. It has slightly different output, so this also requires updating a few tests. Differential Revision: https://reviews.llvm.org/D61086 llvm-svn: 359153
* [AMDGPU] Add gfx1010 target definitionsStanislav Mekhanoshin2019-04-241-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D61041 llvm-svn: 359113
* Use llvm::stable_sort. NFCFangrui Song2019-04-223-3/+3
| | | | llvm-svn: 358897
* [llvm-readelf] Correctly dump symbols whose section id is SHN_XINDEXEugene Leviant2019-04-151-3/+4
| | | | | | Differential revision: https://reviews.llvm.org/D60614 llvm-svn: 358396
* [llvm-readobj] Reapply: Improve error message for --string-dumpStephen Tozer2019-04-152-16/+11
| | | | | | | | | | | | | | | | | This is a resubmission of a previous patch that caused test failures, with the fixes for the relevant tests included. Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630 This patch changes the error message when the section specified by --string-dump cannot be found by including the name of the section in the error message and changing the prefix text to not imply that the file itself was invalid. As part of this change some uses of std::error_code have been replaced with the llvm Error class to better encapsulate the error info (rather than passing File strings around), and the WithColor class replaces string literal error prefixes. llvm-svn: 358395
* [StackMaps] Add location size to llvm-readobj -stackmap outputPhilip Reames2019-04-131-6/+6
| | | | | | | | | | | | | | | | The size field of a location can be different for each entry, so it is useful to have this displayed in the output of llvm-readobj -stackmap. Below is an example of how the output would look: Record ID: 2882400000, instruction offset: 16 3 locations: #1: Constant 1, size: 8 #2: Constant 2, size: 8 #3: Constant 3, size: 8 0 live-outs: [ ] Patch By: jacob.hughes@kcl.ac.uk (with heavy modification by me) Differential Revision: https://reviews.llvm.org/D59169 llvm-svn: 358324
* [llvm-readobj] Minor style tweak for consistency sake [NFC]Philip Reames2019-04-132-4/+4
| | | | llvm-svn: 358323
* [StackMaps] Remove format version from the class name [NFC]Philip Reames2019-04-133-5/+5
| | | | | | Motivation is to reduce silly diffs when we change the format. For instance, this causes most of D59020 to disappear. llvm-svn: 358322
* [WebAssembly] Add DataCount section to object filesThomas Lively2019-04-121-5/+5
| | | | | | | | | | | | | | | | | | | Summary: This ensures that object files will continue to validate as WebAssembly modules in the presence of bulk memory operations. Engines that don't support bulk memory operations will not recognize the DataCount section and will report validation errors, but that's ok because object files aren't supposed to be run directly anyway. Reviewers: aheejin, dschuff, sbc100 Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60623 llvm-svn: 358315
* [llvm-readobj] Change variables' name to match LLVM-style. NFC.Xing GUO2019-04-121-37/+41
| | | | llvm-svn: 358259
* [llvm-readobj] Should declare `ListScope` for `verneed` entries.Xing GUO2019-04-101-0/+1
| | | | | | | | | | | | | | | | Summary: YAML mappings require keys to be unique. See: https://yaml.org/spec/1.2/spec.html#id2764652 Reviewers: jhenderson, grimar, rupprecht, espindola, ruiu Reviewed By: ruiu Subscribers: ruiu, emaste, arichardson, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60438 llvm-svn: 358078
* [BinaryFormat] Update Mach-O ARM64E CPU subtype and dumpingShoaib Meenai2019-04-081-0/+1
| | | | | | | | | The new value is taken from <mach/machine.h> in the MacOSX10.14 SDK from Xcode 10.1. Update llvm-objdump and llvm-readobj accordingly. Differential Revision: https://reviews.llvm.org/D58636 llvm-svn: 357945
* [llvm-readobj] Use `reinterpret_cast` instead of C-style casting. NFC.Xing GUO2019-04-081-18/+25
| | | | llvm-svn: 357903
* Change some StringRef::data() reinterpret_cast to bytes_begin() or ↵Fangrui Song2019-04-072-11/+8
| | | | | | arrayRefFromStringRef() llvm-svn: 357852
* Revert "[llvm-readobj] Improve error message for --string-dump"Stephen Tozer2019-04-052-11/+16
| | | | | | | | This reverts commit 681b0798dbbc6b3500c9930977ec8a274b142acb. Reverted due to causing build failures: llvm-svn: 357772 llvm-svn: 357774
* [llvm-readobj] Improve error message for --string-dumpStephen Tozer2019-04-052-16/+11
| | | | | | | | | | | | | | | | Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630 This patch changes the error message when the section specified by --string-dump cannot be found by including the name of the section in the error message and changing the prefix text to not imply that the file itself was invalid. As part of this change some uses of std::error_code have been replaced with the llvm Error class to better encapsulate the error info (rather than passing File strings around), and the WithColor class replaces string literal error prefixes. Differential Revision: https://reviews.llvm.org/D59946 llvm-svn: 357772
* [format] Add correct punctuation to commentStephen Tozer2019-04-051-1/+1
| | | | | | | Test commit that adds a grammatically correct full stop to a single comment. llvm-svn: 357771
* [llvm-readobj] Add GNU style dumper for .gnu.version sectionXing GUO2019-04-031-1/+51
| | | | | | | | | | | | | | | | Summary: Currently, `llvm-readobj` do not support GNU style dumper for symbol versioning sections. In this patch, I would like to implement dumper for `.gnu.version` section Reviewers: jhenderson, rupprecht, grimar Reviewed By: jhenderson, rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59877 llvm-svn: 357578
* fix typo: "\t" => " "Liang Zou2019-03-311-2/+2
| | | | | | | | | | | | | | Reviewers: llvm.org, Jim Reviewed By: Jim Subscribers: arsenm, jvesely, nhaehnle, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59983 llvm-svn: 357365
* [llvm-readobj] Add some generic notes (e.g. NT_VERSION)Jordan Rupprecht2019-03-291-3/+29
| | | | | | | | | | | | | | | | Summary: Support reading notes that don't have a standard note name. Reviewers: MaskRay Reviewed By: MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59969 llvm-svn: 357271
* [llvm-readelf] Allow prefix flags for -p and -xJordan Rupprecht2019-03-291-2/+2
| | | | | | | | | | | | | | | | Summary: This allows syntax like `llvm-readelf -p.data1 -x.data2`. Reviewers: jhenderson Reviewed By: jhenderson Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59965 llvm-svn: 357270
* [llvm-readelf]Merge dynamic and static relocation printing to avoid code ↵James Henderson2019-03-291-45/+23
| | | | | | | | | | | | | | | | duplication The majority of the printRelocation and printDynamicRelocation functions were identical. This patch factors this all out into a new function. There are a couple of minor differences to do with printing of symbols without names, but I think these are harmless, and in some cases a small improvement. Reviewed by: grimar, rupprecht, Higuoxing Differential Revision: https://reviews.llvm.org/D59823 llvm-svn: 357246
* [llvm-readobj] Change variable names to match LLVM-style. NFC.Xing GUO2019-03-291-19/+19
| | | | | | | | | | | | | | | | Summary: This patch helps change variable names to match LLVM-style Reviewers: jhenderson, Higuoxing Reviewed By: Higuoxing Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59931 llvm-svn: 357230
* [llvm-readobj] Fix formatting of unknown note typesJordan Rupprecht2019-03-281-1/+2
| | | | llvm-svn: 357221
* - Addressed commentsXing GUO2019-03-281-3/+3
| | | | llvm-svn: 357166
* - Addressed @jhenderson 's commentsXing GUO2019-03-281-12/+11
| | | | | | - Format patch llvm-svn: 357165
* [llvm-readobj] Add new helper function `getSymbolVersionByIndex()`Xing GUO2019-03-281-32/+43
| | | | | | | | | | | | | | | | Summary: When implementing `GNU style` dumper for `.gnu.version` section, we should find symbol version name by `vs_index`. Reviewers: jhenderson, rupprecht Reviewed By: rupprecht Subscribers: arphaman, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59545 llvm-svn: 357164
* [llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU ↵Xing GUO2019-03-251-137/+183
| | | | | | | | | | | | | | | | | | | | style` Summary: Currently, llvm-readobj can dump symbol version sections only in LLVM style. In this patch, I would like to separate these dumpers into GNU style and LLVM style for future implementation. Reviewers: grimar, jhenderson, mattd, rupprecht Reviewed By: jhenderson, rupprecht Subscribers: ormris, dyung, RKSimon, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59186 llvm-svn: 356881
* [llvm-readobj] Revert bad changesXing GUO2019-03-221-175/+101
| | | | llvm-svn: 356777
* [llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU ↵Xing GUO2019-03-221-101/+175
| | | | | | | | | | | | | | | | | | | | style` Summary: Currently, llvm-readobj can dump symbol version sections only in LLVM style. In this patch, I would like to separate these dumpers into GNU style and LLVM style for future implementation. Reviewers: grimar, jhenderson, mattd, rupprecht Reviewed By: rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59186 llvm-svn: 356764
* [llvm-readobj] Format codes. NFC.Xing GUO2019-03-211-8/+8
| | | | llvm-svn: 356664
* [AMDGPU] Factored PAL metadata handling out into its own classTim Renouf2019-03-201-11/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: This commit introduces a new AMDGPUPALMetadata class that: * is inside the AMDGPU target; * keeps an in-memory representation of PAL metadata; * provides a method to read the frontend-supplied metadata from LLVM IR; * provides methods for the asm printer to set metadata items; * provides methods to write the metadata as a binary blob to put in a .note record or as an asm directive; * provides a method to read the metadata as a binary blob from a .note record. Because llvm-readobj cannot call directly into a target, I had to remove llvm-readobj's ability to dump PAL metadata, pending a resolution to https://reviews.llvm.org/D52821 Differential Revision: https://reviews.llvm.org/D57027 Change-Id: I756dc830894fcb6850324cdcfa87c0120eb2cf64 llvm-svn: 356582
* [llvm-readobj] Delete unused variable. NFCFangrui Song2019-03-151-1/+0
| | | | llvm-svn: 356246
* [AMDGPU] Switched HSA metadata to use MsgPackDocumentTim Renouf2019-03-131-11/+6
| | | | | | | | | | | | Summary: MsgPackDocument is the lighter-weight replacement for MsgPackTypes. This commit switches AMDGPU HSA metadata processing to use MsgPackDocument instead of MsgPackTypes. Differential Revision: https://reviews.llvm.org/D57024 Change-Id: I0751668013abe8c87db01db1170831a76079b3a6 llvm-svn: 356081
* [llvm-readobj] Print symbol version when dumping relocations (PR31564)Xing GUO2019-03-121-2/+4
| | | | | | | | | | | | | | | | Summary: This helps resolve https://bugs.llvm.org/show_bug.cgi?id=31564 Reviewers: jhenderson, grimar Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59175 llvm-svn: 355922
* Improve "llvm-nm -f sysv" output for Elf filesSunil Srivastava2019-03-081-10/+0
| | | | | | | | | | Specifically, compute and Print Type and Section columns. This is a re-commit of rL354833, after fixing the Asan problem found a a buildbot. Differential Revision: https://reviews.llvm.org/D59060 llvm-svn: 355742
* [llvm-readelf]Don't lose negative-ness of negative addends for no symbol ↵James Henderson2019-03-081-17/+21
| | | | | | | | | | | | | | | | | | | | relocations llvm-readelf prints relocation addends as: <symbol value>[+-]<absolute addend> where [+-] is determined from whether addend is less than zero or not. However, it does not print the +/- if there is no symbol, which meant that negative addends became their positive value with no indication that this had happened. This patch stops the absolute conversion when addends are negative and there is no associated symbol. Reviewed by: Higuoxing, mattd, MaskRay Differential Revision: https://reviews.llvm.org/D59095 llvm-svn: 355696
* [llvm-readobj] Dump DT_USED value as string like GNU readelf doesXing GUO2019-03-071-0/+3
| | | | | | | | | | | | | | Reviewers: jhenderson Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59089 llvm-svn: 355600
* [llvm-readobj] Display section names for STT_SECTION symbols.Matt Davis2019-03-011-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch will obtain the section name for symbols that refer to a section. Prior to this patch the Name field for STT_SECTIONs was blank, now it is populated. Before: ``` Symbol table '.symtab' contains 6 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 5: 0000000000000000 0 TLS GLOBAL DEFAULT UND sym ``` With this patch: ``` Symbol table '.symtab' contains 6 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 .text 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3 .data 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 .bss 4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 5: 0000000000000000 0 TLS GLOBAL DEFAULT UND sym ``` This fixes PR40788 Reviewers: jhenderson, rupprecht, espindola Reviewed By: rupprecht Subscribers: emaste, javed.absar, arichardson, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58796 llvm-svn: 355207
* [CommandLine] Allow grouping options which can have values.Igor Kudrin2019-03-011-1/+1
| | | | | | | | | | | | | | | | This patch allows all forms of values for options to be used at the end of a group. With the fix, it is possible to follow the way GNU binutils tools handle grouping options better. For example, the -j option can be used with objdump in any of the following ways: $ objdump -d -j .text a.o $ objdump -d -j.text a.o $ objdump -dj .text a.o $ objdump -dj.text a.o Differential Revision: https://reviews.llvm.org/D58711 llvm-svn: 355185
* llvm-readobj: Try the DWARF CFI dumper on all machines.Peter Collingbourne2019-02-281-8/+5
| | | | | | | | | | | | There's no reason to limit the DWARF CFI dumper to EM_386 and EM_X86_64; ELF files could contain DWARF CFI on almost any platform (even 32-bit ARM; NetBSD uses DWARF CFI on that platform). So start using the DWARF CFI dumper unconditionally so that we can dump .eh_frame sections on the remaining ELF platforms as well as in NetBSD binaries. Differential Revision: https://reviews.llvm.org/D58761 llvm-svn: 355151
* [llvm-readobj] - Fix the invalid dumping of the dynamic sections without ↵George Rimar2019-02-281-19/+13
| | | | | | | | | | | | | | | | terminating DT_NULL entry. This is https://bugs.llvm.org/show_bug.cgi?id=40861, Previously llvm-readobj would print the DT_NULL sometimes for the dynamic section that has no terminator entry. The logic of printDynamicTable was a bit overcomplicated. I rewrote it slightly to fix the issue and commented. Differential revision: https://reviews.llvm.org/D58716 llvm-svn: 355073
OpenPOWER on IntegriCloud