浏览代码

* wasm internal linker: start the .text section at mempos 0

Nikolay Nikolov 1 年之前
父节点
当前提交
c49ac16a19
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      compiler/ogwasm.pas

+ 3 - 1
compiler/ogwasm.pas

@@ -4685,7 +4685,9 @@ implementation
           (the LLVM leaves the first 1024 bytes in the data segment empty, so we
           (the LLVM leaves the first 1024 bytes in the data segment empty, so we
           start at 1024). }
           start at 1024). }
         if aname='.rodata' then
         if aname='.rodata' then
-          CurrMemPos:=1024;
+          CurrMemPos:=1024
+        else if aname='.text' then
+          CurrMemPos:=0;
         inherited MemPos_ExeSection(aname);
         inherited MemPos_ExeSection(aname);
       end;
       end;