792 Commits

Author SHA1 Message Date
Xing GUO
8192200388 [llvm-readobj] Change variables' name to match LLVM-style. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358259 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 07:09:41 +00:00
Xing GUO
aa784af74d [llvm-readobj] Should declare ListScope for verneed entries.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358078 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 12:47:21 +00:00
Shoaib Meenai
c9c739b63f [BinaryFormat] Update Mach-O ARM64E CPU subtype and dumping
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357945 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 21:37:08 +00:00
Xing GUO
6e3b9845ea [llvm-readobj] Use reinterpret_cast instead of C-style casting. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357903 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 11:48:36 +00:00
Fangrui Song
9cc714957f Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357852 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 03:58:42 +00:00
Stephen Tozer
afee28400c Revert "[llvm-readobj] Improve error message for --string-dump"
This reverts commit 681b0798dbbc6b3500c9930977ec8a274b142acb.

Reverted due to causing build failures: llvm-svn: 357772

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357774 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 16:32:25 +00:00
Stephen Tozer
ca728263d8 [llvm-readobj] Improve error message for --string-dump
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357772 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 16:15:50 +00:00
Stephen Tozer
1fc8fc0b09 [format] Add correct punctuation to comment
Test commit that adds a grammatically correct full stop to a single
comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357771 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 15:59:07 +00:00
Xing GUO
9b4a5209aa [llvm-readobj] Add GNU style dumper for .gnu.version section
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357578 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 13:32:49 +00:00
Liang Zou
d39afb2c98 fix typo: "\t" => " "
Reviewers: llvm.org, Jim

Reviewed By: Jim

Subscribers: arsenm, jvesely, nhaehnle, rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59983

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357365 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-31 14:49:00 +00:00
Jordan Rupprecht
745934cdb6 [llvm-readobj] Add some generic notes (e.g. NT_VERSION)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357271 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 16:48:19 +00:00
Jordan Rupprecht
48c5a4e8c2 [llvm-readelf] Allow prefix flags for -p and -x
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357270 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 16:43:13 +00:00
James Henderson
28eed06d08 [llvm-readelf]Merge dynamic and static relocation printing to avoid code 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357246 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 11:47:19 +00:00
Xing GUO
4cf89de561 [llvm-readobj] Change variable names to match LLVM-style. NFC.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357230 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 01:26:36 +00:00
Jordan Rupprecht
074bfaec2b [llvm-readobj] Fix formatting of unknown note types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357221 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 23:08:06 +00:00
Xing GUO
461a7ee649 - Addressed comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357166 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 12:51:56 +00:00
Xing GUO
6717b4e616 - Addressed @jhenderson 's comments
- Format patch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357165 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 12:51:46 +00:00
Xing GUO
e84f5aaedf [llvm-readobj] Add new helper function getSymbolVersionByIndex()
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357164 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 12:51:35 +00:00
Xing GUO
75ebb082a2 [llvm-readobj] Separate Symbol Version dumpers into LLVM style and GNU 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356881 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 11:02:49 +00:00
Xing GUO
2154ccb338 [llvm-readobj] Revert bad changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356777 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 16:20:54 +00:00
Xing GUO
85f2850f15 [llvm-readobj] Separate Symbol Version dumpers into LLVM style and GNU 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356764 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 15:42:13 +00:00
Xing GUO
380737bf6d [llvm-readobj] Format codes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356664 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-21 13:42:06 +00:00
Tim Renouf
d1e92f3b2a [AMDGPU] Factored PAL metadata handling out into its own class
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356582 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 17:42:00 +00:00
Fangrui Song
0fb7679253 [llvm-readobj] Delete unused variable. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356246 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-15 10:34:57 +00:00
Tim Renouf
6cce665f80 [AMDGPU] Switched HSA metadata to use MsgPackDocument
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356081 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-13 18:55:50 +00:00
Xing GUO
856397bd22 [llvm-readobj] Print symbol version when dumping relocations (PR31564)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355922 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-12 14:30:13 +00:00
Sunil Srivastava
6a7f25d30d Improve "llvm-nm -f sysv" output for Elf files
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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355742 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08 22:00:50 +00:00
James Henderson
083138333b [llvm-readelf]Don't lose negative-ness of negative addends for no symbol 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355696 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08 13:22:05 +00:00
Xing GUO
72804e5ef9 [llvm-readobj] Dump DT_USED value as string like GNU readelf does
Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355600 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-07 14:53:10 +00:00
Matt Davis
56d9da61e3 [llvm-readobj] Display section names for STT_SECTION symbols.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355207 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 17:31:32 +00:00
Igor Kudrin
b58513a2a0 [CommandLine] Allow grouping options which can have values.
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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355185 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 09:22:42 +00:00
Peter Collingbourne
35823ce58d llvm-readobj: Try the DWARF CFI dumper on all machines.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355151 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-28 22:42:55 +00:00
George Rimar
f14213bb4c [llvm-readobj] - Fix the invalid dumping of the dynamic sections without 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355073 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-28 08:15:59 +00:00
Matt Davis
ce64e29e1f [llvm-readobj] Print section type values for unknown sections.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355014 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 18:39:17 +00:00
James Henderson
d4177fd796 [llvm-readobj]Fix error messages for bad archive members and add testing for 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354960 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 11:07:08 +00:00
Fangrui Song
4c1861d5b1 [llvm-readobj] Print DF_1_DISPRELPND
The test will be added by D58677.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354955 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 05:37:11 +00:00
Vlad Tsyrklevich
728bc80a2e Revert "Improve "llvm-nm -f sysv" output for Elf files"
This reverts commit r354833, it was causing ASan test failures on
sanitizer-x86_64-linux-fast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354849 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-26 07:04:56 +00:00
Sunil Srivastava
b34b0bf047 Improve "llvm-nm -f sysv" output for Elf files
Specifically, compute and Print Type and Section columns.

