Parcourir la source

* do not write section flags/progbits for .data, .rodata .data.norel as the compiler will ignore them anyways and warn about it

git-svn-id: trunk@43428 -
florian il y a 5 ans
Parent
commit
40bbb28fd2
1 fichiers modifiés avec 9 ajouts et 4 suppressions
  1. 9 4
      compiler/aggas.pas

+ 9 - 4
compiler/aggas.pas

@@ -216,9 +216,9 @@ implementation
 { TODO: .data.ro not yet working}
 { TODO: .data.ro not yet working}
 {$if defined(arm) or defined(riscv64) or defined(powerpc)}
 {$if defined(arm) or defined(riscv64) or defined(powerpc)}
           '.rodata',
           '.rodata',
-{$else arm}
+{$else defined(arm) or defined(riscv64) or defined(powerpc)}
           '.data',
           '.data',
-{$endif arm}
+{$endif defined(arm) or defined(riscv64) or defined(powerpc)}
           '.rodata',
           '.rodata',
           '.bss',
           '.bss',
           '.threadvar',
           '.threadvar',
@@ -521,8 +521,13 @@ implementation
          else
          else
            begin
            begin
              writer.AsmWrite('.section ');
              writer.AsmWrite('.section ');
-             sectionflags:=true;
-             sectionprogbits:=true;
+             { sectionname may rename those sections, so we do not write flags/progbits for them,
+               the assembler will ignore them/spite out a warning anyways }
+             if not(atype in [sec_data,sec_rodata,sec_rodata_norel]) then
+               begin
+                 sectionflags:=true;
+                 sectionprogbits:=true;
+               end;
            end
            end
         end;
         end;
         s:=sectionname(atype,aname,aorder);
         s:=sectionname(atype,aname,aorder);