[PATCH 1.0/4 v2] MIPS/GAS: Fix equated symbols in relaxation

Maciej W. Rozycki macro@codesourcery.com
Fri Oct 29 14:37:00 GMT 2010
Hi,

 Equated symbols (defined with .eqv) are not yet fully resolved by the 
time relaxation is made.  As a result, if used in a relaxed expression, 
they cause a failure as follows:

branch-self.s:30: Error: attempt to get value of unresolved symbol `fnord'

 The fix is to use the result of the resolver function called for the 
symbol at this point rather than trying to obtain the final value of the 
symbol itself.  As this final fix actually comes from you, you get the 
credit in the ChangeLog entry. :)

2010-10-29  Richard Sandiford  <rdsandiford@googlemail.com>

	gas/
	* config/tc-mips.c (md_convert_frag): Remove a call to
	S_GET_VALUE and use the result of resolve_symbol_value as the 
	value of the symbol processed in MIPS16 relaxation.

 OK to apply?

  Maciej

binutils-gas-mips-eqv-relax.diff
Index: binutils-fsf-trunk-quilt/gas/config/tc-mips.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/config/tc-mips.c	2010-10-29 09:07:06.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/config/tc-mips.c	2010-10-29 09:07:10.000000000 +0100
@@ -14542,8 +14542,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNU
 	  ext = FALSE;
 	}
 
-      resolve_symbol_value (fragp->fr_symbol);
-      val = S_GET_VALUE (fragp->fr_symbol);
+      val = resolve_symbol_value (fragp->fr_symbol);
       if (op->pcrel)
 	{
 	  addressT addr;



More information about the Binutils mailing list