1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

[WebAssembly] Define an initial set of relocation types for Wasm.

This set will likely evolve, along with the Wasm linking ABI.

llvm-svn: 296177
This commit is contained in:
Dan Gohman 2017-02-24 21:21:44 +00:00
parent e8e7f2c369
commit f54d23aa0f
2 changed files with 17 additions and 0 deletions

View File

@ -81,6 +81,12 @@ enum : unsigned {
WASM_OPCODE_F64_CONST = 0x44,
};
#define WASM_RELOC(name, value) name = value,
enum : unsigned {
#include "WasmRelocs/WebAssembly.def"
};
} // end namespace wasm
} // end namespace llvm

View File

@ -0,0 +1,11 @@
#ifndef WASM_RELOC
#error "WASM_RELOC must be defined"
#endif
WASM_RELOC(R_WEBASSEMBLY_FUNCTION_INDEX_LEB, 0)
WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_SLEB, 1)
WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_I32, 2)
WASM_RELOC(R_WEBASSEMBLY_GLOBAL_ADDR_LEB, 3)
WASM_RELOC(R_WEBASSEMBLY_GLOBAL_ADDR_SLEB, 4)
WASM_RELOC(R_WEBASSEMBLY_GLOBAL_ADDR_I32, 5)