Browse Source

* m68k: allow vasm to be used for system_m68k_embedded target, simplify some code

Karoly Balogh 3 years ago
parent
commit
10191477ae
1 changed files with 10 additions and 7 deletions
  1. 10 7
      compiler/m68k/ag68kvasm.pas

+ 10 - 7
compiler/m68k/ag68kvasm.pas

@@ -68,15 +68,17 @@ unit ag68kvasm;
         case atype of
         case atype of
           sec_code, sec_fpc, sec_init, sec_fini:
           sec_code, sec_fpc, sec_init, sec_fini:
             result:='acrx';
             result:='acrx';
-          { map sec_rodata as read-write, otherwise the linker (vlink) complains if it
-            has to write into the relocations in a rodata section. (KB) }
-          sec_data, sec_rodata:
+          sec_data:
             result:='adrw';
             result:='adrw';
+          sec_rodata,
           sec_rodata_norel:
           sec_rodata_norel:
+            { map sec_rodata and sec_nodata_norel as read-write, otherwise the linker
+              (vlink) complains if it has to write into the relocations in a rodata,
+              and if it has to merge rodata and data sections on Amiga/Atari. (KB) }
             case target_info.system of
             case target_info.system of
-              { stop vlink from complaining when it merges ro sections into rw ones (KB) }
-              system_m68k_atari: result:='adrw';
-              system_m68k_amiga: result:='adrw';
+              system_m68k_atari,
+              system_m68k_amiga:
+                result:='adrw';
             else
             else
               result:='adr';
               result:='adr';
             end;
             end;
@@ -99,6 +101,7 @@ unit ag68kvasm;
           { a.out doesn't support named sections, lets use ELF for interoperability }
           { a.out doesn't support named sections, lets use ELF for interoperability }
           system_m68k_amiga,
           system_m68k_amiga,
           system_m68k_atari,
           system_m68k_atari,
+          system_m68k_embedded,
           system_m68k_sinclairql: objtype:='-Felf';
           system_m68k_sinclairql: objtype:='-Felf';
         else
         else
           internalerror(2016052601);
           internalerror(2016052601);
@@ -133,7 +136,7 @@ unit ag68kvasm;
          idtxt  : 'VASM';
          idtxt  : 'VASM';
          asmbin : 'vasmm68k_std';
          asmbin : 'vasmm68k_std';
          asmcmd:  '-quiet -elfregs -gas $OTYPE $ARCH -o $OBJ $EXTRAOPT $ASM';
          asmcmd:  '-quiet -elfregs -gas $OTYPE $ARCH -o $OBJ $EXTRAOPT $ASM';
-         supported_targets : [system_m68k_amiga,system_m68k_atari,system_m68k_sinclairql];
+         supported_targets : [system_m68k_amiga,system_m68k_atari,system_m68k_sinclairql,system_m68k_embedded];
          flags : [af_needar,af_smartlink_sections];
          flags : [af_needar,af_smartlink_sections];
          labelprefix : '.L';
          labelprefix : '.L';
          labelmaxlen : -1;
          labelmaxlen : -1;