@@ -124,6 +124,7 @@ uint64_t ObjFile::calcNewAddend(const WasmRelocation &reloc) const {
124
124
case R_WASM_MEMORY_ADDR_I32:
125
125
case R_WASM_MEMORY_ADDR_I64:
126
126
case R_WASM_FUNCTION_OFFSET_I32:
127
+ case R_WASM_FUNCTION_OFFSET_I64:
127
128
return reloc.Addend ;
128
129
case R_WASM_SECTION_OFFSET_I32:
129
130
return getSectionSymbol (reloc.Index )->section ->outputOffset + reloc.Addend ;
@@ -171,7 +172,8 @@ uint64_t ObjFile::calcExpectedValue(const WasmRelocation &reloc) const {
171
172
else
172
173
llvm_unreachable (" unknown init expr opcode" );
173
174
}
174
- case R_WASM_FUNCTION_OFFSET_I32: {
175
+ case R_WASM_FUNCTION_OFFSET_I32:
176
+ case R_WASM_FUNCTION_OFFSET_I64: {
175
177
const WasmSymbol &sym = wasmObj->syms ()[reloc.Index ];
176
178
InputFunction *f =
177
179
functions[sym.Info .ElementIndex - wasmObj->getNumImportedFunctions ()];
@@ -258,7 +260,8 @@ uint64_t ObjFile::calcNewValue(const WasmRelocation &reloc) const {
258
260
return sym->getGOTIndex ();
259
261
case R_WASM_EVENT_INDEX_LEB:
260
262
return getEventSymbol (reloc.Index )->getEventIndex ();
261
- case R_WASM_FUNCTION_OFFSET_I32: {
263
+ case R_WASM_FUNCTION_OFFSET_I32:
264
+ case R_WASM_FUNCTION_OFFSET_I64: {
262
265
auto *f = cast<DefinedFunction>(sym);
263
266
return f->function ->outputOffset +
264
267
(f->function ->getFunctionCodeOffset () + reloc.Addend );
0 commit comments