diff --git a/compiler/aggas.pas b/compiler/aggas.pas index 8f163f8d49..ecec817614 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -447,9 +447,14 @@ implementation writer.AsmLn; case target_info.system of system_i386_OS2, - system_i386_EMX, + system_i386_EMX: ; system_m68k_atari, { atari tos/mint GNU AS also doesn't seem to like .section (KB) } - system_m68k_amiga: ; { amiga has old GNU AS (2.14), which blews up from .section (KB) } + system_m68k_amiga: { amiga has old GNU AS (2.14), which blews up from .section (KB) } + begin + { ... but vasm is GAS compatible on amiga/atari, and supports named sections } + if create_smartlink_sections then + writer.AsmWrite('.section '); + end; system_powerpc_darwin, system_i386_darwin, system_i386_iphonesim, diff --git a/compiler/m68k/ag68kgas.pas b/compiler/m68k/ag68kgas.pas index 5dff4af16d..fc8f44bc57 100644 --- a/compiler/m68k/ag68kgas.pas +++ b/compiler/m68k/ag68kgas.pas @@ -320,13 +320,29 @@ interface idtxt : 'AS'; asmbin : 'as'; asmcmd : '$ARCH -o $OBJ $EXTRAOPT $ASM'; - supported_targets : [system_m68k_Amiga,system_m68k_Atari,system_m68k_Mac,system_m68k_linux,system_m68k_PalmOS,system_m68k_netbsd,system_m68k_openbsd,system_m68k_embedded]; + supported_targets : [system_m68k_Mac,system_m68k_linux,system_m68k_PalmOS,system_m68k_netbsd,system_m68k_openbsd,system_m68k_embedded]; flags : [af_needar,af_smartlink_sections]; labelprefix : '.L'; comment : '# '; dollarsign: '$'; ); + as_m68k_as_aout_info : tasminfo = + ( + id : as_m68k_as_aout; + idtxt : 'AS'; + asmbin : 'as'; + asmcmd : '$ARCH -o $OBJ $EXTRAOPT $ASM'; + supported_targets : [system_m68k_Amiga,system_m68k_Atari]; + flags : [af_needar]; + labelprefix : '.L'; + comment : '# '; + dollarsign: '$'; + ); + + + initialization RegisterAssembler(as_m68k_as_info,Tm68kGNUAssembler); + RegisterAssembler(as_m68k_as_aout_info,Tm68kGNUAssembler); end. diff --git a/compiler/m68k/ag68kvasm.pas b/compiler/m68k/ag68kvasm.pas index 754c57bfc1..d1a840680f 100644 --- a/compiler/m68k/ag68kvasm.pas +++ b/compiler/m68k/ag68kvasm.pas @@ -67,8 +67,10 @@ unit ag68kvasm; result:=asminfo^.asmcmd; case target_info.system of + { a.out doesn't support named sections } system_m68k_amiga: objtype:='-Fhunk'; - system_m68k_atari: objtype:='-Fvobj'; // fix me? + { atari never had a standard object format, a.out is limited, vasm/vlink author recommends vobj } + system_m68k_atari: objtype:='-Fvobj'; system_m68k_linux: objtype:='-Felf'; else internalerror(2016052601); diff --git a/compiler/systems.inc b/compiler/systems.inc index e0ff83b5c6..0d1cad99ba 100644 --- a/compiler/systems.inc +++ b/compiler/systems.inc @@ -225,6 +225,7 @@ ,as_clang ,as_solaris_as ,as_m68k_vasm + ,as_m68k_as_aout ); tlink = (ld_none, diff --git a/compiler/systems/i_amiga.pas b/compiler/systems/i_amiga.pas index 6d108e88a4..5d51903c52 100644 --- a/compiler/systems/i_amiga.pas +++ b/compiler/systems/i_amiga.pas @@ -34,7 +34,7 @@ unit i_amiga; system : system_m68k_Amiga; name : 'Commodore Amiga'; shortname : 'amiga'; - flags : [tf_files_case_aware,tf_requires_proper_alignment,tf_has_winlike_resources]; + flags : [tf_files_case_aware,tf_requires_proper_alignment,tf_has_winlike_resources,tf_smartlink_sections]; cpu : cpu_m68k; unit_env : 'AMIGAUNITS'; extradefines : 'HASAMIGA;AMIGA68K'; @@ -61,8 +61,8 @@ unit i_amiga; Cprefix : ''; newline : #10; dirsep : '/'; - assem : as_gas; - assemextern : as_gas; + assem : as_m68k_as_aout; + assemextern : as_m68k_as_aout; link : ld_none; linkextern : ld_amiga; ar : ar_gnu_ar; diff --git a/compiler/systems/i_atari.pas b/compiler/systems/i_atari.pas index 89e0eca252..498f1e2199 100644 --- a/compiler/systems/i_atari.pas +++ b/compiler/systems/i_atari.pas @@ -34,7 +34,7 @@ unit i_atari; system : system_m68k_Atari; name : 'Atari ST/STE'; shortname : 'atari'; - flags : [tf_use_8_3,tf_requires_proper_alignment]; + flags : [tf_use_8_3,tf_requires_proper_alignment,tf_smartlink_sections]; cpu : cpu_m68k; unit_env : ''; extradefines : ''; @@ -61,8 +61,8 @@ unit i_atari; Cprefix : '_'; newline : #10; dirsep : '/'; - assem : as_gas; - assemextern : as_gas; + assem : as_m68k_as_aout; + assemextern : as_m68k_as_aout; link : ld_atari; linkextern : ld_atari; ar : ar_gnu_ar;