Commit Graph

9 Commits

Author SHA1 Message Date
Sam Clegg 0362633fd2 [WebAssembly] Add support for --gc-sections
In this initial version we only GC symbols with `hidden` visibility since
other symbols we export to the embedder.

We could potentially modify this the future and only use symbols
explicitly passed via `--export` as GC roots.

This version of the code only does GC of data and code. GC for the
types section is coming soon.

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

llvm-svn: 323842
2018-01-31 01:45:47 +00:00
Sam Clegg b839f1590e [WebAssembly] Sort options in `Options.td`. NFC.
Differential Revision: https://reviews.llvm.org/D42627

llvm-svn: 323624
2018-01-28 19:57:04 +00:00
Sam Clegg ff2b12216b [WebAssembly] Remove --emit-relocs
This was added to mimic ELF, but maintaining it has cost
and we currently don't have any use for it outside of the
test code.

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

llvm-svn: 323154
2018-01-22 21:55:43 +00:00
Sam Clegg 2a06afae16 [WebAssembly] Add --export flag to force a symbol to be exported
This is useful for emscripten or other tools that want to
selectively exports symbols without necessarily changing the
source code.

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

llvm-svn: 322408
2018-01-12 22:10:35 +00:00
Sam Clegg 2c096bacc6 [WebAssembly] Add --no-entry argument
This adds a `--no-entry` argument to wasm LLD used to
suppress the default `_start` entry point.

Patch by Nicholas Wilson!

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

llvm-svn: 320167
2017-12-08 17:58:25 +00:00
Sam Clegg 31de2f0ccf [WebAssembly] Add -u/--undefined argument handling
Adds a new argument to wasm-lld, `--undefined`, with
similar semantics to the ELF linker. It pulls in symbols
from files contained within a `.a` archive, forcing them
to be included even if the translation unit would not
otherwise be pulled in.

Patch by Nicholas Wilson

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

llvm-svn: 320004
2017-12-07 03:19:53 +00:00
Sam Clegg 3b4a475c37 [WebAssembly] Remove used --sysroot option
Differential Revision: https://reviews.llvm.org/D40771

llvm-svn: 319805
2017-12-05 18:13:45 +00:00
Sam Clegg b862159683 [WebAssembly] Allow function signature checking at link time
This change allows checking of function signatures but
does not yes enable it by default.  In this mode, linking
two objects that were compiled with a different signatures
for the same function will produce a link error.

New options for enabling and disabling this feature have been
added: (--check-signatures/--no-check-signatures).

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

llvm-svn: 319396
2017-11-30 01:40:08 +00:00
Sam Clegg c94d393ad5 [WebAssembly] Initial wasm linker implementation
This linker backend is still a work in progress but is
enough to link simple programs including linking against
library archives.

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

llvm-svn: 318539
2017-11-17 18:14:09 +00:00