Commit Graph

201 Commits

Author SHA1 Message Date
Sam Clegg
45c215a28e [WebAssembly] Add support for dylink section in object format
See https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346880 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 18:36:24 +00:00
Heejin Ahn
8bcdd04bce [WebAssembly] Add support for the event section
Summary:
This adds support for the 'event section' specified in the exception
handling proposal. (This was named 'exception section' first, but later
renamed to 'event section' to take possibilities of other kinds of
events into consideration. But currently we only store exception info in
this section.)

The event section is added between the global section and the export
section. This is for ease of validation per request of the V8 team.

This patch:
- Creates the event symbol type, which is a weak symbol
- Makes 'throw' instruction take the event symbol '__cpp_exception'
- Adds relocation support for events
- Adds WasmObjectWriter / WasmObjectFile (Reader) support
- Adds obj2yaml / yaml2obj support
- Adds '.eventtype' printing support

Reviewers: dschuff, sbc100, aardappel

Subscribers: jgravelle-google, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346825 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-14 02:46:21 +00:00
Fangrui Song
b87342a824 [DWARF] Change pubnames to use DWARFSection instead of StringRef
Summary: The debug_info_offset values in .debug_{,gnu_}pub{name,types} may be relocated. Change it to DWARFSection so that we can get relocated values.

Reviewers: ruiu, dblaikie, grimar, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: aprantl, JDevlieghere, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346615 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-11 18:57:28 +00:00
Jonas Devlieghere
686dfe3676 [Support] Make error banner optional in logAllUnhandledErrors
In a lot of places an empty string was passed as the ErrorBanner to
logAllUnhandledErrors. This patch makes that argument optional to
simplify the call sites.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346604 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-11 01:46:03 +00:00
Derek Schuff
ab9755b803 [WebAssembly] Refactor WasmSignature and use it for MCSymbolWasm
MCContext does not destroy MCSymbols on shutdown. So, rather than putting
SmallVectors (which may heap-allocate) inside MCSymbolWasm, use unowned pointer
to a WasmSignature instead. The signatures are now owned by the AsmPrinter.
Also uses WasmSignature instead of param and result vectors in TargetStreamer,
and leaves some TODOs for further simplification.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343733 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-03 22:22:48 +00:00
Heejin Ahn
581d231e61 [WebAssembly] clang-format (NFC)
Summary: This patch runs clang-format on all wasm-only files.

Reviewers: aardappel, dschuff, sunfish, tlively

Subscribers: MatzeB, sbc100, jgravelle-google, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341439 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-05 01:27:38 +00:00
Alexandre Ganea
0444f57668 [DebugInfo] Common behavior for error types
Following D50807, and heading towards D50664, this intermediary change does the following:

1. Upgrade all custom Error types in llvm/trunk/lib/DebugInfo/ to use the new StringError behavior (D50807).
2. Implement std::is_error_code_enum and make_error_code() for DebugInfo error enumerations.
3. Rename GenericError -> PDBError (the file will be renamed in a subsequent commit)
4. Update custom error messages to follow the same formatting: (\w\s*)+\.
5. Keep generic "file not found" (ENOENT) errors as they are in PDB code. Previously, there used to be a custom enumeration for that purpose.
6. Remove a few extraneous LF in log() implementations. Printing LF is a responsability at a higher level, not at the error level.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341228 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 17:41:58 +00:00
Sam Clegg
77b93b3504 Fix debug build by adding missing dependencies on libBinaryFormat
Debug BUILD_SHARED_LIBS build was broken by rL332305

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332315 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-15 00:46:43 +00:00
Peter Collingbourne
c0d9a0b316 obj2yaml: Correctly round-trip default alignment.
Previously we were emitting the "cooked" alignment, which made it hard
to distinguish between that and the default alignment.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331537 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-04 16:28:41 +00:00
Sam Clegg
db15975983 [WebAssembly] Write DWARF data into wasm object file
- Writes ".debug_XXX" into corresponding custom sections.
- Writes relocation records into "reloc.debug_XXX" sections.

