+ wasm internal linker: internally define the '__stack_pointer' global symbol

This commit is contained in:
Nikolay Nikolov 2024-01-01 17:36:52 +02:00
parent 880d0333b0
commit 408e388af3

View File

@ -254,6 +254,7 @@ interface
procedure GenerateLibraryImports(ImportLibraryList:TFPHashObjectList);override;
procedure AfterUnusedSectionRemoval;override;
procedure MemPos_ExeSection(const aname:string);override;
procedure Load_Start;override;
end;
{ TWasmAssembler }
@ -4467,6 +4468,15 @@ implementation
inherited MemPos_ExeSection(aname);
end;
procedure TWasmExeOutput.Load_Start;
const
aname='__stack_pointer';
begin
inherited Load_Start;
internalObjData.createsection('*'+aname,0,[]);
internalObjData.SymbolDefine(aname,AB_GLOBAL,AT_WASM_GLOBAL);
end;
procedure TWasmExeOutput.PrepareImports;
function AddFunctionImport(const libname,symname:TCmdStr; functype: TWasmFuncType): Integer;