aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips/mips.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r--gcc/config/mips/mips.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index f923ef44ca5..d94604e00d8 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -919,14 +919,19 @@ mips_classify_symbol (x)
return SYMBOL_GENERAL;
}
- /* SYMBOL_REF_FLAG is overloaded for mips16 code: it can indicate a
- string constant or a GP-relative access. Check for strings here. */
- if (TARGET_MIPS16
- && SYMBOL_REF_FLAG (x)
- && XSTR (x, 0)[0] == '*'
+ if (XSTR (x, 0)[0] == '*'
&& strncmp (XSTR (x, 0) + 1, LOCAL_LABEL_PREFIX,
sizeof LOCAL_LABEL_PREFIX - 1) == 0)
- return SYMBOL_CONSTANT_POOL;
+ {
+ /* The symbol is a local label. For TARGET_MIPS16, SYMBOL_REF_FLAG
+ will be set if the symbol refers to a string in the current
+ function's constant pool. */
+ if (TARGET_MIPS16 && SYMBOL_REF_FLAG (x))
+ return SYMBOL_CONSTANT_POOL;
+
+ if (TARGET_ABICALLS)
+ return SYMBOL_GOT_LOCAL;
+ }
if (TARGET_ABICALLS)
return (SYMBOL_REF_FLAG (x) ? SYMBOL_GOT_LOCAL : SYMBOL_GOT_GLOBAL);