[lld] [WebAssembly] Generate a call to __wasm_apply_global_tls_relocs in __wasm_init_memory (PR #149832)
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 18 11:00:34 PST 2025
sbc100 wrote:
> I also wonder about `__wasm_apply_tls_relocs` being private... `__wasm_apply_data_relocs` is already public and I understand linkers are supposed to call it. What's special about `__wasm_apply_tls_relocs` that it gets a different treatment?
We already have have the exported `__wasm_init_tls` function which takes care of calling `__wasm_apply_data_relocs`. I don't see why we would want to complicate things by also exporting `__wasm_apply_data_relocs` separately.
I sorry, I don't understand your reasoning for not wanting to explictly call `__wasm_init_tls` on the main thread. Why is the downside to doing that?
Assuming we do enable the export of the currently-internal `__wasm_apply_data_relocs`, wouldn't you need to call that function in the exact same place that I claim you should be calling `__wasm_init_tls`? i.e. on every thread, including the main thread after all modules have been loaded and all symbols resolved.
https://github.com/llvm/llvm-project/pull/149832
More information about the llvm-commits
mailing list