[wasm-ld] Define a `__heap_end` symbol marking the end of allocated memory.
authorDan Gohman <dev@sunfishcode.online>
Mon, 17 Oct 2022 20:36:19 +0000 (13:36 -0700)
committerDan Gohman <dev@sunfishcode.online>
Mon, 17 Oct 2022 23:39:06 +0000 (16:39 -0700)
commit4b24e9be175d75c92e5adb40622fd7524abcef60
treeecfba49240054621760cfcc4d46e8b351a94feab
parent308b4bca14ffb8d97075dbb653ba96c632406a78
[wasm-ld] Define a `__heap_end` symbol marking the end of allocated memory.

Define a `__heap_end` symbol that marks the end of the memory region
that starts at `__heap_base`. This will allow malloc implementations to
know how much memory they can use at `__heap_base` even if someone has
done a `memory.grow` before they can initialize their state.

Differential Revision: https://reviews.llvm.org/D136110
lld/test/wasm/export-all.s
lld/test/wasm/mutable-global-exports.s
lld/wasm/Driver.cpp
lld/wasm/Symbols.cpp
lld/wasm/Symbols.h
lld/wasm/Writer.cpp