Browse Source

+ fill MinAllocSize in the NewExe segment table

git-svn-id: trunk@42661 -
nickysn 6 years ago
parent
commit
6398c42a38
1 changed files with 7 additions and 3 deletions
  1. 7 3
      compiler/ogomf.pas

+ 7 - 3
compiler/ogomf.pas

@@ -645,8 +645,8 @@ interface
         FExeMetaSec: TNewExeMetaSection;
         FExeMetaSec: TNewExeMetaSection;
         FMemBasePos: Word;
         FMemBasePos: Word;
         FDataPosSectors: Word;
         FDataPosSectors: Word;
-        FMinAllocSize: QWord;
         FNewExeSegmentFlags: TNewExeSegmentFlags;
         FNewExeSegmentFlags: TNewExeSegmentFlags;
+        function GetMinAllocSize: QWord;
       public
       public
         procedure WriteHeaderTo(aWriter: TObjectWriter);
         procedure WriteHeaderTo(aWriter: TObjectWriter);
         function MemPosStr(AImageBase: qword): string;override;
         function MemPosStr(AImageBase: qword): string;override;
@@ -657,7 +657,7 @@ interface
         property ExeMetaSec: TNewExeMetaSection read FExeMetaSec write FExeMetaSec;
         property ExeMetaSec: TNewExeMetaSection read FExeMetaSec write FExeMetaSec;
         property MemBasePos: Word read FMemBasePos write FMemBasePos;
         property MemBasePos: Word read FMemBasePos write FMemBasePos;
         property DataPosSectors: Word read FDataPosSectors write FDataPosSectors;
         property DataPosSectors: Word read FDataPosSectors write FDataPosSectors;
-        property MinAllocSize: QWord read FMinAllocSize write FMinAllocSize;
+        property MinAllocSize: QWord read GetMinAllocSize;
         property NewExeSegmentFlags: TNewExeSegmentFlags read FNewExeSegmentFlags write FNewExeSegmentFlags;
         property NewExeSegmentFlags: TNewExeSegmentFlags read FNewExeSegmentFlags write FNewExeSegmentFlags;
       end;
       end;
 
 
@@ -4156,6 +4156,11 @@ cleanup:
                               TNewExeSection
                               TNewExeSection
 ****************************************************************************}
 ****************************************************************************}
 
 
+    function TNewExeSection.GetMinAllocSize: QWord;
+      begin
+        Result:=Size-StackSize;
+      end;
+
     procedure TNewExeSection.WriteHeaderTo(aWriter: TObjectWriter);
     procedure TNewExeSection.WriteHeaderTo(aWriter: TObjectWriter);
       var
       var
         SegmentHeaderBytes: array [0..7] of Byte;
         SegmentHeaderBytes: array [0..7] of Byte;
@@ -4319,7 +4324,6 @@ cleanup:
         Header.InitialSS:=Header.AutoDataSegmentNumber;
         Header.InitialSS:=Header.AutoDataSegmentNumber;
         Header.InitialStackSize:=TNewExeSection(ExeSectionList[Header.AutoDataSegmentNumber-1]).StackSize;
         Header.InitialStackSize:=TNewExeSection(ExeSectionList[Header.AutoDataSegmentNumber-1]).StackSize;
         Header.InitialLocalHeapSize:=heapsize;
         Header.InitialLocalHeapSize:=heapsize;
-        {todo: subtract the stack size from the size of the auto data segment }
 
 
         Header.SegmentTableStart:=NewExeHeaderSize;
         Header.SegmentTableStart:=NewExeHeaderSize;
         Header.SegmentTableEntriesCount:=ExeSectionList.Count;
         Header.SegmentTableEntriesCount:=ExeSectionList.Count;