Patch by Yury Delendik!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330982 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-26 19:27:28 +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
Rui Ueyama
0b9d56a30e Define InitLLVM to do common initialization all at once.
We have a few functions that virtually all command wants to run on
process startup/shutdown. This patch adds InitLLVM class to do that
all at once, so that we don't need to copy-n-paste boilerplate code
to each llvm command's main() function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330046 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-13 18:26:06 +00:00
Alexandre Ganea
2031cf6be1 [Debuginfo][COFF] Minimal serialization support for precompiled types records
This change adds support for the LF_PRECOMP and LF_ENDPRECOMP records required
to read/write Microsoft precompiled types .objs.
See https://en.wikipedia.org/wiki/Precompiled_header#Microsoft_Visual_C_and_C++

This also adds handling for the .debug$P section, which is actually a .debug$T
section in disguise, found only in precompiled .objs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329613 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09 20:17:56 +00:00
Nicholas Wilson
dc84b5c40c [WebAssembly] Identify COMDATs by index rather than string. NFC
This will enable an optimisation in LLD.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327522 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 15:44:45 +00:00
Sam Clegg
e14b24839c [WebAssembly] Remove DataSize from linking metadata section
Neither the linker nor the runtime need this information
anymore.  We were originally using this to model BSS size
but the plan is now to use the segment metadata to allow
for BSS segments.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326267 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27 23:57:37 +00:00
Sam Clegg
d5784797c6 [WebAssembly] Add first claass symbol table to wasm objects
This is combination of two patches by Nicholas Wilson:
  1. https://reviews.llvm.org/D41954
  2. https://reviews.llvm.org/D42495

Along with a few local modifications:
- One change I made was to add the UNDEFINED bit to the binary format
  to avoid the extra byte used when writing data symbols.  Although this
  bit is redundant for other symbols types (i.e. undefined can be
  implied if a function or global is a wasm import)
- I prefer to be explicit and consistent and not have derived flags.
- Some field renaming.
- Some reverting of unrelated minor changes.
- No test output differences.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325860 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-23 05:08:34 +00:00
Sam Clegg
bfa1dc6a7a [WebAssembly] MC: Remove unused code for handling of wasm globals
For now, we are not using wasm globals, except for modeling of
the stack points.

Alos, factor out common struct WasmGlobalType, which matches the
name for that tuple in the Wasm spec and rename methods
to "isBindingGlobal", "isTypeGlobal" to avoid ambiguity.

Patch by Nicholas Wilson!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323901 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-31 19:50:14 +00:00
Sam Clegg
eb7fd730fa [WebAssembly] Remove debug names from symbol table
Get rid of DEBUG_FUNCTION_NAME symbols. When we actually debug
data, maybe we'll want somewhere to put it... but having a symbol
that just stores the name of another symbol seems odd.
It means you have multiple Symbols with the same name, one
containing the actual function and another containing the name!

Store the names in a vector on the WasmObjectFile when reading
them in. Also stash them on the WasmFunctions themselves.
The names are //not// "symbol names" or aliases or anything,
they're just the name that a debugger should show against the
function body itself. NB. The WasmObjectFile stores them so that
they can be exported in the YAML losslessly, and hence the tests
can be precise.

Enforce that the CODE section has been read in before reading
the "names" section. Requires minor adjustment to some tests.

Patch by Nicholas Wilson!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322741 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-17 19:28:43 +00:00
Rui Ueyama
5a286a0041 Instead of ELFFile<ELFT>::Type, use ELFT::Type. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322346 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-12 02:28:31 +00:00
Sam Clegg
e92250ac8f [WebAssembly] Add COMDAT support
This adds COMDAT support to the Wasm object-file format.
Spec: https://github.com/WebAssembly/tool-conventions/pull/31

Corresponding LLD change:
https://bugs.llvm.org/show_bug.cgi?id=35533, and D40845

Patch by Nicholas Wilson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322135 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 23:43:14 +00:00
Sam Clegg
6b54fc31e5 [WebAssembly] Explicitly specify function/global index space in YAML
These indexes are useful because they are not always zero based and
functions and globals are referenced elsewhere by their index.

