瀏覽代碼

+ fill the segment table start offset in the NewExe header

git-svn-id: trunk@42584 -
nickysn 6 年之前
父節點
當前提交
d7c24c05d0
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      compiler/ogomf.pas

+ 7 - 0
compiler/ogomf.pas

@@ -324,6 +324,10 @@ interface
         property MZFlatContentSection: TMZExeSection read GetMZFlatContentSection;
       end;
 
+    const
+      NewExeHeaderSize = $40;
+
+    type
       TNewExeHeaderFlag = (
         nehfSingleData,                                               { bit  0 }
         nehfMultipleData,                                             { bit  1 }
@@ -3670,6 +3674,9 @@ cleanup:
         Header.InitialCS:=TNewExeSection(EntrySym.objsection.ExeSection).MemBasePos;
         Header.InitialSP:=0;
         Header.InitialSS:=Header.AutoDataSegmentNumber;
+
+        Header.SegmentTableStart:=NewExeHeaderSize;
+
         Header.WriteTo(FWriter);
         { todo: write the rest of the file as well }
         Result:=True;