mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-14 11:49:18 +02:00
+ add group "dgroup", this time built from the ObjSectionList, instead of hardcoded
git-svn-id: trunk@30488 -
This commit is contained in:
parent
67be73afa5
commit
9e701454c6
@ -95,6 +95,7 @@ interface
|
|||||||
Alignment: TOmfSegmentAlignment; Combination: TOmfSegmentCombination;
|
Alignment: TOmfSegmentAlignment; Combination: TOmfSegmentCombination;
|
||||||
Use: TOmfSegmentUse; Size: aword);
|
Use: TOmfSegmentUse; Size: aword);
|
||||||
procedure AddGroup(const groupname: string; seglist: array of const);
|
procedure AddGroup(const groupname: string; seglist: array of const);
|
||||||
|
procedure AddGroup(const groupname: string; seglist: TSegmentList);
|
||||||
procedure WriteSections(Data:TObjData);
|
procedure WriteSections(Data:TObjData);
|
||||||
procedure WriteSectionContentAndFixups(sec: TObjSection);
|
procedure WriteSectionContentAndFixups(sec: TObjSection);
|
||||||
|
|
||||||
@ -370,6 +371,16 @@ implementation
|
|||||||
g.SegmentList:=SegListStr;
|
g.SegmentList:=SegListStr;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TOmfObjOutput.AddGroup(const groupname: string; seglist: TSegmentList);
|
||||||
|
var
|
||||||
|
g: TOmfRecord_GRPDEF;
|
||||||
|
begin
|
||||||
|
g:=TOmfRecord_GRPDEF.Create;
|
||||||
|
Groups.Add(groupname,g);
|
||||||
|
g.GroupNameIndex:=LNames.Add(groupname);
|
||||||
|
g.SegmentList:=Copy(seglist);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TOmfObjOutput.WriteSections(Data: TObjData);
|
procedure TOmfObjOutput.WriteSections(Data: TObjData);
|
||||||
var
|
var
|
||||||
i:longint;
|
i:longint;
|
||||||
@ -460,6 +471,7 @@ implementation
|
|||||||
I: Integer;
|
I: Integer;
|
||||||
SegDef: TOmfRecord_SEGDEF;
|
SegDef: TOmfRecord_SEGDEF;
|
||||||
GrpDef: TOmfRecord_GRPDEF;
|
GrpDef: TOmfRecord_GRPDEF;
|
||||||
|
DGroupSegments: TSegmentList;
|
||||||
nsections: Integer;
|
nsections: Integer;
|
||||||
begin
|
begin
|
||||||
{ calc amount of sections we have and set their index, starting with 1 }
|
{ calc amount of sections we have and set their index, starting with 1 }
|
||||||
@ -493,12 +505,17 @@ implementation
|
|||||||
with TOmfObjSection(Data.ObjSectionList[I]) do
|
with TOmfObjSection(Data.ObjSectionList[I]) do
|
||||||
AddSegment(Name,ClassName,OverlayName,OmfAlignment,Combination,Use,Size);
|
AddSegment(Name,ClassName,OverlayName,OmfAlignment,Combination,Use,Size);
|
||||||
|
|
||||||
{ if current_settings.x86memorymodel=mm_tiny then
|
|
||||||
AddGroup('dgroup',['text','rodata','data','fpc','bss','heap'])
|
{ create group "dgroup" }
|
||||||
else if current_settings.x86memorymodel in x86_near_data_models then
|
SetLength(DGroupSegments,0);
|
||||||
AddGroup('dgroup',['rodata','data','fpc','bss','stack','heap'])
|
for i:=0 to Data.ObjSectionList.Count-1 do
|
||||||
else
|
with TOmfObjSection(Data.ObjSectionList[I]) do
|
||||||
AddGroup('dgroup',['rodata','data','fpc','bss']);}
|
if PrimaryGroup='dgroup' then
|
||||||
|
begin
|
||||||
|
SetLength(DGroupSegments,Length(DGroupSegments)+1);
|
||||||
|
DGroupSegments[High(DGroupSegments)]:=index;
|
||||||
|
end;
|
||||||
|
AddGroup('dgroup',DGroupSegments);
|
||||||
|
|
||||||
{ write LNAMES record(s) }
|
{ write LNAMES record(s) }
|
||||||
LNamesRec:=TOmfRecord_LNAMES.Create;
|
LNamesRec:=TOmfRecord_LNAMES.Create;
|
||||||
|
Loading…
Reference in New Issue
Block a user