aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-11-10 17:46:52 -0800
committerSam Clegg <sbc@chromium.org>2020-11-13 07:59:29 -0800
commita28a466210199559d38251c11f30515cc83eadd6 (patch)
treef3b16673063e5964614ba875fa5f47d18fb23575 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parent0fd6a04ba4dbf039fbd11eca29886d9d06bc736a (diff)
downloadllvm-a28a466210199559d38251c11f30515cc83eadd6.zip
llvm-a28a466210199559d38251c11f30515cc83eadd6.tar.gz
llvm-a28a466210199559d38251c11f30515cc83eadd6.tar.bz2
[WebAssembly] Add new relocation type for TLS data symbols
These relocations represent offsets from the __tls_base symbol. Previously we were just using normal MEMORY_ADDR relocations and relying on the linker to select a segment-offset rather and absolute value in Symbol::getVirtualAddress(). Using an explicit relocation type allows allow us to clearly distinguish absolute from relative relocations based on the relocation information alone. One place this is useful is being able to reject absolute relocation in the PIC case, but still accept TLS relocations. Differential Revision: https://reviews.llvm.org/D91276
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index 78acc2a..71e8e14 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -277,10 +277,9 @@ private:
bool stripThreadLocals(Module &M) {
bool Stripped = false;
for (auto &GV : M.globals()) {
- if (GV.getThreadLocalMode() !=
- GlobalValue::ThreadLocalMode::NotThreadLocal) {
+ if (GV.isThreadLocal()) {
Stripped = true;
- GV.setThreadLocalMode(GlobalValue::ThreadLocalMode::NotThreadLocal);
+ GV.setThreadLocal(false);
}
}
return Stripped;