aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1996-04-18 00:36:41 -0600
committerJeff Law <law@gcc.gnu.org>1996-04-18 00:36:41 -0600
commit25ce77f44769e38b0bcffd732ebb39cd254ed9b3 (patch)
treea219ee34e16a7b594eb08e216fce1a03eef50ad9
parentc182a405dd7e4314fe9dd152bf586d15feaa9fa5 (diff)
downloadgcc-25ce77f44769e38b0bcffd732ebb39cd254ed9b3.zip
gcc-25ce77f44769e38b0bcffd732ebb39cd254ed9b3.tar.gz
gcc-25ce77f44769e38b0bcffd732ebb39cd254ed9b3.tar.bz2
pa.h (SELECT_SECTION): Define.
* pa/pa.h (SELECT_SECTION): Define. Never place a something into the read-only data section if it requires a reloc. From-SVN: r11847
-rw-r--r--gcc/config/pa/pa.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index e873e6a..ab60c17 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -1557,6 +1557,26 @@ while (0)
1 + (SYMBOL_NAME)[1] == '@'\
: (SYMBOL_NAME)[0] == '@'))
+/* On hpux10, the linker will give an error if we have a reference
+ in the read-only data section to a symbol defined in a shared
+ library. Therefore, expressions that might require a reloc can
+ not be placed in the read-only data section. */
+#define SELECT_SECTION(EXP,RELOC) \
+ if (TREE_CODE (EXP) == VAR_DECL \
+ && TREE_READONLY (EXP) \
+ && !TREE_THIS_VOLATILE (EXP) \
+ && DECL_INITIAL (EXP) \
+ && (DECL_INITIAL (EXP) == error_mark_node \
+ || TREE_CONSTANT (DECL_INITIAL (EXP))) \
+ && !reloc) \
+ readonly_data_section (); \
+ else if (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'c' \
+ && !(TREE_CODE (EXP) == STRING_CST && flag_writable_strings) \
+ && !reloc) \
+ readonly_data_section (); \
+ else \
+ data_section ();
+
/* Arghh. This is used for stuff in the constant pool; this may include
function addresses on the PA, which during PIC code generation must
reside in the data space. Unfortunately, there's no way to determine