diff options
author | Gavin Romig-Koch <gavin@cygnus.com> | 1998-08-12 09:42:55 +0000 |
---|---|---|
committer | Gavin Romig-Koch <gavin@gcc.gnu.org> | 1998-08-12 09:42:55 +0000 |
commit | a9e3e61181a132cb8a774a6922813100e659c7d9 (patch) | |
tree | d8903ec183b203939b7cb3a1b9317ab385a6db6e /gcc | |
parent | 87183d21f5188965d91773391da653b23640365c (diff) | |
download | gcc-a9e3e61181a132cb8a774a6922813100e659c7d9.zip gcc-a9e3e61181a132cb8a774a6922813100e659c7d9.tar.gz gcc-a9e3e61181a132cb8a774a6922813100e659c7d9.tar.bz2 |
mips.h (ENCODE_SECTION_INFO): Set SYMBOL_REF_FLAG for VAR_DECL's in gp addressable sections.
* mips/mips.h (ENCODE_SECTION_INFO): Set SYMBOL_REF_FLAG for
VAR_DECL's in gp addressable sections.
From-SVN: r21681
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 18 |
2 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7922056..26cd943 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Wed Aug 12 12:39:16 1998 Gavin Romig-Koch <gavin@cygnus.com> + + * mips/mips.h (ENCODE_SECTION_INFO): Set SYMBOL_REF_FLAG for + VAR_DECL's in gp addressable sections. + Tue Aug 11 23:02:31 1998 John Carr <jfc@mit.edu> * sparc.c: Change return <exp> to <exp>; return; in functions diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 27256e5..8bf22c3 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -3043,7 +3043,13 @@ typedef struct mips_args { constants which are put in the .text section. We also record the total length of all such strings; this total is used to decide whether we need to split the constant table, and need not be - precisely correct. */ + precisely correct. + + When not mips16 code nor embedded PIC, if a symbol is in a + gp addresable section, SYMBOL_REF_FLAG is set prevent gcc from + splitting the reference so that gas can generate a gp relative + reference. + */ #define ENCODE_SECTION_INFO(DECL) \ do \ @@ -3070,6 +3076,16 @@ do \ SYMBOL_REF_FLAG (XEXP (TREE_CST_RTL (DECL), 0)) = 1; \ } \ \ + else if (TREE_CODE (DECL) == VAR_DECL \ + && DECL_SECTION_NAME (DECL) != NULL_TREE \ + && (0 == strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (DECL)), \ + ".sdata") \ + || 0 == strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (DECL)),\ + ".sbss"))) \ + { \ + SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; \ + } \ + \ else if (TARGET_GP_OPT && TREE_CODE (DECL) == VAR_DECL) \ { \ int size = int_size_in_bytes (TREE_TYPE (DECL)); \ |