Parcourir la source

* WebAssembly threads internal linker: set initial values for threadvar globals

Nikolay Nikolov il y a 1 an
Parent
commit
90a756931e
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      compiler/ogwasm.pas

+ 5 - 1
compiler/ogwasm.pas

@@ -5446,7 +5446,11 @@ implementation
           begin
             objsec:=TWasmObjSection(exesec.ObjSectionList[i]);
             objsym:=objsec.MainFuncSymbol;
-            { TODO: implement }
+            if Assigned(objsym.TlsDataSym) then
+              begin
+                objsym.LinkingData.GlobalInitializer.typ:=wbt_i32;
+                objsym.LinkingData.GlobalInitializer.init_i32:=objsym.TlsDataSym.offset+objsym.TlsDataSym.objsection.MemPos;
+              end;
           end;
       end;