[lld][WebAssembly] Split __wasm_apply_relocs function in two
We have two types of relocations that we apply on startup: 1. Relocations that apply to wasm globals 2. Relocations that apply to wasm memory The first set of relocations use only the `__memory_base` import to update a set of internal globals. Because wasm globals are thread local these need to run on each thread. Memory relocations, like static constructors, must only be run once. To ensure global relocations run on all threads and because the only depend on the immutable `__memory_base` import we can run them during the WebAssembly start functions, instead of waiting until the post-instantiation __wasm_call_ctors. Differential Revision: https://reviews.llvm.org/D93066
Loading
Please sign in to comment