[lld][WebAssembly] Don't allow `--global-base` to be specified in -share/-pie or...
authorSam Clegg <sbc@chromium.org>
Mon, 17 Oct 2022 23:26:54 +0000 (16:26 -0700)
committerSam Clegg <sbc@chromium.org>
Wed, 19 Oct 2022 00:19:26 +0000 (17:19 -0700)
commit6912ed7b8fe6db32850b71dce209a287fc4253f6
treeb9464ef799965a61b5e9ed25b905e52e769af553
parent0f374ca5cd1d194067c46d13b1df7c4eb068d57a
[lld][WebAssembly] Don't allow `--global-base` to be specified in -share/-pie or --relocatable modes

Add some checks around this combination of flags

Also, honor `--global-base` when specified in `--stack-first` mode
rather than ignoring it.  But error out if the specified base preseeds
the end of the stack.

Differential Revision: https://reviews.llvm.org/D136117
lld/test/wasm/global-base.test
lld/wasm/Driver.cpp
lld/wasm/Writer.cpp