114 Commits

Author SHA1 Message Date
George Rimar
04c501607e [yaml2obj/ObjectYAML] - Cleanup the error reporting API, add custom errors handlers.
This is a continuation of the YAML library error reporting
refactoring/improvement and the idea by itself was mentioned
in the following thread:
https://reviews.llvm.org/D67182?id=218714#inline-603404

This performs a cleanup of all object emitters in the library.
It allows using the custom one provided by the caller.

One of the nice things is that each tool can now print its tool name,
e.g: "yaml2obj: error: <text>"

Also, the code became a bit simpler.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371865 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 16:00:16 +00:00
Vitaly Buka
6f01631817 [ObjectYAML] Fix lifetime issue in dumpDebugLines
Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370289 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-29 02:36:48 +00:00
Seiya Nuta
c134f2724c [yaml2obj/obj2yaml][MachO] Fix a test failure in big endian hosts
These section contents are dummy data (0xdeadbeef) and it's endianess
does not matter.

- http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/37265

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369360 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 09:58:31 +00:00
Seiya Nuta
10743447fa [yaml2obj/obj2yaml][MachO] Allow setting custom section data
Reviewers: alexshap, jhenderson, rupprecht

Reviewed By: alexshap, jhenderson

Subscribers: abrachet, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369348 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 08:49:07 +00:00
Seiya Nuta
f99a09c3b0 [yaml2obj][MachO] Don't fill dummy data for virtual sections
Summary:
Currently, MachOWriter::writeSectionData writes dummy data (0xdeadbeef) to fill section data areas in the file even if the section is a virtual one. Since virtual sections don't occupy any space in the file, writing dummy data could results the  "OS.tell() - fileStart <= Sec.offset" assertion failure.

This patch fixes the bug by simply not writing any dummy data for virtual sections.

Reviewers: beanz, jhenderson, rupprecht, alexshap

Reviewed By: alexshap

Subscribers: compnerd, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363525 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 02:07:20 +00:00
Fangrui Song
a60f216744 [llvm-readobj] Change -long-option to --long-option in tests. NFC
We use both -long-option and --long-option in tests. Switch to --long-option for consistency.

In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf.

While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359649 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 05:27:20 +00:00
Thomas Lively
39812314f7 [WebAssembly] Target features section
Summary:
Implements a new target features section in assembly and object files
that records what features are used, required, and disallowed in
WebAssembly objects. The linker uses this information to ensure that
all objects participating in a link are feature-compatible and records
the set of used features in the output binary for use by optimizers
and other tools later in the toolchain.

The "atomics" feature is always required or disallowed to prevent
linking code with stripped atomics into multithreaded binaries. Other
features are marked used if they are enabled globally or on any
function in a module.

Future CLs will add linker flags for ignoring feature compatibility
checks and for specifying the set of allowed features, implement using
the presence of the "atomics" feature to control the type of memory
and segments in the linked binary, and add front-end flags for
relaxing the linkage policy for atomics.

Reviewers: aheejin, sbc100, dschuff

Subscribers: jgravelle-google, hiraditya, sunfish, mgrang, jfb, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356610 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 20:26:45 +00:00
Thomas Lively
fa82617e41 [WebAssembly] Update MC for bulk memory
Summary:
Rename MemoryIndex to InitFlags and implement logic for determining
data segment layout in ObjectYAML and MC. Also adds a "passive" flag
for the .section assembler directive although this cannot be assembled
yet because the assembler does not support data sections.

Reviewers: sbc100, aardappel, aheejin, dschuff

Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354397 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-19 22:56:19 +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
Thomas Lively
6997360500 [WebAssembly] Parse llvm.ident into producers section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351413 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-17 02:29:55 +00:00
Thomas Lively
017cb3b47a Revert "[WebAssembly] Parse llvm.ident into producers section"
This reverts commit eccdbba3a02a33e13b5262e92200a33e2ead873d.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351410 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-17 00:39:49 +00:00
Thomas Lively
19ea6650b4 [WebAssembly] Parse llvm.ident into producers section
Summary:
Everything before the word "version" is the tool, and everything after
the word "version" is the version.

Reviewers: aheejin, dschuff

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351399 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 23:46:14 +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
Thomas Lively
37a984b8bc [WebAssembly] Massive instruction renaming
Summary:
An automated renaming of all the instructions listed at
https://github.com/WebAssembly/spec/issues/884#issuecomment-426433329
as well as some similarly-named identifiers.

Reviewers: aheejin, dschuff, aardappel

