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

This commit is contained in:
Nikolay Nikolov 2023-12-28 21:23:08 +02:00
parent ae93f8de91
commit 73895d3cbc
2 changed files with 17 additions and 1 deletions

View File

@ -3711,6 +3711,10 @@ implementation
refobjsec:=objreloc.objsection
else if assigned(objreloc.group) then
refgrp:=objreloc.group
{$ifdef WASM}
else if objreloc.ftype=Ord(RELOC_TYPE_INDEX_LEB) then
{nothing}
{$endif WASM}
else
internalerror(200603316);
if assigned(exemap) then
@ -3723,6 +3727,10 @@ implementation
exemap.Add(' References '+refobjsec.fullname)
else if assigned(refgrp) then
exemap.Add(' References '+refgrp.Name)
{$ifdef WASM}
else if objreloc.ftype=Ord(RELOC_TYPE_INDEX_LEB) then
{nothing}
{$endif WASM}
else
internalerror(2006033111);
end;

View File

@ -3898,9 +3898,17 @@ implementation
else
Writeln('Warning! No object symbol created for ', SymbolTable[RelocIndex].SymName);
end;
R_WASM_TYPE_INDEX_LEB:
begin
if RelocIndex>high(FFuncTypes) then
begin
InputError('Type index in relocation too high');
exit;
end;
ObjSec.ObjRelocations.Add(TWasmObjRelocation.CreateTypeIndex(RelocOffset-BaseSectionOffset,RelocIndex));
end;
R_WASM_SECTION_OFFSET_I32,
R_WASM_FUNCTION_OFFSET_I32,
R_WASM_TYPE_INDEX_LEB,
R_WASM_GLOBAL_INDEX_LEB,
R_WASM_TAG_INDEX_LEB:
{TODO};