[lld][WebAssembly] With `--stack-first` as default, it's unintuitive to reserve a segment of memory at the start of the linear memory
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
[tic-80#2880](https://github.com/nesbox/TIC-80/issues/2880) gives some relevant context. Before #151015 , projects like TIC-80 and WASM4 often used `--global-base` to specify a reserved section of linear memory that was shared with the host, akin to memory-mapped I/O. Now with `--stack-first`, the stack is still put before `--global-base`, which causes projects that had worked before to break when linked with newer versions of lld. This can be worked around by explicitly setting `--stack-first` (for older versions) and setting your stack big enough to encompass the entire reserved space + desired stack size, but that's not extremely intuitive (and I worry about future changes in the layout still breaking after the fact).
For these kinds of situations, it would be nice if there was something like `--stack-base`, or `--memory-base` to allow more easily reserving a host memory range.
Contributor guide
Assessment
This issue has not been assessed yet.