summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [llvm-readobj] Print section type values for unknown sections.Matt Davis2019-02-271-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch displays a hexadecimal section value (Elf_Shdr::sh_type) or section-relative offset when printing unknown sections. Here is a subset of the output (ignoring the fields following "Type" when dumping an ELF's GNU `--section-headers` table). Section Headers: ``` [Nr] Name Type [16] android_rel LOOS+0x1 [17] android_rela LOOS+0x2 [27] unknown 0x1000: <unknown> [28] loos LOOS+0 [30] hios VERSYM [31] loproc LOPROC+0 [33] hiproc LOPROC+0xFFFFFFF [34] louser LOUSER+0 [36] hiuser LOUSER+0x7FFFFFFF ``` As a comparison, the previous output looked something like the above, but with a blank "Type" field: ``` [Nr] Name Type [27] unknown [28] loos [30] hios VERSYM [31] loproc [33] hiproc [34] louser [36] hiuser ``` This fixes PR40773 Reviewers: jhenderson, rupprecht, Bigcheese Reviewed By: jhenderson, rupprecht, Bigcheese Subscribers: MaskRay, Bigcheese, srhines, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58701 llvm-svn: 355014
* [llvm-readobj]Fix error messages for bad archive members and add testing for ↵James Henderson2019-02-271-1/+1
| | | | | | | | | | | | | | archive handling llvm-readobj's error messages were broken for bad archive members. This patch fixes them, and also adds testing for archive and thin archive handling within llvm-readobj. Reviewed by: rupprecht, grimar, higuoxing Differential Revision: https://reviews.llvm.org/D58681 llvm-svn: 354960
* [llvm-readobj] Print DF_1_DISPRELPNDFangrui Song2019-02-271-0/+1
| | | | | | The test will be added by D58677. llvm-svn: 354955
* Revert "Improve "llvm-nm -f sysv" output for Elf files"Vlad Tsyrklevich2019-02-261-0/+10
| | | | | | | This reverts commit r354833, it was causing ASan test failures on sanitizer-x86_64-linux-fast. llvm-svn: 354849
* Improve "llvm-nm -f sysv" output for Elf filesSunil Srivastava2019-02-261-10/+0
| | | | | | | | Specifically, compute and Print Type and Section columns. Differential Revision: https://reviews.llvm.org/D58263 llvm-svn: 354833
* [llvm-readobj] Change "SHT_MIPS_DWARF" to "MIPS_DWARF"Fangrui Song2019-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: This is to be consistent with the display of other MIPS section types. This string is also used by binutils-gdb/binutils/readelf.c:get_mips_section_type_name Since we are here, reorder the two enum constatns because SHT_MIPS_DWARF < SHT_MIPS_ABIFLAGS. Reviewers: jhenderson, atanasyan Reviewed By: jhenderson Subscribers: aprantl, sdardis, arichardson, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58496 llvm-svn: 354571
* Fix file header issues in fuzzers. NFCFangrui Song2019-02-211-1/+1
| | | | llvm-svn: 354551
* Fix some include order and file headers issues. NFCFangrui Song2019-02-211-1/+1
| | | | llvm-svn: 354550
* [llvm-readobj] - Simplify .gnu.version_d dumping.George Rimar2019-02-181-10/+1
| | | | | | | | | | | | This is similar to D58048. Instead of scanning the dynamic table to read the DT_VERDEFNUM, we could take it from the sh_info field. (https://docs.oracle.com/cd/E19683-01/816-1386/chapter6-94076/index.html) The patch does this. llvm-svn: 354270
* [llvm-readobj] Dump GNU_PROPERTY_X86_ISA_1_{NEEDED,USED} notes in ↵Fangrui Song2019-02-131-0/+41
| | | | | | | | | | | | | | | | .note.gnu.property Reviewers: grimar, rupprecht Reviewed By: rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58175 llvm-svn: 353991
* [llvm-readobj] Rename pr_data to PrDataFangrui Song2019-02-131-12/+12
| | | | | | As requested by grimar in D58112. llvm-svn: 353951
* [llvm-readobj] Dump GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} notes in ↵Fangrui Song2019-02-131-17/+42
| | | | | | | | | | | | | | | | | | .note.gnu.property Summary: And change the output ("X86 features" -> "x86 feature") a bit. Reviewers: grimar, xiangzhangllvm, hjl.tools, rupprecht Reviewed By: rupprecht Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58112 llvm-svn: 353908
* [llvm-readobj] Only allow 4-byte pr_dataFangrui Song2019-02-121-6/+4
| | | | | | | | | | | | | | | | Summary: AMD64 psABI says: "The pr_data field of each property contains a 4-byte unsigned integer." Thus we don't need to handle 8-byte pr_data. Reviewers: mike.dvoretsky, grimar, craig.topper, xiangzhangllvm, hjl.tools Reviewed By: grimar Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58103 llvm-svn: 353815
* [llvm-readobj] - Simplify .gnu.version_r dumping a bit.George Rimar2019-02-121-8/+1
| | | | | | | | | | | Current implementation takes "Number of needed versions" from DT_VERNEEDNUM dynamic tag entry. Though it would be a bit simpler to take it from sh_info section header field directly: https://docs.oracle.com/cd/E19683-01/816-1386/chapter6-94076/index.html Differential revision: https://reviews.llvm.org/D58048 llvm-svn: 353814
* [WebAssembly] Fix imported function symbol names that differ from their ↵Dan Gohman2019-02-071-2/+4
| | | | | | | | | | | | | | import names in the .o format Add a flag to allow symbols to have a wasm import name which differs from the linker symbol name, allowing the linker to link code using the import_module attribute. This is the MC/Object portion of the patch. Differential Revision: https://reviews.llvm.org/D57632 llvm-svn: 353474
* [CodeView] Fix cycles in debug info when merging Types with global hashes Alexandre Ganea2019-02-073-27/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | When type streams with forward references were merged using GHashes, cycles were introduced in the debug info. This was caused by GlobalTypeTableBuilder::insertRecordAs() not inserting the record on the second pass, thus yielding an empty ArrayRef at that record slot. Later on, upon PDB emission, TpiStreamBuilder::commit() would skip that empty record, thus offseting all indices that came after in the stream. This solution comes in two steps: 1. Fix the hash calculation, by doing a multiple-step resolution, iff there are forward references in the input stream. 2. Fix merge by resolving with multiple passes, therefore moving records with forward references at the end of the stream. This patch also adds support for llvm-readoj --codeview-ghash. Finally, fix dumpCodeViewMergedTypes() which previously could reference deleted memory. Fixes PR40221 Differential Revision: https://reviews.llvm.org/D57790 llvm-svn: 353412
* [WebAssembly] Add symbol flag to the binary format llvm.usedSam Clegg2019-02-071-0/+1
| | | | | | | | | | | | | | Summary: Rather than add a new attribute See https://github.com/WebAssembly/tool-conventions/issues/64 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57864 llvm-svn: 353360
OpenPOWER on IntegriCloud