This matches what we already do for the type index space.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322121 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 21:38:53 +00:00
Sam Clegg
e1acb56f11 [WebAssembly] Add support for init functions linking metadata
Summary:
This change lays the groundwork lowering of @llvm.global_ctors
and @llvm.global_dtors for the wasm object format.  Some parts
of this patch are subset of: https://reviews.llvm.org/D40759

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320742 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 21:10:03 +00:00
Michael Zolotukhin
d770752b5c Remove redundant includes from tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320631 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 21:31:10 +00:00
Zachary Turner
8b348680b2 Update obj2yaml and yaml2obj for .debug$H section.
Differential Revision: https://reviews.llvm.org/D40842

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 18:58:48 +00:00
Dave Lee
9c5b799781 Add ELF dynamic symbol support to yaml2obj/obj2yaml
Summary:
This change introduces a `DynamicSymbols` field to the ELF specific YAML
supported by `yaml2obj` and `obj2yaml`. This grouping of symbols provides a way
to represent ELF dynamic symbols. The `DynamicSymbols` structure is identical to
the existing `Symbols`.

Reviewers: compnerd, jakehehrlich, silvas

Reviewed By: silvas

Subscribers: silvas, jakehehrlich, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 18:10:15 +00:00
Sam Clegg
e2864173a3 [WebAssembly] Allow each data segment to specify its own alignment
Also, add a flags field as we will almost certainly
be needing that soon too.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29 16:50:08 +00:00
Alexander Richardson
229871c696 [obj2yaml] Don't crash for input files without symbol table
Summary: Previously we would dereference Symtab without checking for null.

Reviewers: davide, atanasyan, rafael

Reviewed By: davide, atanasyan

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313970 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22 09:30:40 +00:00
Benjamin Kramer
3ef466f15f Add missing file from r313884.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 15:32:05 +00:00
Sam Clegg
b1dd7d6140 [WebAssembly] Add support for local symbol bindings
Differential Revision: https://reviews.llvm.org/D38096

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 21:17:04 +00:00
Sam Clegg
81e3824428 Reland "[WebAssembly] Add support for naming wasm data segments"
Add adds support for naming data segments.  This is useful
useful linkers so that they can merge similar sections.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 19:03:35 +00:00
Mike Edwards
097fb8c422 Reverting due to Green Dragon bot failure.
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42594/


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 01:21:02 +00:00
Sam Clegg
e5c43345fb [WebAssembly] Add support for naming wasm data segments
Add adds support for naming data segments.  This is useful
useful linkers so that they can merge similar sections.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 23:00:57 +00:00
Rafael Espindola
aee6db7db7 Use the section name if a STT_SECTION symbol has empty name.
Without this we would have multiple relocations pointing to symbols
with the same name: the empty string. There was no way for yaml2obj to
be able to handle that.

A more general solution would be to unique symbol names in a similar
way to how we unique section names.  In practice I think this covers
all common cases and is a bit more user friendly than using names like
sym1, sym2, sym3, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312603 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06 00:57:53 +00:00
Rafael Espindola
3656c75e61 Fix a use after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312590 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05 23:00:51 +00:00
Rafael Espindola
ef318e5ebe obj2yaml: Print unique section names.
Without this patch passing a .o file with multiple sections with the
same name to obj2yaml produces a yaml file that yaml2obj cannot
handle. This is pr34162.

The problem is that when specifying, for example, the section of a
symbol, we get only

Section: foo

and don't know which of the sections whose name is foo we have to use.

One alternative would be to use section numbers. This would work, but
the output from obj2yaml would be very inconvenient to edit as
deleting a section would invalidate all indexes.

Another alternative would be to invent a unique section id that would
exist only on yaml. This would work, but seems a bit heavy handed. We
could make the id optional and default it to the section name.

Since in the last alternative the id is basically what this patch uses
as a name, it can be implemented as a followup patch if needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312585 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05 22:30:00 +00:00
Rafael Espindola
ee809acd59 Use delegation instead of inheritance.
This changes DwarfContext to delegate to DwarfObject instead of having
pure virtual methods.

