public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] MIPS/gas: GPREL16 relocs against constants
@ 2005-04-14 14:50 Maciej W. Rozycki
  2005-04-14 15:11 ` Thiemo Seufer
  0 siblings, 1 reply; 4+ messages in thread
From: Maciej W. Rozycki @ 2005-04-14 14:50 UTC (permalink / raw)
  To: binutils

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);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-14 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-14 14:50 [patch] MIPS/gas: GPREL16 relocs against constants Maciej W. Rozycki
2005-04-14 15:11 ` Thiemo Seufer
2005-04-14 15:33   ` Maciej W. Rozycki
2005-04-14 15:36     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).