+ create relocation objects for R_WASM_FUNCTION_OFFSET_I32 relocations in the wasm object reader

This commit is contained in:
Nikolay Nikolov 2023-12-28 21:26:12 +02:00
parent 73895d3cbc
commit d6c3c74b46

View File

@ -3907,8 +3907,23 @@ implementation
end;
ObjSec.ObjRelocations.Add(TWasmObjRelocation.CreateTypeIndex(RelocOffset-BaseSectionOffset,RelocIndex));
end;
R_WASM_FUNCTION_OFFSET_I32:
begin
if RelocIndex>high(SymbolTable) then
begin
InputError('Symbol index in relocation too high');
exit;
end;
if Assigned(SymbolTable[RelocIndex].ObjSym) then
begin
ObjReloc:=TWasmObjRelocation.CreateSymbol(RelocOffset-BaseSectionOffset,SymbolTable[RelocIndex].ObjSym,RELOC_ABSOLUTE);
ObjReloc.Addend:=RelocAddend;
ObjSec.ObjRelocations.Add(ObjReloc);
end
else
Writeln('Warning! No object symbol created for ', SymbolTable[RelocIndex].SymName);
end;
R_WASM_SECTION_OFFSET_I32,
R_WASM_FUNCTION_OFFSET_I32,
R_WASM_GLOBAL_INDEX_LEB,
R_WASM_TAG_INDEX_LEB:
{TODO};