aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2006-10-08 07:56:53 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2006-10-08 07:56:53 +0000
commit3ac25120de29ce52ab034ba79612657f8c9cdfbe (patch)
tree63fd828a5af025c0d901fd15587d0503a3ad9248
parentb994ed9b6c3f49ae32caf6755a09ff1deda7b97a (diff)
downloadgcc-3ac25120de29ce52ab034ba79612657f8c9cdfbe.zip
gcc-3ac25120de29ce52ab034ba79612657f8c9cdfbe.tar.gz
gcc-3ac25120de29ce52ab034ba79612657f8c9cdfbe.tar.bz2
mips.c (mips_classify_symbol): Do not return SYMBOL_SMALL_DATA if SYMBOL_REF_WEAK.
gcc/ * config/mips/mips.c (mips_classify_symbol): Do not return SYMBOL_SMALL_DATA if SYMBOL_REF_WEAK. (mips_in_small_data_p): Tweak comments. From-SVN: r117553
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/mips/mips.c11
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f14f174..a06e24a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2006-10-08 Richard Sandiford <richard@codesourcery.com>
+ * config/mips/mips.c (mips_classify_symbol): Do not return
+ SYMBOL_SMALL_DATA if SYMBOL_REF_WEAK.
+ (mips_in_small_data_p): Tweak comments.
+
+2006-10-08 Richard Sandiford <richard@codesourcery.com>
+
* config/mips/elf.h (HANDLE_PRAGMA_PUSH_POP): Define.
2006-10-07 Kazu Hirata <kazu@codesourcery.com>
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index ef4a35e..54fc3e1 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1221,7 +1221,10 @@ mips_classify_symbol (rtx x)
return SYMBOL_SMALL_DATA;
}
- if (SYMBOL_REF_SMALL_P (x))
+ /* Do not use small-data accesses for weak symbols; they may end up
+ being zero. */
+ if (SYMBOL_REF_SMALL_P (x)
+ && !SYMBOL_REF_WEAK (x))
return SYMBOL_SMALL_DATA;
if (TARGET_ABICALLS)
@@ -7313,8 +7316,10 @@ mips_function_rodata_section (tree decl)
return data_section;
}
-/* Implement TARGET_IN_SMALL_DATA_P. Return true if it would be safe to
- access DECL using %gp_rel(...)($gp). */
+/* Implement TARGET_IN_SMALL_DATA_P. This function controls whether
+ locally-defined objects go in a small data section. It also controls
+ the setting of the SYMBOL_REF_SMALL_P flag, which in turn helps
+ mips_classify_symbol decide when to use %gp_rel(...)($gp) accesses. */
static bool
mips_in_small_data_p (tree decl)