mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 15:29:14 +02:00
aggas: removed a bunch of amiga related hacks which are unnecessary if those systems use an aout GAS writer. made it possible to inject sectionattrs in a generic way
git-svn-id: trunk@35115 -
This commit is contained in:
parent
2dc1d681c2
commit
f1f18d6f83
@ -46,6 +46,7 @@ interface
|
|||||||
TGNUAssembler=class(texternalassembler)
|
TGNUAssembler=class(texternalassembler)
|
||||||
protected
|
protected
|
||||||
function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;virtual;
|
function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;virtual;
|
||||||
|
function sectionattrs(atype:TAsmSectiontype):string;virtual;
|
||||||
function sectionattrs_coff(atype:TAsmSectiontype):string;virtual;
|
function sectionattrs_coff(atype:TAsmSectiontype):string;virtual;
|
||||||
function sectionalignment_aix(atype:TAsmSectiontype;secalign: byte):string;
|
function sectionalignment_aix(atype:TAsmSectiontype;secalign: byte):string;
|
||||||
procedure WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:byte);
|
procedure WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:byte);
|
||||||
@ -215,11 +216,7 @@ implementation
|
|||||||
{$else arm}
|
{$else arm}
|
||||||
'.data',
|
'.data',
|
||||||
{$endif arm}
|
{$endif arm}
|
||||||
{$if defined(m68k)} { Amiga/m68k GNU AS doesn't seem to like .rodata (KB) }
|
|
||||||
'.data',
|
|
||||||
{$else}
|
|
||||||
'.rodata',
|
'.rodata',
|
||||||
{$endif}
|
|
||||||
'.bss',
|
'.bss',
|
||||||
'.threadvar',
|
'.threadvar',
|
||||||
'.pdata',
|
'.pdata',
|
||||||
@ -342,11 +339,7 @@ implementation
|
|||||||
secname:=secnames_pic[atype]
|
secname:=secnames_pic[atype]
|
||||||
else
|
else
|
||||||
secname:=secnames[atype];
|
secname:=secnames[atype];
|
||||||
{$ifdef m68k}
|
|
||||||
{ Amiga/Atari GNU AS doesn't support .section .fpc }
|
|
||||||
if (atype=sec_fpc) and (target_info.system in [system_m68k_amiga, system_m68k_atari]) then
|
|
||||||
secname:=secnames[sec_data];
|
|
||||||
{$endif}
|
|
||||||
if (atype=sec_fpc) and (Copy(aname,1,3)='res') then
|
if (atype=sec_fpc) and (Copy(aname,1,3)='res') then
|
||||||
begin
|
begin
|
||||||
result:=secname+'.'+aname;
|
result:=secname+'.'+aname;
|
||||||
@ -384,6 +377,14 @@ implementation
|
|||||||
result:=secname;
|
result:=secname;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TGNUAssembler.sectionattrs(atype:TAsmSectiontype):string;
|
||||||
|
begin
|
||||||
|
result:='';
|
||||||
|
if (target_info.system in [system_i386_win32,system_x86_64_win64]) then
|
||||||
|
begin
|
||||||
|
result:=sectionattrs_coff(atype);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TGNUAssembler.sectionattrs_coff(atype:TAsmSectiontype):string;
|
function TGNUAssembler.sectionattrs_coff(atype:TAsmSectiontype):string;
|
||||||
begin
|
begin
|
||||||
@ -511,10 +512,9 @@ implementation
|
|||||||
|
|
||||||
TODO: This likely applies to all systems which smartlink without
|
TODO: This likely applies to all systems which smartlink without
|
||||||
creating libraries }
|
creating libraries }
|
||||||
if (target_info.system in [system_i386_win32,system_x86_64_win64]) and
|
if is_smart_section(atype) and (aname<>'') then
|
||||||
is_smart_section(atype) and (aname<>'') then
|
|
||||||
begin
|
begin
|
||||||
s:=sectionattrs_coff(atype);
|
s:=sectionattrs(atype);
|
||||||
if (s<>'') then
|
if (s<>'') then
|
||||||
writer.AsmWrite(',"'+s+'"');
|
writer.AsmWrite(',"'+s+'"');
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user