diff options
author | Sam Clegg <sbc@chromium.org> | 2020-11-10 17:46:52 -0800 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2020-11-13 07:59:29 -0800 |
commit | a28a466210199559d38251c11f30515cc83eadd6 (patch) | |
tree | f3b16673063e5964614ba875fa5f47d18fb23575 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
parent | 0fd6a04ba4dbf039fbd11eca29886d9d06bc736a (diff) | |
download | llvm-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.cpp | 5 |
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; |