668 Commits

Author SHA1 Message Date
Fangrui Song
4ff2529e87 [DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries
Summary:
getRelocatedValue may compute incorrect value for SHT_RELA-typed relocation entries.

// DWARFDataExtractor.cpp
uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off,
...
  // This formula is correct for REL, but may be incorrect for RELA if the value
  // stored in the location (getUnsigned(Off, Size)) is not zero.
  return getUnsigned(Off, Size) + Rel->Value;

In this patch, we

* refactor these visit* functions to include a new parameter `uint64_t A`.
  Since these visit* functions are no longer used as visitors, rename them to resolve*.
  + REL: A is used as the addend. A is the value stored in the location where the
    relocation applies: getUnsigned(Off, Size)
  + RELA: The addend encoded in RelocationRef is used, e.g. getELFAddend(R)
* and add another set of supports* functions to check if a given relocation type is handled.
  DWARFObjInMemory uses them to fail early.

Reviewers: echristo, dblaikie

Reviewed By: echristo

Subscribers: mgorny, aprantl, aheejin, fedor.sergeev, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356729 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 02:43:11 +00:00
Steven Wu
b79b3c8160 [Object] Fix reading objects created with -fembed-bitcode-marker
Currently, this fails with many tools, e.g.

$ clang -fembed-bitcode-marker -c -o test.o test.c
$ nm test.o
nm: test.o The file was not recognized as a valid object file

-fembed-bitcode-marker creates a LLVM,bitcode section consisting of a single
byte. When reading the object file, IRObjectFile::findBitcodeInObject succeeds,
causing SymbolicFile::createSymbolicFile to try to read the "bitcode" rather
than using the outer Mach-O data - when then fails.

Fix this by making findBitcodeInObject return an error if the section size <= 1.

Patched by: Nicholas Allegra

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356718 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-21 21:01:31 +00:00
James Henderson
5f9ffd160a [yaml2obj]Allow explicit symbol indexes in relocations and emit error for bad names
Prior to this change, the "Symbol" field of a relocation would always be
assumed to be a symbol name, and if no such symbol existed, the
relocation would reference index 0. This confused me when I tried to use
a literal symbol index in the field: since "0x1" was not a known symbol
name, the symbol index was set as 0. This change falls back to treating
unknown symbol names as integers, and emits an error if the name is not
found and the string is not an integer.

Note that the Symbol field is optional, so if a relocation doesn't
reference a symbol, it shouldn't be specified. The new error required a
number of test updates.

Reviewed by: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D58510


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355938 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-12 17:00:25 +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
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
George Rimar
47f8c8ba92 Fix BB after r354661
Update 2 test cases after obj2yaml fix in r354661.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354663 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-22 08:58:23 +00:00
Thomas Lively
fd5a6ee2b6 [WebAssembly] Generalize section ordering constraints
Summary:
Changes from using a total ordering of known sections to using a
dependency graph approach. This allows our tools to accept and process
binaries that are compliant with the spec and tool conventions that
would have been previously rejected. It also means our own tools can
do less work to enforce an artificially imposed ordering. Using a
general mechanism means fewer special cases and exceptions in the
ordering logic.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354426 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-20 02:22:36 +00:00
Sam Clegg
96488ce2b0 [WebAssembly] Rename relocations from R_WEBASSEMBLY_ to R_WASM_
See https://github.com/WebAssembly/tool-conventions/pull/95.

This is less typing and IMHO more readable, and it also fits with
our naming around the binary format which tends to use the short name.
e.g.

include/llvm/BinaryFormat/Wasm.h
tools/llvm-objdump/WasmDump.cpp
etc..

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353062 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 17:28:46 +00:00
Matt Davis
76a53521cc [llvm-nm] Report '.comment' ELF sections as 'n' instead of '?'
Summary:
The previous implementation reported `.comment` sections as '?'
GNU uses 'n' which means  "The symbol is a debugging symbol."  `.note`  sections are represented as 'n' too.

The test related to this change was updated to CHECK-NEXT to ensure
order and that we did not miss any symbols in the dump.

Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352891 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01 17:38:08 +00:00
Matt Davis
7fac036c20 [ELF] Return the section name when calling getSymbolName on a section symbol.
Summary:
Previously, llvm-nm would report symbols for .debug and .note sections as: '?' with an empty  section name:

```
00000000 ?
00000000 ?
...
```

With this patch the output more closely resembles GNU nm:
```
00000000 N .debug_abbrev
00000000 n .note.GNU-stack
...
```

This patch calls `getSectionName` for sections that belong to symbols of type `ELF::STT_SECTION`, which returns the name of the section from the section string table.

Reviewers: Bigcheese, davide, jhenderson

Reviewed By: davide, jhenderson

Subscribers: rupprecht, jhenderson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352785 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 19:42:21 +00:00
George Rimar
d01d94f4c3 [obj2yaml] - Dump the sh_entsize section field.
I faced with the fact that obj2yaml does not dump the sh_entsize field.
A problem arose when I tried to dump ELF versioning sections.

This is close to what D50235 did, but D50235 did the change for yaml2obj, and now
I had to do the same for obj2yaml.

Differential revision: https://reviews.llvm.org/D57229

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352373 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28 15:05:10 +00:00
George Rimar
4771873908 [llvm-objdump] - Print LMAs when dumping section headers.
When --section-headers is used, GNU objdump prints both LMA and VMA for sections.
llvm-objdump does not do that what makes it's output be slightly inconsistent.

Patch teaches llvm-objdump to print LMA/VMA for ELF file formats.
The behavior for other formats remains unchanged.

Differential revision: https://reviews.llvm.org/D57146

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352366 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28 14:11:35 +00:00
Bob Haarman
b0fa2c8bb4 simplify COFF module assembly test and move it to Object
Reviewers: pcc, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352142 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-25 00:33:05 +00:00
Michael Trent
6fda2e68f2 Limit dyld image suffixes guessed by guessLibraryShortName()
Summary:
guessLibraryShortName() separates a full Mach-O dylib install name path
into a short name and a dyld image suffix. The short name is the name
of the dylib without its path or extension. The dyld image suffix is a
string used by dyld to load variants of dylibs if available at runtime;
for example, "when binding this process, load 'debug' variants of all
required dylibs." dyld knows exactly what the image suffix is, but
by convention diagnostic tools such as llvm-nm attempt to guess suffix
names by looking at the install name path. 

These dyld image suffixes are separated from the short name by a '_'
character. Because the '_' character is commonly used to separate words
in filenames guessLibraryShortName() cannot reliably separate a dylib's
short name from an arbitrary image suffix; imagine if both the short
name and the suffix contains an '_' character! To better deal with this
ambiguity, guessLibraryShortName() will recognize only "_debug" and
"_profile" as valid Suffix values. Calling code needs to be tolerant of
guessLibraryShortName() guessing incorrectly.

The previous implementation of guessLibraryShortName() did not allow
'_' characters to appear in short names. When present, the short name
would be  truncated, e.g., "libcompiler_rt" => "libcompiler". This
change allows "libcompiler_rt" and "libcompiler_rt_debug" to both be
recognized as "libcompiler_rt".

rdar://47412244

Reviewers: kledzik, lhames, pete

Reviewed By: pete

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352104 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24 20:59:44 +00:00
Wouter van Oortmerssen
8a0264ba42 [WebAssembly] Fixing 2 more symbol offset related tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351465 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-17 19:18:05 +00:00
Sam Clegg
29aeb33500 [WebAssembly] Store section alignment as a power of 2
This change bumps for version number of the wasm object file
metadata.

See https://github.com/WebAssembly/tool-conventions/pull/92

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351285 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 01:34:48 +00:00
Jordan Rupprecht
2e3d9f7574 [libObject] Tweak expected error output from llvm-ar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351259 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 22:03:08 +00:00
Martin Storsjo
0239fd32a4 [llvm-readobj] [COFF] Print the symbol index for relocations
There can be multiple local symbols with the same name (for e.g.
comdat sections), and thus the symbol name itself isn't enough
to disambiguate symbols.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350288 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 08:08:23 +00:00
Peter Wu
97de56dd44 [Object] Deduplicate long archive member names
Summary:
Import libraries as created by llvm-dlltool always use the same archive
member name for every object file (namely, the DLL library name). Ensure
that long names are not repeatedly stored in the string table.

Reviewed By: ruiu

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349637 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 16:15:05 +00:00
Heejin Ahn
e2f3e50df6 [WebAssembly] Check if the section order is correct
Summary:
This patch checks if the section order is correct when reading a wasm
object file in `WasmObjectFile` and converting YAML to wasm object in
yaml2wasm. (It is not possible to check when reading YAML because it is
handled exclusively by the YAML reader.)

This checks the ordering of all known sections (core sections + known
custom sections). This also adds section ID DataCount section that will
be scheduled to be added in near future.

Reviewers: sbc100

Subscribers: dschuff, mgorny, jgravelle-google, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349221 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-15 00:58:12 +00:00
Konstantin Zhuravlyov
d0eb792425 AMDGPU: Enable code object v3 for AMDHSA only
Differential Revision: https://reviews.llvm.org/D54186


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346923 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-15 02:32:43 +00:00
Kristina Brooks
1854e96396 [llvm][test] Update tests using objdump
Update tests using llvm-objdump since check strings don't
match anymore due to the extra `O` in place. This is a 
followup for rL346610. 
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346611 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-11 18:40:33 +00:00
Heejin Ahn
7fe0579584 [WebAssembly] Update more test cases after FixFunctionBitcasts
These test updates were missing from rL346286.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346291 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-07 02:26:03 +00:00
Heejin Ahn
0f48414c8c [WebAssembly] Update test cases after FixFunctionBitcasts
Summary:
This updates generated binaries and corresponding test cases up to date
after applying FixFunctionBitcasts pass.

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346286 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-07 01:58:50 +00:00
Konstantin Zhuravlyov
7829a6dfd5 AMDGPU: Add sram-ecc feature
Differential Revision: https://reviews.llvm.org/D53222


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346177 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-05 22:44:19 +00:00
Konstantin Zhuravlyov
b5d6bd0e48 Revert r345542: AMDGPU: Enable code object v3 by default
It breaks mesa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345662 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-30 22:02:40 +00:00
Konstantin Zhuravlyov
93ce40bd23 AMDGPU: Enable code object v3 by default
Differential Revision: https://reviews.llvm.org/D53525


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345542 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-29 21:07:27 +00:00
Tim Renouf
7d5e5c2747 [AMDGPU] Defined gfx909 Raven Ridge 2
Differential Revision: https://reviews.llvm.org/D53418

Change-Id: Ie3d054f2e956c2768988c0f4c0ffd29a47294eef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345120 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-24 08:14:07 +00:00
James Y Knight
742beb6d7d llvm-ar: Darwin archive format fixes.
* Support writing the DARWIN64 symbol table format.

* In darwin archives, emit a symbol table whenever requested, even
  when there are no members, as the apple linker will abort if given
  an archive without a symbol table.

Added tests for same, and also simplified and moved the GNU 64-bit
symbol table test into archive-symtab.test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344183 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-10 21:07:02 +00:00
Jordan Rupprecht
4f840f1dc3 [llvm-ar] Use POSIX-specified timestamps for 'tv'.
Summary:
The POSIX spec says:

```
If the −t option is used with the −v option, the standard output format shall be:
"%s %u/%u %u %s %d %d:%d %d %s\n", <member mode>, <user ID>,
<group ID>, <number of bytes in member>,
<abbreviated month>, <day-of-month>, <hour>,
<minute>, <year>, <file>

where:

...
<abbreviated month>
Equivalent to the format of the %b conversion specification format in date.
<day-of-month>
Equivalent to the format of the %e conversion specification format in date.
<hour> Equivalent to the format of the %H conversion specification format in date.
<minute> Equivalent to the format of the %M conversion specification format in date.
<year> Equivalent to the format of the %Y conversion specification format in date.
```

This actually used to be the format printed by llvm-ar. It was apparently accidentally changed (see r207385 followed by comments in r207387). This makes it conform to GNU ar for easier replacement.

Reviewers: MaskRay

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343901 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-05 23:25:39 +00:00
Petr Hosek
00a8b036c2 [llvm-nm] Write "no symbol" output to stderr
This matches the output of binutils' nm and ensures that any scripts
or tools that use nm and expect empty output in case there no symbols
don't break.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343887 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-05 21:10:03 +00:00
James Y Knight
0101af5114 Give same-named members unique timestamps on Darwin in llvm-ar.
This change ensures that the (membername,timestamp) tuple uniquely
identifies an entry in an archive for format=darwin, in deterministic
mode (which is the default).

That, then, enables lldb and dsymutil to locate the appropriate object
within the archive.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343805 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-04 18:49:21 +00:00
Jordan Rupprecht
59b44e1294 [llvm-nm] Print an explicit "no symbols" message when an object file has no symbols
Summary:
GNU nm (and other nm implementations, such as "go tool nm") prints an explicit "no symbols" message when an object file has no symbols. Currently llvm-nm just doesn't print anything. Adding an explicit "no symbols" message will allow llvm-nm to be used in place of nm: some scripts and build processes use `nm <file> | grep "no symbols"` as a test to see if a file has no symbols. It will also be more familiar to anyone used to nm.

That said, the format implemented here is slightly different, in that it doesn't print the tool name in the message (which IMHO is not useful to include).

Demo:
```
$ for nm in nm bin/llvm-nm ; do echo "nm implementation: $nm"; $nm /tmp/foo{1,2}.o; echo; done
nm implementation: nm

/tmp/foo1.o:
nm: /tmp/foo1.o: no symbols

/tmp/foo2.o:
0000000000000000 T foo2

nm implementation: bin/llvm-nm

/tmp/foo1.o:
no symbols

/tmp/foo2.o:
0000000000000000 T foo2
```

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343742 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-03 23:39:49 +00:00
Jonas Devlieghere
7689b8dd09 [WASM] Fix overflow when reading custom section
When reading a custom WASM section, it was possible that its name
extended beyond the size of the section. This resulted in a bogus value
for the section size due to the size overflowing.

Fixes heap buffer overflow detected by OSS-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8190

Differential revision: https://reviews.llvm.org/D50387

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339269 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 16:34:03 +00:00
Fangrui Song
98ae3708b4 [ELF] Change isSectionData to exclude SHF_EXECINSTR
Summary:
This affects what sections are displayed as "DATA" in llvm-objdump.
The other user llvm-size is unaffected.

Before, a "TEXT" section is also "DATA", which seems weird.
The sh_flags condition matches that of bfd's SEC_DATA but the sh_type
condition uses (== SHF_PROGBITS) instead of bfd's (!= SHT_NOBITS).
bfd's SEC_DATA is not appealing as so many sections will be shown as DATA.

Reviewers: jyknight, Bigcheese

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335405 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 00:15:33 +00:00
Daniel Cederman
86986e7ed4 Implemented sane default for llvm-objdump's relocation Value format
Summary:
"Unknown" for platforms that were not manually added into the switch
did not make sense at all. Now it prints Target + addend for all
elf-machines that were not explicitly mentioned.

Addresses PR21059 and PR25124.

Original author: fedor.sergeev

Reviewers: jyknight, espindola, fedor.sergeev

Reviewed By: jyknight

Subscribers: eraman, dcederman, jfb, dschuff, aheejin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333726 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01 05:31:58 +00:00
Sam Clegg
f392a175ab Fix use of echo command in test script
On win32 we use lit's executeBuiltinEcho to implement the
echo command and this version only currently supports flags
that are separate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333495 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-30 03:26:28 +00:00
Sam Clegg
50617cfe72 [WebAssembly] Add more error checking to object file parsing
This should address some of the assert failures the fuzzer has been
finding such as:
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6719

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333459 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-29 19:58:59 +00:00
Sam Clegg
8d1235ff26 [WebAsembly] Update default triple in test files to wasm32-unknown-unkown.
Summary: The final -wasm component has been the default for some time now.

Subscribers: jfb, dschuff, jgravelle-google, eraman, aheejin, JDevlieghere, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332007 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-10 17:49:11 +00:00
Hans Wennborg
ca76ce5f8a Add a test for r331746.
Thanks to pcc for creating the test file!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331854 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 08:20:14 +00:00
Matt Arsenault
ac9b3ef76a AMDGPU: Add Vega12 and Vega20
Changes by
  Matt Arsenault
  Konstantin Zhuravlyov

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331215 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-30 19:08:16 +00:00
Sam Clegg
4f72fc1174 typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331006 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-27 00:17:24 +00:00
Sam Clegg
bfeca0b120 [WebAssembly] Section symbols must have local binding
Summary: Also test for symbols information in test/MC/WebAssembly/debug-info.ll.

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, JDevlieghere, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331005 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-27 00:17:21 +00:00
Sam Clegg
14598cb5be [WebAssembly] Add version to object file metadata
Summary: See https://github.com/WebAssembly/tool-conventions/issues/54

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330969 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-26 18:15:32 +00:00
Sam Clegg
588fa1cad7 [WebAssembly] Implement getRelocationValueString()
And use it in llvm-objdump.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330957 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-26 16:41:51 +00:00
Sam Clegg
194a4e0c23 [WebAssembly] Use section index in relocation section header
Rather than referring to sections my their code, use the
absolute index of the target section within the module.

See https://github.com/WebAssembly/tool-conventions/issues/52

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330749 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-24 18:11:36 +00:00
David Blaikie
e1216df7bc Disable a test using environment variables that requires a real shell
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329096 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-03 18:19:52 +00:00
Peter Collingbourne
59aa4501cc [llvm-ar] Support multiple dashed options
This allows syntax like:
$ llvm-ar -c -r -u file.a file.o

This is in addition to the other formats that are already supported:
$ llvm-ar cru file.a file.o
$ llvm-ar -cru file.a file.o

Patch by Tom Anderson!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328716 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28 17:21:14 +00:00
Nicholas Wilson
022e5fa26f [WebAssembly] Reorder reloc sections to come between symtab and name
This is required in order to enable relocs to be validated
as they are read in.

Also update tests with new section ordering.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326694 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-05 12:59:03 +00:00
Nicholas Wilson
2d7eccead1 [WebAssembly] Update pre-generated test files to match latest llc output. NFC.
The ordering of llc's output was changed in rL326334.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326445 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-01 15:55:59 +00:00