aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorCatherine Moore <clm@redhat.com>2008-05-09 19:28:47 +0000
committerCatherine Moore <clm@redhat.com>2008-05-09 19:28:47 +0000
commit35903be00caecb8248eb38414b3fad3fee65fbe8 (patch)
treef3be6c13f08f4763a73d15ca2d7ec1dbee926149 /gas/config/tc-mips.c
parent7ae0e2a243189fe9573b6229cc5464c1db20cc14 (diff)
downloadgdb-35903be00caecb8248eb38414b3fad3fee65fbe8.zip
gdb-35903be00caecb8248eb38414b3fad3fee65fbe8.tar.gz
gdb-35903be00caecb8248eb38414b3fad3fee65fbe8.tar.bz2
gas/
* config/tc-mips.c (mips_frob_file): Don't match MIPS16 relocs with non-MIPS16 relocs. gas/testsuite/ * gas/mips/mips16-hilo-match.s: New test. * gas/mips/mip16-hilo-match.d: New test output.Index: config/tc-mips.c
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 4a84e4d..1cac610 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -11749,6 +11749,7 @@ void
mips_frob_file (void)
{
struct mips_hi_fixup *l;
+ bfd_reloc_code_real_type looking_for_rtype = BFD_RELOC_UNUSED;
for (l = mips_hi_fixup_list; l != NULL; l = l->next)
{
@@ -11778,13 +11779,19 @@ mips_frob_file (void)
hi_pos = NULL;
lo_pos = NULL;
matched_lo_p = FALSE;
+
+ if (l->fixp->fx_r_type == BFD_RELOC_MIPS16_HI16
+ || l->fixp->fx_r_type == BFD_RELOC_MIPS16_HI16_S)
+ looking_for_rtype = BFD_RELOC_MIPS16_LO16;
+ else
+ looking_for_rtype = BFD_RELOC_LO16;
+
for (pos = &seginfo->fix_root; *pos != NULL; pos = &(*pos)->fx_next)
{
if (*pos == l->fixp)
hi_pos = pos;
- if (((*pos)->fx_r_type == BFD_RELOC_LO16
- || (*pos)->fx_r_type == BFD_RELOC_MIPS16_LO16)
+ if ((*pos)->fx_r_type == looking_for_rtype
&& (*pos)->fx_addsy == l->fixp->fx_addsy
&& (*pos)->fx_offset >= l->fixp->fx_offset
&& (lo_pos == NULL