* elf32-frv.c (_frvfdpic_add_dyn_reloc): Don't warn when we get
authorAlexandre Oliva <aoliva@redhat.com>
Sat, 8 May 2004 07:05:32 +0000 (07:05 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sat, 8 May 2004 07:05:32 +0000 (07:05 +0000)
a zero symndx for which we hadn't accounted a dynamic relocation.
(_frvfdpic_add_rofixup): Likewise.

bfd/ChangeLog
bfd/elf32-frv.c

index 68afdb31436465bf73dad660be053ebc74aa8875..a9088e57c965048cf3ab9e30107942351da13c44 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-08  Alexandre Oliva  <aoliva@redhat.com>
+
+       * 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.
+
 2004-05-07  Brian Ford  <ford@vss.fsi.com>
             DJ Delorie  <dj@redhat.com>
 
index 59a312be8e2895266fc465d8c2a6f080daf1cae2..cf3195acd7b49c906db2a8d666039400a794c8c4 100644 (file)
@@ -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--;
     }
This page took 0.028588 seconds and 4 git commands to generate.