mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
[wasm-ld] Add __global_base symbol to mark the value of --global-base
Summary: This is needed for address sanitizer on Emscripten. As everything in memory starts at the value passed to --global-base, everything before that can be used as shadow memory. This symbol is added so that the library for the ASan runtime can know where the shadow memory ends and real memory begins. This is split from D63742. Reviewers: tlively, aheejin, sbc100 Subscribers: sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63833 llvm-svn: 364467
This commit is contained in:
@@ -224,6 +224,9 @@ void Writer::layoutMemory() {
|
||||
log("mem: global base = " + Twine(Config->GlobalBase));
|
||||
}
|
||||
|
||||
if (WasmSym::GlobalBase)
|
||||
WasmSym::GlobalBase->setVirtualAddress(Config->GlobalBase);
|
||||
|
||||
uint32_t DataStart = MemoryPtr;
|
||||
|
||||
// Arbitrarily set __dso_handle handle to point to the start of the data
|
||||
|
||||
Reference in New Issue
Block a user