mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 20:09:25 +02:00
+ wasm internal linker: fill ExeFunctionIndex of alias code symbols as well
This commit is contained in:
parent
cf79ca16b4
commit
50986967f5
@ -4270,10 +4270,11 @@ implementation
|
||||
|
||||
procedure TWasmExeOutput.PrepareFunctions;
|
||||
var
|
||||
i: Integer;
|
||||
i, j: Integer;
|
||||
exesec: TExeSection;
|
||||
objsec: TWasmObjSection;
|
||||
fsym: TWasmObjSymbol;
|
||||
objdata: TObjData;
|
||||
begin
|
||||
if assigned(exemap) then
|
||||
begin
|
||||
@ -4302,6 +4303,21 @@ implementation
|
||||
exemap.Add(' Function[' + tostr(fsym.LinkingData.ExeFunctionIndex) + '] ' + fsym.Name + fsym.LinkingData.FuncType.ToString);
|
||||
end;
|
||||
end;
|
||||
{ set ExeFunctionIndex to the alias symbols as well }
|
||||
for i:=0 to ObjDataList.Count-1 do
|
||||
begin
|
||||
objdata:=TObjData(ObjDataList[i]);
|
||||
for j:=0 to objdata.ObjSymbolList.Count-1 do
|
||||
begin
|
||||
fsym:=TWasmObjSymbol(objdata.ObjSymbolList[j]);
|
||||
if assigned(fsym.objsection) and fsym.objsection.USed and (fsym.typ=AT_FUNCTION) and (fsym.LinkingData.ExeFunctionIndex=-1) then
|
||||
begin
|
||||
fsym.LinkingData.ExeFunctionIndex:=TWasmObjSection(fsym.objsection).MainFuncSymbol.LinkingData.ExeFunctionIndex;
|
||||
if fsym.LinkingData.ExeFunctionIndex=-1 then
|
||||
internalerror(2024010102);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user