aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/WasmObjectWriter.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2021-08-26 15:29:32 -0400
committerSam Clegg <sbc@chromium.org>2021-09-14 06:47:37 -0700
commitef8c9135efcb3847fc0e5bbdb55eae18751090df (patch)
treee309496d229bfb1f249f830e9df05f33b1f895cf /llvm/lib/MC/WasmObjectWriter.cpp
parent5041a485b948e55e54338779f2248c45402b0ae7 (diff)
downloadllvm-ef8c9135efcb3847fc0e5bbdb55eae18751090df.zip
llvm-ef8c9135efcb3847fc0e5bbdb55eae18751090df.tar.gz
llvm-ef8c9135efcb3847fc0e5bbdb55eae18751090df.tar.bz2
[WebAssembly] Allow import and export of TLS symbols between DSOs
We previously had a limitation that TLS variables could not be exported (and therefore could also not be imported). This change removed that limitation. Differential Revision: https://reviews.llvm.org/D108877
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index 2d16c37..25400c3 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -565,8 +565,14 @@ void WasmObjectWriter::recordRelocation(MCAssembler &Asm,
SymA->setUsedInReloc();
}
- if (RefA->getKind() == MCSymbolRefExpr::VK_GOT)
+ switch (RefA->getKind()) {
+ case MCSymbolRefExpr::VK_GOT:
+ case MCSymbolRefExpr::VK_WASM_GOT_TLS:
SymA->setUsedInGOT();
+ break;
+ default:
+ break;
+ }
WasmRelocationEntry Rec(FixupOffset, SymA, C, Type, &FixupSection);
LLVM_DEBUG(dbgs() << "WasmReloc: " << Rec << "\n");