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/BinaryFormat/Wasm.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/BinaryFormat/Wasm.cpp')
-rw-r--r-- | llvm/lib/BinaryFormat/Wasm.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/BinaryFormat/Wasm.cpp b/llvm/lib/BinaryFormat/Wasm.cpp index 19dce2b..a22ab58 100644 --- a/llvm/lib/BinaryFormat/Wasm.cpp +++ b/llvm/lib/BinaryFormat/Wasm.cpp @@ -48,6 +48,7 @@ bool llvm::wasm::relocTypeHasAddend(uint32_t Type) { case R_WASM_MEMORY_ADDR_REL_SLEB64: case R_WASM_MEMORY_ADDR_I32: case R_WASM_MEMORY_ADDR_I64: + case R_WASM_MEMORY_ADDR_TLS_SLEB: case R_WASM_FUNCTION_OFFSET_I32: case R_WASM_SECTION_OFFSET_I32: return true; |