Differential Revision: https://reviews.llvm.org/D58263


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354833 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-26 00:19:39 +00:00
Fangrui Song
fb3ba6686f [llvm-readobj] Change "SHT_MIPS_DWARF" to "MIPS_DWARF"
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354571 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-21 11:35:41 +00:00
Fangrui Song
9600cecdd0 Fix file header issues in fuzzers. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354551 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-21 07:57:14 +00:00
Fangrui Song
2fd5ae5ba0 Fix some include order and file headers issues. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354550 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-21 07:42:31 +00:00
George Rimar
3d4666cd74 [llvm-readobj] - Simplify .gnu.version_d dumping.
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354270 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-18 13:58:12 +00:00
Fangrui Song
98cd2e90ef [llvm-readobj] Dump GNU_PROPERTY_X86_ISA_1_{NEEDED,USED} notes in .note.gnu.property
Reviewers: grimar, rupprecht

Reviewed By: rupprecht

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58175

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353991 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 23:18:05 +00:00
Fangrui Song
95d339f46f [llvm-readobj] Rename pr_data to PrData
As requested by grimar in D58112.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353951 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 15:58:23 +00:00
Fangrui Song
45dd4f2fbc [llvm-readobj] Dump GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} notes in .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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353908 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 01:51:45 +00:00
Fangrui Song
610cf8006d [llvm-readobj] Only allow 4-byte pr_data
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353815 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12 09:56:01 +00:00
George Rimar
16007333e9 [llvm-readobj] - Simplify .gnu.version_r dumping a bit.
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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353814 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12 09:50:04 +00:00
Dan Gohman
08612dec1d [WebAssembly] Fix imported function symbol names that differ from their 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353474 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-07 22:03:32 +00:00
Alexandre Ganea
29400a2fb2 [CodeView] Fix cycles in debug info when merging Types with global hashes
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 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353412 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-07 15:24:18 +00:00
Sam Clegg
c44c327530 [WebAssembly] Add symbol flag to the binary format llvm.used
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353360 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-07 01:24:44 +00:00