Quellcode durchsuchen

+ WebAssembly threads internal linker: introduced TWasmExeOutput.GenerateCode_InitTls (not ready, yet, just writes some dummy data)

Nikolay Nikolov vor 1 Jahr
Ursprung
Commit
afbc36897d
1 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
  1. 10 0
      compiler/ogwasm.pas

+ 10 - 0
compiler/ogwasm.pas

@@ -279,6 +279,7 @@ interface
         procedure PrepareTags;
         function AddOrGetIndirectFunctionTableIndex(FuncIdx: Integer): integer;
         procedure SetStackPointer;
+        procedure GenerateCode_InitTls;
         procedure WriteExeSectionToDynArray(exesec: TExeSection; dynarr: tdynamicarray);
       protected
         function writeData:boolean;override;
@@ -4874,6 +4875,7 @@ implementation
           WriteName(FWasmCustomSections[cust_sec],WasmCustomSectionName[cust_sec]);
 
         SetStackPointer;
+        GenerateCode_InitTls;
 
         FFuncTypes.WriteTo(FWasmSections[wsiType]);
         WriteImportSection;
@@ -5420,6 +5422,14 @@ implementation
         FStackPointerSym.LinkingData.GlobalInitializer.init_i32:=Int32(InitialStackPtrAddr);
       end;
 
+    procedure TWasmExeOutput.GenerateCode_InitTls;
+      var
+        a: Byte=0;
+      begin
+        FInitTlsFunctionSym.objsection.SecOptions:=FInitTlsFunctionSym.objsection.SecOptions+[oso_Data];
+        FInitTlsFunctionSym.objsection.write(a,1);
+      end;
+
     procedure TWasmExeOutput.WriteExeSectionToDynArray(exesec: TExeSection; dynarr: tdynamicarray);
       var
         exesecdatapos: LongWord;