[lld] [WebAssembly] Generate a call to __wasm_apply_global_tls_relocs in __wasm_init_memory (PR #149832)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 21 22:17:42 PDT 2025


Arshia001 wrote:

@sbc100

> it cannot be called during the start function:

I can't think of anything, except the fact that it needs `__tls_base` to be initialized before it can work. Maybe, at some point, `__tls_base` wasn't initialized in `__wasm_init_memory`, and nobody updated that comment after this behavior changed? I'll dig into the commit history to see if I can figure this out.

In the meantime, do you have other suggestions on how to fix this? I suppose making `__wasm_apply_global_tls_relocs` public would at least allow it to be called from the WASIX module's `_start` function.

https://github.com/llvm/llvm-project/pull/149832


More information about the llvm-commits mailing list