2008-07-31 Takashi Ono <t_ono@hkfreak.net>
authorDanny Smith <dannysmith@users.sourceforge.net>
Thu, 31 Jul 2008 07:27:52 +0000 (07:27 +0000)
committerDanny Smith <dannysmith@users.sourceforge.net>
Thu, 31 Jul 2008 07:27:52 +0000 (07:27 +0000)
* pe-dll.c (generate_relocs): Don't generate relocs for
undefined weak symbols.

ld/ChangeLog
ld/pe-dll.c

index 6388638e043c3120e39417995d2a89c3ed36ef60..e6d84b34622d13486ee0ddcf4a9b982b217ef309 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-31  Takashi Ono  <t_ono@hkfreak.net>
+
+       * pe-dll.c (generate_relocs): Don't generate relocs for
+       undefined weak symbols.
+
 2008-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * emultempl/spuelf.em: Abort on the missing required `spu_ovl.o'.
index 692f80fdbe6734160f0e8caf35016f699d1101e4..c6c656a230d20d104cb0187df6e7ba3b7896c774 100644 (file)
@@ -1256,6 +1256,16 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info)
                  bfd_vma sym_vma;
                  struct bfd_symbol *sym = *relocs[i]->sym_ptr_ptr;
 
+                 /* Don't create relocs for undefined weak symbols.  */ 
+                 if (sym->flags == BSF_WEAK)
+                   {
+                     struct bfd_link_hash_entry *blhe
+                       = bfd_link_hash_lookup (info->hash, sym->name,
+                                               FALSE, FALSE, FALSE);
+                     if (!blhe || blhe->type != bfd_link_hash_defined)
+                       continue;                     
+                   }
+
                  sym_vma = (relocs[i]->addend
                             + sym->value
                             + sym->section->vma