]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
baskport 2009-01-11 Jan Kratochvil <jan.kratochvil@redhat.com>
authorAlan Modra <amodra@gmail.com>
Mon, 2 Mar 2009 13:48:42 +0000 (13:48 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 2 Mar 2009 13:48:42 +0000 (13:48 +0000)
bfd/ChangeLog
bfd/elflink.c
ld/testsuite/ChangeLog

index dd5f6dbef8b9f13f168979d94a8eb0aff1f1c293..d623ea59121f1c05290a1e144880f5f49bb14cdb 100644 (file)
@@ -1,5 +1,9 @@
 2009-03-02  Alan Modra  <amodra@bigpond.net.au>
 
+       2009-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
+       * elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4
+       relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'.
+
        2008-12-11  Alan Modra  <amodra@bigpond.net.au>
        PR 7041
        * elf64-ppc.c (func_desc_adjust): Correct logic making fake function
index 540d3a67abfb4b3ce3db07cbf47cf2c227483861..22f0da0207a296c57eb37e6f39a6451fe5b4dcdf 100644 (file)
@@ -12231,6 +12231,28 @@ _bfd_elf_section_already_linked (bfd *abfd, asection *sec,
            }
        }
 
+  /* Do not complain on unresolved relocations in `.gnu.linkonce.r.F'
+     referencing its discarded `.gnu.linkonce.t.F' counterpart - g++-3.4
+     specific as g++-4.x is using COMDAT groups (without the `.gnu.linkonce'
+     prefix) instead.  `.gnu.linkonce.r.*' were the `.rodata' part of its
+     matching `.gnu.linkonce.t.*'.  If `.gnu.linkonce.r.F' is not discarded
+     but its `.gnu.linkonce.t.F' is discarded means we chose one-only
+     `.gnu.linkonce.t.F' section from a different bfd not requiring any
+     `.gnu.linkonce.r.F'.  Thus `.gnu.linkonce.r.F' should be discarded.
+     The reverse order cannot happen as there is never a bfd with only the
+     `.gnu.linkonce.r.F' section.  The order of sections in a bfd does not
+     matter as here were are looking only for cross-bfd sections.  */
+
+  if ((flags & SEC_GROUP) == 0 && CONST_STRNEQ (name, ".gnu.linkonce.r."))
+    for (l = already_linked_list->entry; l != NULL; l = l->next)
+      if ((l->sec->flags & SEC_GROUP) == 0
+         && CONST_STRNEQ (l->sec->name, ".gnu.linkonce.t."))
+       {
+         if (abfd != l->sec->owner)
+           sec->output_section = bfd_abs_section_ptr;
+         break;
+       }
+
   /* This is the first section with this name.  Record it.  */
   if (! bfd_section_already_linked_table_insert (already_linked_list, sec))
     info->callbacks->einfo (_("%F%P: already_linked_table: %E"));
index 3060d3f9ebfffa22d14a9089fb26c400b5d6fd0c..af588564ebc5bf56b7ead3dc7784a0dab11fdc55 100644 (file)
@@ -1,5 +1,9 @@
 2009-03-02  Alan Modra  <amodra@bigpond.net.au>
 
+       2009-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
+       * ld-elf/linkoncerdiff.d, ld-elf/linkoncerdiff1.s,
+       ld-elf/linkoncerdiff2.s: New.
+
        2008-10-10  Nathan Froyd  <froydnj@codesourcery.com>
        * ld-powerpc/attr-gnu-12-1.s: New file.
        * ld-powerpc/attr-gnu-12-2.s: New file.