Browse Source

* wasm internal linker: set mempos of debug sections to 0

Nikolay Nikolov 1 year ago
parent
commit
e3b6d70f93
1 changed files with 7 additions and 0 deletions
  1. 7 0
      compiler/ogwasm.pas

+ 7 - 0
compiler/ogwasm.pas

@@ -4810,6 +4810,8 @@ implementation
       end;
       end;
 
 
     procedure TWasmExeOutput.MemPos_ExeSection(const aname: string);
     procedure TWasmExeOutput.MemPos_ExeSection(const aname: string);
+      const
+        DebugPrefix = '.debug_';
       var
       var
         ExeSec: TExeSection;
         ExeSec: TExeSection;
         i: Integer;
         i: Integer;
@@ -4845,6 +4847,11 @@ implementation
             { calculate size of the section }
             { calculate size of the section }
             exesec.Size:=CurrMemPos-exesec.MemPos;
             exesec.Size:=CurrMemPos-exesec.MemPos;
           end
           end
+        else if Copy(aname,1,Length(DebugPrefix))=DebugPrefix then
+          begin
+            CurrMemPos:=0;
+            inherited;
+          end
         else
         else
           inherited;
           inherited;
       end;
       end;