mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2026-07-25 12:46:26 -04:00
[WebAssembly] Added R_WASM_FUNCTION_OFFSET_I64 for use with DWARF DW_AT_low_pc
Needed for wasm64, see discussion in https://reviews.llvm.org/D91203 Differential Revision: https://reviews.llvm.org/D91395
This commit is contained in:
@@ -876,6 +876,12 @@ Error WasmObjectFile::parseRelocSection(StringRef Name, ReadContext &Ctx) {
|
||||
object_error::parse_failed);
|
||||
Reloc.Addend = readVarint32(Ctx);
|
||||
break;
|
||||
case wasm::R_WASM_FUNCTION_OFFSET_I64:
|
||||
if (!isValidFunctionSymbol(Reloc.Index))
|
||||
return make_error<GenericBinaryError>("Bad relocation function index",
|
||||
object_error::parse_failed);
|
||||
Reloc.Addend = readVarint64(Ctx);
|
||||
break;
|
||||
case wasm::R_WASM_SECTION_OFFSET_I32:
|
||||
if (!isValidSectionSymbol(Reloc.Index))
|
||||
return make_error<GenericBinaryError>("Bad relocation section index",
|
||||
@@ -903,7 +909,8 @@ Error WasmObjectFile::parseRelocSection(StringRef Name, ReadContext &Ctx) {
|
||||
Reloc.Type == wasm::R_WASM_GLOBAL_INDEX_I32)
|
||||
Size = 4;
|
||||
if (Reloc.Type == wasm::R_WASM_TABLE_INDEX_I64 ||
|
||||
Reloc.Type == wasm::R_WASM_MEMORY_ADDR_I64)
|
||||
Reloc.Type == wasm::R_WASM_MEMORY_ADDR_I64 ||
|
||||
Reloc.Type == wasm::R_WASM_FUNCTION_OFFSET_I64)
|
||||
Size = 8;
|
||||
if (Reloc.Offset + Size > EndOffset)
|
||||
return make_error<GenericBinaryError>("Bad relocation offset",
|
||||
|
||||
Reference in New Issue
Block a user