aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/BinaryFormat/Wasm.cpp
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2020-06-05 09:03:12 -0700
committerWouter van Oortmerssen <aardappel@gmail.com>2020-06-15 10:07:42 -0700
commit3b29376e3fca4305ea470ee142cad1296103297b (patch)
treee7f51eac4ca7de905e4d01a46a53c4125136e964 /llvm/lib/BinaryFormat/Wasm.cpp
parent017969de766287ec6c2fc82128c62d1d1dad7bd8 (diff)
downloadllvm-3b29376e3fca4305ea470ee142cad1296103297b.zip
llvm-3b29376e3fca4305ea470ee142cad1296103297b.tar.gz
llvm-3b29376e3fca4305ea470ee142cad1296103297b.tar.bz2
[WebAssembly] Adding 64-bit version of R_WASM_MEMORY_ADDR_* relocs
This adds 4 new reloc types. A lot of code that previously assumed any memory or offset values could be contained in a uint32_t (and often truncated results from functions returning 64-bit values) have been upgraded to uint64_t. This is not comprehensive: it is only the values that come in contact with the new relocation values and their dependents. A new tablegen mapping was added to automatically upgrade loads/stores in the assembler, which otherwise has no way to select for these instructions (since they are indentical other than for the offset immediate). It follows a similar technique to https://reviews.llvm.org/D53307 Differential Revision: https://reviews.llvm.org/D81704
Diffstat (limited to 'llvm/lib/BinaryFormat/Wasm.cpp')
-rw-r--r--llvm/lib/BinaryFormat/Wasm.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/BinaryFormat/Wasm.cpp b/llvm/lib/BinaryFormat/Wasm.cpp
index d46be48..8860816 100644
--- a/llvm/lib/BinaryFormat/Wasm.cpp
+++ b/llvm/lib/BinaryFormat/Wasm.cpp
@@ -39,9 +39,13 @@ std::string llvm::wasm::relocTypetoString(uint32_t Type) {
bool llvm::wasm::relocTypeHasAddend(uint32_t Type) {
switch (Type) {
case R_WASM_MEMORY_ADDR_LEB:
+ case R_WASM_MEMORY_ADDR_LEB64:
case R_WASM_MEMORY_ADDR_SLEB:
+ case R_WASM_MEMORY_ADDR_SLEB64:
case R_WASM_MEMORY_ADDR_REL_SLEB:
+ case R_WASM_MEMORY_ADDR_REL_SLEB64:
case R_WASM_MEMORY_ADDR_I32:
+ case R_WASM_MEMORY_ADDR_I64:
case R_WASM_FUNCTION_OFFSET_I32:
case R_WASM_SECTION_OFFSET_I32:
return true;