diff options
Diffstat (limited to 'ld/pe-dll.c')
-rw-r--r-- | ld/pe-dll.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 692f80f..c6c656a 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -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 |