[patch] MIPS/gas: GPREL16 relocs against constants
Maciej W. Rozycki
macro@linux-mips.org
Thu Apr 14 14:50:00 GMT 2005
Hello,
Due to a recent code rearrangement we now attempt to emit GPREL16 relocs
against constants for the "ldd_std" case in macro(). This is of course
not going to work, and actually ends up with an assertion failure later.
Here's an obvious fix.
2005-04-14 Maciej W. Rozycki <macro@linux-mips.org>
* config/tc-mips.c (macro) [ldd_std]: Don't attempt the GP
optimization for constant addresses.
OK to apply?
Maciej
binutils-2.15.96-20050331-mips-gas-gprel-symbol.patch
diff -up --recursive --new-file binutils-2.15.96-20050331.macro/gas/config/tc-mips.c binutils-2.15.96-20050331/gas/config/tc-mips.c
--- binutils-2.15.96-20050331.macro/gas/config/tc-mips.c 2005-03-22 04:25:33.000000000 +0000
+++ binutils-2.15.96-20050331/gas/config/tc-mips.c 2005-04-11 02:44:42.000000000 +0000
@@ -6397,7 +6397,8 @@ macro (struct mips_cl_insn *ip)
If there is a base register, we add it to $at after the
lui instruction. If there is a constant, we always use
the last case. */
- if ((valueT) offset_expr.X_add_number <= MAX_GPREL_OFFSET
+ if (offset_expr.X_op == O_symbol
+ && (valueT) offset_expr.X_add_number <= MAX_GPREL_OFFSET
&& !nopic_need_relax (offset_expr.X_add_symbol, 1))
{
relax_start (offset_expr.X_add_symbol);
More information about the Binutils
mailing list