summaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-05-16 00:58:11 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-05-16 00:58:11 +0000
commit8b25c274b06a5d594d7952e73740f5f20b83e507 (patch)
treebe2cc4a40589a3c8385631943b4861a86fdedaf2 /ld/plugin.c
parentd0e3992ba30bc8f1e756895fc8cd37a105fff63b (diff)
downloadbinutils-redhat-8b25c274b06a5d594d7952e73740f5f20b83e507.tar.gz
PR ld/12760
* plugin.c (plugin_notice): Set u.undef.abfd for symbols made undefweak.
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index 8d9603bb9d..07c60686e5 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -912,6 +912,8 @@ plugin_notice (struct bfd_link_info *info,
{
if (h != NULL)
{
+ bfd *sym_bfd;
+
/* No further processing if this def/ref is from an IR dummy BFD. */
if (is_ir_dummy_bfd (abfd))
return TRUE;
@@ -928,10 +930,13 @@ plugin_notice (struct bfd_link_info *info,
to be undefined. */
else if (((h->type == bfd_link_hash_defweak
|| h->type == bfd_link_hash_defined)
- && is_ir_dummy_bfd (h->u.def.section->owner))
+ && is_ir_dummy_bfd (sym_bfd = h->u.def.section->owner))
|| (h->type == bfd_link_hash_common
- && is_ir_dummy_bfd (h->u.c.p->section->owner)))
- h->type = bfd_link_hash_undefweak;
+ && is_ir_dummy_bfd (sym_bfd = h->u.c.p->section->owner)))
+ {
+ h->type = bfd_link_hash_undefweak;
+ h->u.undef.abfd = sym_bfd;
+ }
}
/* Continue with cref/nocrossref/trace-sym processing. */