]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000.c (rs6000_select_section): Treat DEFAULT_ABI == ABI_AIX like PIC.
authorDavid Edelsohn <edelsohn@gnu.org>
Sat, 24 Aug 2002 03:12:26 +0000 (03:12 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Sat, 24 Aug 2002 03:12:26 +0000 (23:12 -0400)
        * config/rs6000/rs6000.c (rs6000_select_section): Treat
        DEFAULT_ABI == ABI_AIX like PIC.  Test PIC & reloc for readonly
        default.
        (rs6000_unique_section): Likewise.

From-SVN: r56547

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index ba97b86d670a8cd7d272c66a18093017cd11369c..6cd1b836a755d4fdad09d2664e7ebedb2f43ceaf 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-23  David Edelsohn  <edelsohn@gnu.org>
+
+        * config/rs6000/rs6000.c (rs6000_select_section): Treat
+        DEFAULT_ABI == ABI_AIX like PIC.  Test PIC & reloc for readonly
+        default.
+        (rs6000_unique_section): Likewise.
+
 2002-08-22  Jason Merrill  <jason@redhat.com>
 
        * langhooks-def.h (LANG_HOOKS_EXPR_SIZE): New macro.
index 0976323fca6b476945bc0c172147845770112ef0..92b1d649964e91e07612124725faee179a739749 100644 (file)
@@ -10884,18 +10884,19 @@ rs6000_select_section (decl, reloc)
   if (TREE_CODE (decl) == STRING_CST)
     readonly = ! flag_writable_strings;
   else if (TREE_CODE (decl) == VAR_DECL)
-    readonly = (! (flag_pic && reloc)
+    readonly = (! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc)
                && TREE_READONLY (decl)
                && ! TREE_SIDE_EFFECTS (decl)
                && DECL_INITIAL (decl)
                && DECL_INITIAL (decl) != error_mark_node
                && TREE_CONSTANT (DECL_INITIAL (decl)));
   else if (TREE_CODE (decl) == CONSTRUCTOR)
-    readonly = (! (flag_pic && reloc)
+    readonly = (! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc)
                && ! TREE_SIDE_EFFECTS (decl)
                && TREE_CONSTANT (decl));
   else
-    readonly = 1;
+    readonly = ! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc);
+
   if (needs_sdata && rs6000_sdata != SDATA_EABI)
     readonly = 0;
   
@@ -10940,14 +10941,15 @@ rs6000_unique_section (decl, reloc)
       int needs_sdata;
       int size;
 
-      readonly = 1;
       if (TREE_CODE (decl) == STRING_CST)
        readonly = ! flag_writable_strings;
       else if (TREE_CODE (decl) == VAR_DECL)
-       readonly = (! (flag_pic && reloc)
+       readonly = (! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc)
                    && TREE_READONLY (decl)
                    && ! TREE_SIDE_EFFECTS (decl)
                    && TREE_CONSTANT (DECL_INITIAL (decl)));
+      else
+       readonly = ! ((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc);
 
       size = int_size_in_bytes (TREE_TYPE (decl));
       needs_sdata = (size > 0