With this DwarfContextInMemory is replaced with an implementation of
DwarfObject that is local to a .cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19 22:27:28 +00:00
Sam Clegg
c9c28d96fa [WebAssembly] Expose the offset of each data segment
Summary:
This allows tools like lld that process relocations
to apply data relocation correctly. This information
is required because relocation are stored as section
offset.

Subscribers: jfb, dschuff, jgravelle-google, aheejin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307741 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 00:24:54 +00:00
Sam Clegg
49ab5d5992 [WebAssembly] Add data size and alignement to linking section
The overal size of the data section (including BSS)
is otherwise not included in the wasm binary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 20:27:59 +00:00
Sam Clegg
1e975c1249 [WebAssembly] Add support for weak symbols in the binary format
This also introduces the updated format for the
"linking" section which can represent extra
symbol information.  See:
https://github.com/WebAssembly/tool-conventions/pull/10

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305769 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20 04:04:59 +00:00
Sam Clegg
b856c16f91 obj2yaml: Improve error reporting
Previously only the error codes were reported which
meant that useful information about malformed inputs
was not shown.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305609 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-16 23:29:54 +00:00
Zachary Turner
63d2fab3cf Resubmit "[codeview] Make obj2yaml/yaml2obj support .debug$S..."
This was originally reverted because of some non-deterministic
failures on certain buildbots.  Luckily ASAN eventually caught
this as a stack-use-after-scope, so the fix is included in
this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 15:59:27 +00:00
Zachary Turner
76c210df33 Revert "[codeview] Make obj2yaml/yaml2obj support .debug$S..."
This is causing failures on linux bots with an invalid stream
read.  It doesn't repro in any configuration on Windows, so
reverting until I have a chance to investigate on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305371 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 06:24:24 +00:00
Zachary Turner
16e473d50a [codeview] Make obj2yaml/yaml2obj support .debug$S/T sections.
This allows us to use yaml2obj and obj2yaml to round-trip CodeView
symbol and type information without having to manually specify the bytes
of the section. This makes for much easier to maintain tests. See the
tests under lld/COFF in this patch for example. Before they just said
SectionData: <blob> whereas now we can use meaningful record
descriptions. Note that it still supports the SectionData yaml field,
which could be useful for initializing a section to invalid bytes for
testing, for example.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305366 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 05:31:00 +00:00
Zachary Turner
19ca2b0f9d Move Object format code to lib/BinaryFormat.
This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 03:48:56 +00:00
Wolfgang Pieb
c9977b6aa4 [DWARF] Adding support for the DWARF v5 string offsets table (consumer/reader part only).
Reviewers: dblaikie, aprantl

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304759 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 01:22:34 +00:00
Galina Kistanova
e0a34d1987 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304273 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 01:54:18 +00:00
Sam Clegg
bde17ff28a [WebAssembly] Fix build error in wasm YAML code
This warning didn't show up on my local build
but is causing the bots to fail.  Seems like a
bad idea to have types and variables with the
same name anyhow.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 00:14:04 +00:00
Sam Clegg
65e284ec3b [WebAssembly] Improve libObject support for wasm imports and exports
Previously we had only supported the importing and
exporting of functions and globals.

Also, add usefull overload of getWasmSymbol() and
getNumberOfSymbols() in support of lld port.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302601 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09 23:48:41 +00:00
Sam Clegg
afe8111c69 [WebAssembly] Add ObjectYAML support for wasm name section
Differential Revision: https://reviews.llvm.org/D32841

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302266 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 18:12:34 +00:00
Derek Schuff
349a48fadd [WebAssembly] Improve support for WebAssembly binary format
Mostly this change adds support converting to and from
YAML which will allow us to write more test cases for
the WebAssembly MC and lld ports.

Better support for objdump, readelf, and nm will be in
followup CLs.

I had to update the two wasm test binaries because they
used the old style 'name' section which is no longer
supported.

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

Patch by Sam Clegg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299101 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 19:44:09 +00:00