[lld][WebAssembly] Honor --allow-undefined for data symbols too
authorSam Clegg <sbc@chromium.org>
Fri, 1 May 2020 17:00:53 +0000 (10:00 -0700)
committerSam Clegg <sbc@chromium.org>
Wed, 6 May 2020 19:39:29 +0000 (12:39 -0700)
commitf03b6e785b3469742b9853d855a6e9e81960af0a
tree32b710eec664f14e1077e1452c62b566f3136b24
parentcfce9b67609f4d2c91ac9c6ab51931769903a560
[lld][WebAssembly] Honor --allow-undefined for data symbols too

This was originally the way this worked before before
https://reviews.llvm.org/D60882.

In retrospect it seems inconsistent that `--allow-undefined` doesn't
work for all symbols.  See:
https://groups.google.com/g/emscripten-discuss/c/HSRgQiIq1gI/m/Kt9oFWHiAwAJ

I'm also planning a followup change which implement the full
`--unresolved-symbols=..` flags supported by ELF linkers (both ld and
ld.lld) since it seems more standard.

Differential Revision: https://reviews.llvm.org/D79247
lld/test/wasm/undefined-data.ll
lld/wasm/Relocations.cpp