mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-26 00:01:47 +02:00
+ when using the i8086 with section based smartlinking, create OMF section
groups, named 'CGROUP' or 'CGROUP_UNITNAME', which include all the code sections, that need to be put in the same segment git-svn-id: trunk@39277 -
This commit is contained in:
parent
f07658d3dc
commit
45337b67fe
@ -643,7 +643,7 @@ implementation
|
|||||||
TOmfObjSection(Result).FUse:=suUse32;
|
TOmfObjSection(Result).FUse:=suUse32;
|
||||||
TOmfObjSection(Result).SizeLimit:=high(longword);
|
TOmfObjSection(Result).SizeLimit:=high(longword);
|
||||||
end;
|
end;
|
||||||
primary_group:=omf_section_primary_group(atype);
|
primary_group:=omf_section_primary_group(atype,aname);
|
||||||
if primary_group<>'' then
|
if primary_group<>'' then
|
||||||
begin
|
begin
|
||||||
{ find the primary group, if it already exists, else create it }
|
{ find the primary group, if it already exists, else create it }
|
||||||
|
|||||||
@ -1263,14 +1263,15 @@ interface
|
|||||||
{ returns whether the specified section type belongs to the group DGROUP in
|
{ returns whether the specified section type belongs to the group DGROUP in
|
||||||
the current memory model. DGROUP is the segment group pointed by DS }
|
the current memory model. DGROUP is the segment group pointed by DS }
|
||||||
function section_belongs_to_dgroup(atype:TAsmSectiontype): Boolean;
|
function section_belongs_to_dgroup(atype:TAsmSectiontype): Boolean;
|
||||||
function omf_section_primary_group(atype:TAsmSectiontype):string;
|
function omf_section_primary_group(atype:TAsmSectiontype;const aname:string):string;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
cutils,globtype,globals,
|
cutils,globtype,globals,
|
||||||
cpuinfo,
|
cpuinfo,
|
||||||
verbose;
|
verbose,
|
||||||
|
fmodule;
|
||||||
|
|
||||||
{ TOmfOrderedNameCollection }
|
{ TOmfOrderedNameCollection }
|
||||||
|
|
||||||
@ -2873,11 +2874,28 @@ implementation
|
|||||||
{$endif i8086}
|
{$endif i8086}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function omf_section_primary_group(atype: TAsmSectiontype): string;
|
function omf_section_primary_group(atype: TAsmSectiontype;const aname:string): string;
|
||||||
begin
|
begin
|
||||||
{$ifdef i8086}
|
{$ifdef i8086}
|
||||||
if section_belongs_to_dgroup(atype) then
|
if section_belongs_to_dgroup(atype) then
|
||||||
result:='DGROUP'
|
result:='DGROUP'
|
||||||
|
else if create_smartlink_sections and (aname<>'') then
|
||||||
|
begin
|
||||||
|
case omf_segclass(atype) of
|
||||||
|
'CODE':
|
||||||
|
if current_settings.x86memorymodel in x86_far_code_models then
|
||||||
|
begin
|
||||||
|
if cs_huge_code in current_settings.moduleswitches then
|
||||||
|
result:=''
|
||||||
|
else
|
||||||
|
result:='CGROUP_'+current_module.modulename^;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
result:='CGROUP';
|
||||||
|
else
|
||||||
|
result:='';
|
||||||
|
end;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
result:='';
|
result:='';
|
||||||
{$else i8086}
|
{$else i8086}
|
||||||
|
|||||||
@ -596,7 +596,7 @@ interface
|
|||||||
writer.AsmWrite(' class='+omf_segclass(atype)+
|
writer.AsmWrite(' class='+omf_segclass(atype)+
|
||||||
' align='+tostr(omf_sectiontype2align(atype)));
|
' align='+tostr(omf_sectiontype2align(atype)));
|
||||||
TX86NasmSection.Create(FSections,secname);
|
TX86NasmSection.Create(FSections,secname);
|
||||||
secgroup:=omf_section_primary_group(atype);
|
secgroup:=omf_section_primary_group(atype,aname);
|
||||||
if secgroup<>'' then
|
if secgroup<>'' then
|
||||||
AddSegmentToGroup(secgroup,secname);
|
AddSegmentToGroup(secgroup,secname);
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user