Skip to content

[lld][WebAssembly] Refine type used for internal TLS-related symbols. NFC - #200899

Merged
sbc100 merged 1 commit into
llvm:mainfrom
sbc100:tlsBase
Jun 1, 2026
Merged

sbc100 merged 1 commit into
llvm:mainfrom
sbc100:tlsBase

Conversation

@sbc100

@sbc100 sbc100 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

I noticed this while reviewing #200855.

@llvmorg-github-actions

llvmorg-github-actions Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

@llvm/pr-subscribers-lld

@llvm/pr-subscribers-lld-wasm

Author: Sam Clegg (sbc100)

Changes

I noticed this while reviewing #200855.


Full diff: https://github.com/llvm/llvm-project/pull/200899.diff

2 Files Affected:

  • (modified) lld/wasm/Config.h (+1-1)
  • (modified) lld/wasm/Writer.cpp (+1-2)
diff --git a/lld/wasm/Config.h b/lld/wasm/Config.h
index 71a378a412e9e..325192facd8f2 100644
--- a/lld/wasm/Config.h
+++ b/lld/wasm/Config.h
@@ -166,7 +166,7 @@ struct Ctx {
     // __tls_base
     // Global that holds the address of the base of the current thread's
     // TLS block.
-    GlobalSymbol *tlsBase;
+    DefinedGlobal *tlsBase;
 
     // __tls_size
     // Symbol whose value is the size of the TLS block.
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 688bb829e1c42..b06cac1b16ba2 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -426,8 +426,7 @@ void Writer::layoutMemory() {
   // referenced (for example by __builtin_thread_pointer, which should not
   // return NULL).
   if (!ctx.arg.sharedMemory && ctx.sym.tlsBase) {
-    auto *tlsBase = cast<DefinedGlobal>(ctx.sym.tlsBase);
-    setGlobalPtr(tlsBase, fixedTLSBase);
+    setGlobalPtr(ctx.sym.tlsBase, fixedTLSBase);
   }
 
   // Make space for the memory initialization flag

@sbc100 sbc100 changed the title [lld][WebAssembly] Refine type of tlsBase symbol. NFC [lld][WebAssembly] Refine type used for internal TLS-related symbols. NFC Jun 1, 2026
@sbc100
sbc100 merged commit 7ccb0ed into llvm:main Jun 1, 2026
8 checks passed
@sbc100
sbc100 deleted the tlsBase branch June 1, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants