From 24e3d95fe018bc7f6b9604d008b471855c09023a Mon Sep 17 00:00:00 2001 From: nickysn Date: Mon, 12 Aug 2019 12:51:37 +0000 Subject: [PATCH] - don't create a heap segment for win16 git-svn-id: trunk@42658 - --- compiler/i8086/n8086util.pas | 5 +++-- compiler/ogomf.pas | 11 +++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/compiler/i8086/n8086util.pas b/compiler/i8086/n8086util.pas index 92606677ae..73c693a80c 100644 --- a/compiler/i8086/n8086util.pas +++ b/compiler/i8086/n8086util.pas @@ -42,7 +42,7 @@ implementation uses sysutils,cutils, - globtype,globals,cpuinfo, + globtype,globals,cpuinfo,systems, aasmbase,aasmdata,aasmtai, symdef; @@ -52,7 +52,8 @@ implementation inherited; if current_settings.x86memorymodel<>mm_tiny then InsertStackSegment; - InsertHeapSegment; + if target_info.system<>system_i8086_win16 then + InsertHeapSegment; if current_settings.x86memorymodel in x86_near_data_models then InsertStackPlusHeapSize; end; diff --git a/compiler/ogomf.pas b/compiler/ogomf.pas index 1d95ff1de8..064d06f7f6 100644 --- a/compiler/ogomf.pas +++ b/compiler/ogomf.pas @@ -642,7 +642,6 @@ interface private FEarlySize: QWord; FStackSize: QWord; - FLocalHeapSize: QWord; FExeMetaSec: TNewExeMetaSection; FMemBasePos: Word; FDataPosSectors: Word; @@ -655,7 +654,6 @@ interface function CanAddObjSection(objsec:TObjSection;ExeSectionLimit:QWord):boolean; property EarlySize: QWord read FEarlySize write FEarlySize; property StackSize: QWord read FStackSize write FStackSize; - property LocalHeapSize: QWord read FLocalHeapSize write FLocalHeapSize; property ExeMetaSec: TNewExeMetaSection read FExeMetaSec write FExeMetaSec; property MemBasePos: Word read FMemBasePos write FMemBasePos; property DataPosSectors: Word read FDataPosSectors write FDataPosSectors; @@ -4184,7 +4182,7 @@ cleanup: s: TSymStr; Separator: SizeInt; SegName, SegClass: string; - IsStack, IsHeap: Boolean; + IsStack: Boolean; begin { allow mixing initialized and uninitialized data in the same section => set ignoreprops=true } @@ -4212,9 +4210,6 @@ cleanup: IsStack:=True; if IsStack then StackSize:=StackSize+objsec.Size; - IsHeap:=SegClass='HEAP'; - if IsHeap then - LocalHeapSize:=LocalHeapSize+objsec.Size; EarlySize:=align_qword(EarlySize,SecAlign)+objsec.Size; end; @@ -4323,8 +4318,8 @@ cleanup: Header.InitialSP:=0; Header.InitialSS:=Header.AutoDataSegmentNumber; Header.InitialStackSize:=TNewExeSection(ExeSectionList[Header.AutoDataSegmentNumber-1]).StackSize; - Header.InitialLocalHeapSize:=TNewExeSection(ExeSectionList[Header.AutoDataSegmentNumber-1]).LocalHeapSize; - {todo: subtract the stack size and the local heap size from the size of the auto data segment } + Header.InitialLocalHeapSize:=heapsize; + {todo: subtract the stack size from the size of the auto data segment } Header.SegmentTableStart:=NewExeHeaderSize; Header.SegmentTableEntriesCount:=ExeSectionList.Count;