* WebAssembly threads internal linker: starting working on TWasmExeOutput.SetThreadVarGlobalsInitValues

This commit is contained in:
Nikolay Nikolov 2024-08-11 00:11:29 +03:00
parent 39ab212642
commit 334ef633a8

View File

@ -279,6 +279,7 @@ interface
procedure PrepareTags;
function AddOrGetIndirectFunctionTableIndex(FuncIdx: Integer): integer;
procedure SetStackPointer;
procedure SetThreadVarGlobalsInitValues;
procedure GenerateCode_InitTls;
procedure WriteExeSectionToDynArray(exesec: TExeSection; dynarr: tdynamicarray);
protected
@ -4878,6 +4879,7 @@ implementation
WriteName(FWasmCustomSections[cust_sec],WasmCustomSectionName[cust_sec]);
SetStackPointer;
SetThreadVarGlobalsInitValues;
GenerateCode_InitTls;
FFuncTypes.WriteTo(FWasmSections[wsiType]);
@ -5425,6 +5427,24 @@ implementation
FStackPointerSym.LinkingData.GlobalInitializer.init_i32:=Int32(InitialStackPtrAddr);
end;
procedure TWasmExeOutput.SetThreadVarGlobalsInitValues;
var
exesec: TExeSection;
i: Integer;
objsec: TWasmObjSection;
objsym: TWasmObjSymbol;
begin
exesec:=FindExeSection('.wasm_globals');
if not assigned(exesec) then
internalerror(2024010112);
for i:=0 to exesec.ObjSectionList.Count-1 do
begin
objsec:=TWasmObjSection(exesec.ObjSectionList[i]);
objsym:=objsec.MainFuncSymbol;
{ TODO: implement }
end;
end;
procedure TWasmExeOutput.GenerateCode_InitTls;
var
a: Byte=0;