[PATCH] D130053: [WebAssembly] Use `localexec` as default TLS model for non-Emscripten targets

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 07:06:48 PDT 2022


sbc100 added a comment.

In D130053#3675183 <https://reviews.llvm.org/D130053#3675183>, @penzn wrote:

> Out of curiosity, why disabling bulk memory disables TLS? Couldn't find why that is the case in tools conventions.

Because TLS data is stored a "passive" segment which has to be loaded using the `memory.init` instruction.  (Both passive segments and this instruction are part of the bulk-memory proposal).

Here is the memory.init instruction being output by the linker: https://github.com/llvm/llvm-project/blob/07aa8fc8db6b4b8581e0ba8ef4a66274023c0b59/lld/wasm/Writer.cpp#L1439


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130053/new/

https://reviews.llvm.org/D130053



More information about the llvm-commits mailing list