aboutsummaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2013-02-19 03:59:08 +0000
committerSandra Loosemore <sandra@codesourcery.com>2013-02-19 03:59:08 +0000
commit46fed7f7c29ff8718cd97703188a15d8ee897be1 (patch)
treeb03e0dd97490611f1f80f25e99fb3d35e4464b00 /ld/plugin.c
parent897aea504d5f5ba75b021e0a817d4ea9337a378d (diff)
downloadgdb-46fed7f7c29ff8718cd97703188a15d8ee897be1.zip
gdb-46fed7f7c29ff8718cd97703188a15d8ee897be1.tar.gz
gdb-46fed7f7c29ff8718cd97703188a15d8ee897be1.tar.bz2
2013-02-19 Sandra Loosemore <sandra@codesourcery.com>
PR ld/15146 ld/ * plugin.c (plugin_notice): Add null check before dereferencing pointer.
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index d880164..23a4a78 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -997,7 +997,8 @@ plugin_notice (struct bfd_link_info *info,
/* Replace the undefined dummy bfd with the real one. */
if ((h->type == bfd_link_hash_undefined
|| h->type == bfd_link_hash_undefweak)
- && (h->u.undef.abfd->flags & BFD_PLUGIN) != 0)
+ && (h->u.undef.abfd == NULL
+ || (h->u.undef.abfd->flags & BFD_PLUGIN) != 0))
h->u.undef.abfd = abfd;
h->non_ir_ref = TRUE;
}