[PATCH] D91115: [lld][WebAssembly] Allow references to __tls_base without shared memory

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 11:39:58 PST 2020


tlively added inline comments.


================
Comment at: lld/wasm/Driver.cpp:659
+  // we allow object files built with TLS to be linked into single threaded
+  // programs.
+  //
----------------
It might be useful to say why we don't also need to define `__tls_size` and `__tls_align` in this case and also why `__tls_base` can be optional in this case but not in the shared case.


================
Comment at: lld/wasm/Driver.cpp:661-662
+  //
+  // However in this case __tls_base is immutable points to part of the
+  // static data region.
+  if (!config->sharedMemory)
----------------
Not sure about the line wrapping here.


================
Comment at: lld/wasm/Driver.cpp:664
+  if (!config->sharedMemory)
+    WasmSym::tlsBase = createOptionalGlobal("__tls_base", false, 0);
 }
----------------
Is `0` the start of the static data region?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91115



More information about the llvm-commits mailing list