mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 20:29:18 +02:00
+ initial (experimental) implementation of section-based smartlinking for i8086.
Use -dI8086_SMARTLINK_SECTIONS to enable. git-svn-id: trunk@39211 -
This commit is contained in:
parent
bfdd75eabf
commit
b9ab9e5782
@ -570,15 +570,35 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TOmfObjData.sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;
|
function TOmfObjData.sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;
|
||||||
|
var
|
||||||
|
sep : string[3];
|
||||||
|
secname : string;
|
||||||
begin
|
begin
|
||||||
if (atype=sec_user) then
|
if (atype=sec_user) then
|
||||||
Result:=aname
|
Result:=aname
|
||||||
else if omf_secnames[atype]=omf_secnames[sec_code] then
|
|
||||||
Result:=CodeSectionName(aname)
|
|
||||||
else if omf_segclass(atype)='FAR_DATA' then
|
|
||||||
Result:=current_module.modulename^ + '_DATA'
|
|
||||||
else
|
else
|
||||||
Result:=omf_secnames[atype];
|
begin
|
||||||
|
if omf_secnames[atype]=omf_secnames[sec_code] then
|
||||||
|
secname:=CodeSectionName(aname)
|
||||||
|
else if omf_segclass(atype)='FAR_DATA' then
|
||||||
|
secname:=current_module.modulename^ + '_DATA'
|
||||||
|
else
|
||||||
|
secname:=omf_secnames[atype];
|
||||||
|
if create_smartlink_sections and (aname<>'') then
|
||||||
|
begin
|
||||||
|
case aorder of
|
||||||
|
secorder_begin :
|
||||||
|
sep:='.b_';
|
||||||
|
secorder_end :
|
||||||
|
sep:='.z_';
|
||||||
|
else
|
||||||
|
sep:='.n_';
|
||||||
|
end;
|
||||||
|
result:=secname+sep+aname
|
||||||
|
end
|
||||||
|
else
|
||||||
|
result:=secname;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TOmfObjData.createsection(atype: TAsmSectionType; const aname: string; aorder: TAsmSectionOrder): TObjSection;
|
function TOmfObjData.createsection(atype: TAsmSectionType; const aname: string; aorder: TAsmSectionOrder): TObjSection;
|
||||||
@ -2910,7 +2930,7 @@ implementation
|
|||||||
asmbin : '';
|
asmbin : '';
|
||||||
asmcmd : '';
|
asmcmd : '';
|
||||||
supported_targets : [system_i8086_msdos,system_i8086_embedded];
|
supported_targets : [system_i8086_msdos,system_i8086_embedded];
|
||||||
flags : [af_outputbinary,af_no_debug];
|
flags : [af_outputbinary,af_no_debug,af_smartlink_sections];
|
||||||
labelprefix : '..@';
|
labelprefix : '..@';
|
||||||
comment : '; ';
|
comment : '; ';
|
||||||
dollarsign: '$';
|
dollarsign: '$';
|
||||||
|
@ -360,8 +360,14 @@ unit i_embed;
|
|||||||
system : system_i8086_embedded;
|
system : system_i8086_embedded;
|
||||||
name : 'Embedded';
|
name : 'Embedded';
|
||||||
shortname : 'embedded';
|
shortname : 'embedded';
|
||||||
flags : [tf_use_8_3,tf_smartlink_library,
|
flags : [tf_use_8_3,
|
||||||
tf_no_objectfiles_when_smartlinking,tf_cld,
|
{$ifdef I8086_SMARTLINK_SECTIONS}
|
||||||
|
tf_smartlink_sections,
|
||||||
|
{$else I8086_SMARTLINK_SECTIONS}
|
||||||
|
tf_smartlink_library,
|
||||||
|
tf_no_objectfiles_when_smartlinking,
|
||||||
|
{$endif I8086_SMARTLINK_SECTIONS}
|
||||||
|
tf_cld,
|
||||||
tf_no_generic_stackcheck,tf_emit_stklen];
|
tf_no_generic_stackcheck,tf_emit_stklen];
|
||||||
cpu : cpu_i8086;
|
cpu : cpu_i8086;
|
||||||
unit_env : '';
|
unit_env : '';
|
||||||
|
@ -41,9 +41,14 @@ unit i_msdos;
|
|||||||
system : system_i8086_msdos;
|
system : system_i8086_msdos;
|
||||||
name : 'MS-DOS 16-bit real mode';
|
name : 'MS-DOS 16-bit real mode';
|
||||||
shortname : 'MSDOS';
|
shortname : 'MSDOS';
|
||||||
flags : [tf_use_8_3,tf_smartlink_library,
|
flags : [tf_use_8_3,
|
||||||
tf_no_objectfiles_when_smartlinking,tf_cld,
|
{$ifdef I8086_SMARTLINK_SECTIONS}
|
||||||
tf_no_generic_stackcheck,tf_emit_stklen];
|
tf_smartlink_sections,
|
||||||
|
{$else I8086_SMARTLINK_SECTIONS}
|
||||||
|
tf_smartlink_library,
|
||||||
|
tf_no_objectfiles_when_smartlinking,
|
||||||
|
{$endif I8086_SMARTLINK_SECTIONS}
|
||||||
|
tf_cld,tf_no_generic_stackcheck,tf_emit_stklen];
|
||||||
cpu : cpu_i8086;
|
cpu : cpu_i8086;
|
||||||
unit_env : 'MSDOSUNITS';
|
unit_env : 'MSDOSUNITS';
|
||||||
extradefines : '';
|
extradefines : '';
|
||||||
|
@ -41,9 +41,14 @@ unit i_win16;
|
|||||||
system : system_i8086_win16;
|
system : system_i8086_win16;
|
||||||
name : 'Win16 for x86';
|
name : 'Win16 for x86';
|
||||||
shortname : 'Win16';
|
shortname : 'Win16';
|
||||||
flags : [tf_use_8_3,tf_smartlink_library,
|
flags : [tf_use_8_3,
|
||||||
tf_no_objectfiles_when_smartlinking,tf_cld,
|
{$ifdef I8086_SMARTLINK_SECTIONS}
|
||||||
tf_no_generic_stackcheck,tf_emit_stklen,
|
tf_smartlink_sections,
|
||||||
|
{$else I8086_SMARTLINK_SECTIONS}
|
||||||
|
tf_smartlink_library,
|
||||||
|
tf_no_objectfiles_when_smartlinking,
|
||||||
|
{$endif I8086_SMARTLINK_SECTIONS}
|
||||||
|
tf_cld,tf_no_generic_stackcheck,tf_emit_stklen,
|
||||||
tf_x86_far_procs_push_odd_bp];
|
tf_x86_far_procs_push_odd_bp];
|
||||||
cpu : cpu_i8086;
|
cpu : cpu_i8086;
|
||||||
unit_env : 'WIN16UNITS';
|
unit_env : 'WIN16UNITS';
|
||||||
|
Loading…
Reference in New Issue
Block a user