This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 1.0/4 v2] MIPS/GAS: Fix equated symbols in relaxation
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: Catherine Moore <clm at codesourcery dot com>, binutils at sourceware dot org
- Date: Fri, 29 Oct 2010 15:36:51 +0100 (BST)
- Subject: [PATCH 1.0/4 v2] MIPS/GAS: Fix equated symbols in relaxation
- References: <alpine.DEB.1.10.1007241701380.29495@tp.orcam.me.uk>
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;