[WebAssembly] Honor --allow-undefined even for explicit exports
authorSam Clegg <sbc@chromium.org>
Thu, 8 Mar 2018 01:16:05 +0000 (01:16 +0000)
committerSam Clegg <sbc@chromium.org>
Thu, 8 Mar 2018 01:16:05 +0000 (01:16 +0000)
commit7f8141818358375cc626fc7e4779d61e39ee9276
tree9da206b5b7e4f82e37dfced337d39367905d3d32
parentfb2d34229941a32666bec8ca96ba3beb703ed188
[WebAssembly] Honor --allow-undefined even for explicit exports

When a symbol is exported via --export=foo but --allow-undefined
is also specified, the symbol is now allowed to be undefined.
Previously we were special casing such symbols.

This combinations of behavior is exactly what emescripten
requires. Although we are trying hard not to allow emscripten
specific features in lld, this one makes sense.

Enforce this behavior by added this case to test/wasm/undefined.ll.

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

llvm-svn: 326976
lld/test/wasm/undefined.ll
lld/wasm/Driver.cpp