===================================================================
@@ -1669,10 +1669,13 @@ mips_classify_symbol (const_rtx x, enum
if (GET_CODE (x) == LABEL_REF)
{
- /* LABEL_REFs are used for jump tables as well as text labels.
- Only return SYMBOL_PC_RELATIVE if we know the label is in
- the text section. */
- if (TARGET_MIPS16_SHORT_JUMP_TABLES)
+ /* Only return SYMBOL_PC_RELATIVE if we are generating MIPS16
+ code and if we know that the label is in the current function's
+ text section. LABEL_REFs are used for jump tables as well as
+ text labels, so we must check whether jump tables live in the
+ text section. */
+ if (TARGET_MIPS16_SHORT_JUMP_TABLES
+ && !LABEL_REF_NONLOCAL_P (x))
return SYMBOL_PC_RELATIVE;
if (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS)