aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2021-04-22 16:54:58 -0700
committerWouter van Oortmerssen <aardappel@gmail.com>2021-05-20 09:59:31 -0700
commit3a293cbf13a2b6ddb2c1f6d27077ee922f32c404 (patch)
tree224c083dd75a7e344fb998c9a57d74c8432093fb /llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
parent5b6cae5524905bc43cfc21a515f828528d1f2e68 (diff)
downloadllvm-3a293cbf13a2b6ddb2c1f6d27077ee922f32c404.zip
llvm-3a293cbf13a2b6ddb2c1f6d27077ee922f32c404.tar.gz
llvm-3a293cbf13a2b6ddb2c1f6d27077ee922f32c404.tar.bz2
[WebAssembly] Fix PIC/GOT codegen for wasm64
__table_base is know 64-bit, since in LLVM it represents a function pointer offset __table_base32 is a copy in wasm32 for use in elem init expr, since no truncation may be used there. New reloc R_WASM_TABLE_INDEX_REL_SLEB64 added Differential Revision: https://reviews.llvm.org/D101784
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
index 2383416..2468df9 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
@@ -107,9 +107,8 @@ MCSymbol *WebAssemblyMCInstLower::GetExternalSymbolSymbol(
strcmp(Name, "__stack_pointer") == 0 || strcmp(Name, "__tls_base") == 0;
WasmSym->setType(wasm::WASM_SYMBOL_TYPE_GLOBAL);
WasmSym->setGlobalType(wasm::WasmGlobalType{
- uint8_t(Subtarget.hasAddr64() && strcmp(Name, "__table_base") != 0
- ? wasm::WASM_TYPE_I64
- : wasm::WASM_TYPE_I32),
+ uint8_t(Subtarget.hasAddr64() ? wasm::WASM_TYPE_I64
+ : wasm::WASM_TYPE_I32),
Mutable});
return WasmSym;
}