2
0
Эх сурвалжийг харах

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

Nikolay Nikolov 1 жил өмнө
parent
commit
90a756931e
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  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;