Subscribers: sbc100, jgravelle-google, eraman, sunfish, jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350609 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 06:25:55 +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
Sam Clegg
559201d0d7 [WebAssembly] Update dylink section parsing
This updates the format of the dylink section in accordance with
recent "spec" change:
  https://github.com/WebAssembly/tool-conventions/pull/77

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348989 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 23:40:58 +00:00
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
Derek Schuff
992cf17563 [WebAssembly] Add shared memory support to limits field
Support the IS_SHARED bit in the memory limits flag word.
The compiler does not create object files with memory definitions,
but the field is used by the linker.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346246 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-06 17:27:25 +00:00
Zachary Turner
d5e155bacd Make YAML quote forward slashes.
If you have the string /usr/bin, prior to this patch it would not
be quoted by our YAML serializer.  But a string like C:\src would
be, due to the presence of a backslash.  This makes the quoting
rules of basically every single file path different depending on
the path syntax (posix vs. Windows).

While technically not required by the YAML specification to quote
forward slashes, when the behavior of paths is inconsistent it
makes it difficult to portably write FileCheck lines that will
work with either kind of path.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344359 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 16:31:20 +00:00
Zachary Turner
7b3c188641 Revert "Make YAML quote forward slashes."
This reverts commit b86c16ad8c97dadc1f529da72a5bb74e9eaed344.

This is being reverted because I forgot to write a useful
commit message, so I'm going to resubmit it with an actual
commit message.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344358 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 16:31:08 +00:00
Zachary Turner
185de913d5 Make YAML quote forward slashes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344357 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 16:24:09 +00:00
Zachary Turner
b26b734118 Resubmit [pdb] Change /DEBUG:GHASH to emit 8 byte hashes."
This fixes the remaining failing tests, so resubmitting with no
functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332676 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 22:55:15 +00:00
Zachary Turner
761b193f29 Revert "[pdb] Change /DEBUG:GHASH to emit 8 byte hashes."
A few tests haven't been properly updated, so reverting while
I have time to investigate proper fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332672 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 21:49:25 +00:00
Zachary Turner
d0e6e5a36e [pdb] Change /DEBUG:GHASH to emit 8 byte hashes.
Previously we emitted 20-byte SHA1 hashes.  This is overkill
for identifying debug info records, and has the negative side
effect of making object files bigger and links slower.  By
using only the last 8 bytes of a SHA1, we get smaller object
files and ~10% faster links.

This modifies the format of the .debug$H section by adding a new
value for the hash algorithm field, so that the linker will still
work when its object files have an old format.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332669 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 21:22:48 +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
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
b068ce98cd [WebAssembly] libObject: Don't include the name the size of custom sections
Differential Revision: https://reviews.llvm.org/D45579

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329947 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 20:31:12 +00:00
Nicholas Wilson
44818a31b7 [WebAssembly] Disallow weak undefined globals in the object format
This implements https://github.com/WebAssembly/tool-conventions/pull/47

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327146 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09 16:30:44 +00:00
Nicholas Wilson
e0316ce24e [WebAssembly] Add validation to reloc section
We now check relocations offsets are within range, and the relocation
index is valid.

Also updated tests which contained invalid Wasm files that were
previously not checked.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326697 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-05 13:32:38 +00:00
Nicholas Wilson
a60bc625ce [WebAssembly] Fix tests with invalid yaml (required CODE section missing)
Differential Revision: https://reviews.llvm.org/D44023

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326692 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-05 12:28:01 +00:00
Nicholas Wilson
22b62dafe4 [WebAssembly] Check function type indexes
Also update tests containing invalid Wasm files, exposed by the check

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326577 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-02 14:35:29 +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
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
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
Sam Clegg
8764e8a227 [WebAssembly] Use bitfield types in wasm YAML representation
Differential Revision: https://reviews.llvm.org/D41202

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320642 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 22:02:25 +00:00
Sam Clegg
2b46be6545 [WebAssembly] Add linking metatdata test coverage for wasm2yaml
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 21:53:40 +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
Shoaib Meenai
3a2d5b5100 [ObjectYAML] Handle SHF_COMPRESSED
This was previously being silently dropped by obj2yaml and caused
parsing errors with yaml2obj.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314768 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-03 06:35:55 +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
Sam Clegg
8b020d7228 [WebAssembly] Update relocation names to match spec
Summary: See https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-01 17:32:01 +00:00
Sam Clegg
209d3c2d39 [WebAssembly] Validate exports when parsing object files
Subscribers: jfb, dschuff, jgravelle-google, aheejin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312286 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 21:43:45 +00:00
Reid Kleckner
5c238d611e [codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueId
Summary:
We were treating the GUIDs in TypeServer2Record as strings, and the
non-ASCII bytes in the GUID would not round-trip through YAML.

We already had the PDB_UniqueId type portably represent a Windows GUID,
but we need to hoist that up to the DebugInfo/CodeView library so that
we can use it in the TypeServer2Record as well as in PDB parsing code.

Reviewers: inglorion, amccarth

Subscribers: llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-17 23:59:44 +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
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