Sfoglia il codice sorgente

* introduce and use support_rodata define in the compiler

florian 6 giorni fa
parent
commit
4ce0b7932a
3 ha cambiato i file con 12 aggiunte e 6 eliminazioni
  1. 3 3
      compiler/aggas.pas
  2. 6 0
      compiler/fpcdefs.inc
  3. 3 3
      compiler/ogwasm.pas

+ 3 - 3
compiler/aggas.pas

@@ -224,11 +224,11 @@ implementation
 { vtable for a class called Window:                                       }
 { .section .data.rel.ro._ZTV6Window,"awG",@progbits,_ZTV6Window,comdat    }
 { TODO: .data.ro not yet working}
-{$if defined(arm) or defined(aarch64) or defined(riscv64) or defined(powerpc) or defined(x86_64) or defined(loongarch64)}
+{$if defined(support_rodata)}
           '.rodata',
-{$else defined(arm) or defined(aarch64) or defined(riscv64) or defined(powerpc) or defined(x86_64) or defined(loongarch64)}
+{$else defined(support_rodata)}
           '.data',
-{$endif defined(arm) or defined(aarch64) or defined(riscv64) or defined(powerpc) or defined(x86_64) or defined(loongarch64)}
+{$endif defined(support_rodata)}
           '.rodata',
           '.bss',
           '.threadvar',

+ 6 - 0
compiler/fpcdefs.inc

@@ -142,6 +142,7 @@
   {$define SUPPORT_GET_FRAME}
   {$define cpucapabilities}
   {$define fpucapabilities}
+  {$define support_rodata}
 {$endif x86_64}
 
 {$ifdef sparc}
@@ -184,6 +185,7 @@
   {$define SUPPORT_SAFECALL}
   {$define SUPPORT_GET_FRAME}
   {$define CPU_BC_HAS_SIZE_LIMIT}
+  {$define support_rodata}
 {$endif powerpc}
 
 {$ifdef powerpc64}
@@ -214,6 +216,7 @@
   {$define fpucapabilities}
   {$define SUPPORT_SAFECALL}
   {$define SUPPORT_GET_FRAME}
+  {$define support_rodata}
   { default to armel }
   {$if not(defined(CPUARM)) and not(defined(CPUARMEB)) and not(defined(FPC_OARM)) and not(defined(FPC_ARMEB)) and not(defined(FPC_ARMHF))}
     {$define FPC_ARMEL}
@@ -342,6 +345,7 @@
   {$define SUPPORT_SAFECALL}
   {$define cpucapabilities}
   {$define fpucapabilities}
+  {$define support_rodata}
 {$endif aarch64}
 
 {$ifdef riscv32}
@@ -385,6 +389,7 @@
   {$define cpucapabilities}
   {$define cpurequiresproperalignment}
   {$define SUPPORT_SAFECALL}
+  {$define support_rodata}
 {$endif riscv64}
 
 {$ifdef xtensa}
@@ -408,6 +413,7 @@
   {$define cputargethasfixedstack}
   {$define cpucapabilities}
   {$define SUPPORT_SAFECALL}
+  {$define support_rodata}
 {$endif loongarch64}
 
 { Stabs is not officially supported on 64 bit targets by gdb, except on Mac OS X

+ 3 - 3
compiler/ogwasm.pas

@@ -959,11 +959,11 @@ implementation
 { vtable for a class called Window:                                       }
 { .section .data.rel.ro._ZTV6Window,"awG",@progbits,_ZTV6Window,comdat    }
 { TODO: .data.ro not yet working}
-{$if defined(arm) or defined(riscv64) or defined(powerpc)}
+{$if defined(support_rodata)}
           '.rodata',
-{$else defined(arm) or defined(riscv64) or defined(powerpc)}
+{$else defined(support_rodata)}
           '.data',
-{$endif defined(arm) or defined(riscv64) or defined(powerpc)}
+{$endif defined(support_rodata)}
           '.rodata',
           '.bss',
           '.tbss',