Browse Source

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

Nikolay Nikolov 1 năm trước cách đây
mục cha
commit
90a756931e
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  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;