[PATCH] D108877: [WebAssembly] Allow import and export of TLS symbols between DSOs

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 05:06:10 PDT 2021


sbc100 added inline comments.


================
Comment at: lld/wasm/SyntheticSections.cpp:79
+  for (const Symbol *sym : out.importSec->importedSymbols) {
+    if (sym->isWeak()) {
+      importInfo.push_back(sym);
----------------
tlively wrote:
> Why do we check `sym->isTLS()` for exports but not for imports?
I'm getting ahead of myself here.   The TLS flag is needed when exporting (since we need to tell the dynamic linker to adjust the exported value according to the tls base).  

However for imports we don't need to know if a given global is TLS or not since all the GOT.mem imports are of absolute values (its up to the dynamic linker to ensure they are all absolute addresses).

For imports however, we are going to need to tell the dynamic linker about which imports are weak (so it can provide 0 and not error out).

I think I will completely remove IMPORT_INFO from this change since its not used yet.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108877



More information about the llvm-commits mailing list