[lld][WebAssembly] Allow exporting of mutable globals
authorSam Clegg <sbc@chromium.org>
Fri, 31 Jul 2020 00:44:32 +0000 (17:44 -0700)
committerSam Clegg <sbc@chromium.org>
Thu, 1 Oct 2020 00:53:27 +0000 (17:53 -0700)
commit3c45a06f26edfb7e94003adf58cb8951ea9c2ce6
treeb02104706bd41893f7ec09667328ba8dfa5eb5cb
parent93a1fc2e18b452216be70f534da42f7702adbe1d
[lld][WebAssembly] Allow exporting of mutable globals

In particular allow explict exporting of `__stack_pointer` but
exclud this from `--export-all` to avoid requiring the mutable
globals feature whenenve `--export-all` is used.

This uncovered a bug in populateTargetFeatures regarding checking
if the mutable-globals feature is allowed.

See: https://github.com/WebAssembly/binaryen/issues/2934

Differential Revision: https://reviews.llvm.org/D88506
lld/docs/WebAssembly.rst
lld/test/wasm/mutable-global-exports.s [new file with mode: 0644]
lld/test/wasm/mutable-globals.s
lld/wasm/Writer.cpp