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

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 20:04:28 PST 2020


sbc100 created this revision.
Herald added subscribers: llvm-commits, wingo, ecnelises, jfb, sunfish, jgravelle-google, dschuff.
Herald added a project: LLVM.
sbc100 requested review of this revision.
Herald added a subscriber: aheejin.

Previously we limited the use of atomics and TLS to programs
linked with `--shared-memory`.

However, as of https://reviews.llvm.org/D79530 we now allow
programs that use atomic to be linked without `--shared-memory`.
For this to be useful we also want to all TLS usage in such
programs.  In this case, since we know we are single threaded
we simply include the TLS data as a regular active segment
and create an immutable `__tls_base` global that point to the
start of this segment.

Fixes: https://github.com/emscripten-core/emscripten/issues/12489


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91115

Files:
  lld/test/wasm/tls-no-shared.s
  lld/wasm/Driver.cpp
  lld/wasm/SymbolTable.cpp
  lld/wasm/SymbolTable.h
  lld/wasm/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91115.304030.patch
Type: text/x-patch
Size: 9056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201110/477aaf83/attachment.bin>


More information about the llvm-commits mailing list