mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 10:12:54 +02:00
- don't create a heap segment for win16
git-svn-id: trunk@42658 -
This commit is contained in:
parent
8015bfb5a0
commit
24e3d95fe0
@ -42,7 +42,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
sysutils,cutils,
|
sysutils,cutils,
|
||||||
globtype,globals,cpuinfo,
|
globtype,globals,cpuinfo,systems,
|
||||||
aasmbase,aasmdata,aasmtai,
|
aasmbase,aasmdata,aasmtai,
|
||||||
symdef;
|
symdef;
|
||||||
|
|
||||||
@ -52,7 +52,8 @@ implementation
|
|||||||
inherited;
|
inherited;
|
||||||
if current_settings.x86memorymodel<>mm_tiny then
|
if current_settings.x86memorymodel<>mm_tiny then
|
||||||
InsertStackSegment;
|
InsertStackSegment;
|
||||||
InsertHeapSegment;
|
if target_info.system<>system_i8086_win16 then
|
||||||
|
InsertHeapSegment;
|
||||||
if current_settings.x86memorymodel in x86_near_data_models then
|
if current_settings.x86memorymodel in x86_near_data_models then
|
||||||
InsertStackPlusHeapSize;
|
InsertStackPlusHeapSize;
|
||||||
end;
|
end;
|
||||||
|
@ -642,7 +642,6 @@ interface
|
|||||||
private
|
private
|
||||||
FEarlySize: QWord;
|
FEarlySize: QWord;
|
||||||
FStackSize: QWord;
|
FStackSize: QWord;
|
||||||
FLocalHeapSize: QWord;
|
|
||||||
FExeMetaSec: TNewExeMetaSection;
|
FExeMetaSec: TNewExeMetaSection;
|
||||||
FMemBasePos: Word;
|
FMemBasePos: Word;
|
||||||
FDataPosSectors: Word;
|
FDataPosSectors: Word;
|
||||||
@ -655,7 +654,6 @@ interface
|
|||||||
function CanAddObjSection(objsec:TObjSection;ExeSectionLimit:QWord):boolean;
|
function CanAddObjSection(objsec:TObjSection;ExeSectionLimit:QWord):boolean;
|
||||||
property EarlySize: QWord read FEarlySize write FEarlySize;
|
property EarlySize: QWord read FEarlySize write FEarlySize;
|
||||||
property StackSize: QWord read FStackSize write FStackSize;
|
property StackSize: QWord read FStackSize write FStackSize;
|
||||||
property LocalHeapSize: QWord read FLocalHeapSize write FLocalHeapSize;
|
|
||||||
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;
|
||||||
@ -4184,7 +4182,7 @@ cleanup:
|
|||||||
s: TSymStr;
|
s: TSymStr;
|
||||||
Separator: SizeInt;
|
Separator: SizeInt;
|
||||||
SegName, SegClass: string;
|
SegName, SegClass: string;
|
||||||
IsStack, IsHeap: Boolean;
|
IsStack: Boolean;
|
||||||
begin
|
begin
|
||||||
{ allow mixing initialized and uninitialized data in the same section
|
{ allow mixing initialized and uninitialized data in the same section
|
||||||
=> set ignoreprops=true }
|
=> set ignoreprops=true }
|
||||||
@ -4212,9 +4210,6 @@ cleanup:
|
|||||||
IsStack:=True;
|
IsStack:=True;
|
||||||
if IsStack then
|
if IsStack then
|
||||||
StackSize:=StackSize+objsec.Size;
|
StackSize:=StackSize+objsec.Size;
|
||||||
IsHeap:=SegClass='HEAP';
|
|
||||||
if IsHeap then
|
|
||||||
LocalHeapSize:=LocalHeapSize+objsec.Size;
|
|
||||||
EarlySize:=align_qword(EarlySize,SecAlign)+objsec.Size;
|
EarlySize:=align_qword(EarlySize,SecAlign)+objsec.Size;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -4323,8 +4318,8 @@ cleanup:
|
|||||||
Header.InitialSP:=0;
|
Header.InitialSP:=0;
|
||||||
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:=TNewExeSection(ExeSectionList[Header.AutoDataSegmentNumber-1]).LocalHeapSize;
|
Header.InitialLocalHeapSize:=heapsize;
|
||||||
{todo: subtract the stack size and the local heap size from the size of the auto data segment }
|
{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;
|
||||||
|
Loading…
Reference in New Issue
Block a user