aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-frv.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2004-05-08 07:05:32 +0000
committerAlexandre Oliva <aoliva@redhat.com>2004-05-08 07:05:32 +0000
commit3f980e41d7770c22ca8a2632d76a69443c4f190e (patch)
treea5d32470a4c1c21918485602f3359e5543687f1e /bfd/elf32-frv.c
parentf4ca1d1f2262adfc170c511006ef2d1684cda694 (diff)
downloadgdb-3f980e41d7770c22ca8a2632d76a69443c4f190e.zip
gdb-3f980e41d7770c22ca8a2632d76a69443c4f190e.tar.gz
gdb-3f980e41d7770c22ca8a2632d76a69443c4f190e.tar.bz2
* elf32-frv.c (_frvfdpic_add_dyn_reloc): Don't warn when we get
a zero symndx for which we hadn't accounted a dynamic relocation. (_frvfdpic_add_rofixup): Likewise.
Diffstat (limited to 'bfd/elf32-frv.c')
-rw-r--r--bfd/elf32-frv.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 59a312b..cf3195a 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -939,8 +939,18 @@ _frvfdpic_add_dyn_reloc (bfd *output_bfd, asection *sreloc, bfd_vma offset,
sreloc->contents + reloc_offset);
sreloc->reloc_count++;
- BFD_ASSERT (entry->dynrelocs > 0);
- entry->dynrelocs--;
+ /* If the entry's index is zero, this relocation was probably to a
+ linkonce section that got discarded. We reserved a dynamic
+ relocation, but it was for another entry than the one we got at
+ the time of emitting the relocation. Unfortunately there's no
+ simple way for us to catch this situation, since the relocation
+ is cleared right before calling relocate_section, at which point
+ we no longer know what the relocation used to point to. */
+ if (entry->symndx)
+ {
+ BFD_ASSERT (entry->dynrelocs > 0);
+ entry->dynrelocs--;
+ }
return reloc_offset;
}
@@ -964,8 +974,10 @@ _frvfdpic_add_rofixup (bfd *output_bfd, asection *rofixup, bfd_vma offset,
}
rofixup->reloc_count++;
- if (entry)
+ if (entry && entry->symndx)
{
+ /* See discussion about symndx == 0 in _frvfdpic_add_dyn_reloc
+ above. */
BFD_ASSERT (entry->fixups > 0);
entry->fixups--;
}