From: David Edelsohn Date: Sat, 24 Aug 2002 03:12:26 +0000 (+0000) Subject: rs6000.c (rs6000_select_section): Treat DEFAULT_ABI == ABI_AIX like PIC. X-Git-Tag: releases/gcc-3.2.1~359 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2089ea2a6e2b25a01f879d800020ec0b882ac6cd;p=thirdparty%2Fgcc.git rs6000.c (rs6000_select_section): Treat DEFAULT_ABI == ABI_AIX like PIC. * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba97b86d670a..6cd1b836a755 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-08-23 David Edelsohn + + * 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 * langhooks-def.h (LANG_HOOKS_EXPR_SIZE): New macro. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 0976323fca6b..92b1d649964e 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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