summaryrefslogtreecommitdiff
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
commit45dec86255e1f8d8fb5cb6cf344050c4ca702273 (patch)
tree404dcacdec8bfd41ee27569511923a39ff4e0df2
parentd016b91f7edf2d148213af17b8c942ec21ce4e99 (diff)
downloadbinutils-redhat-45dec86255e1f8d8fb5cb6cf344050c4ca702273.tar.gz
2013-02-19 Sandra Loosemore <sandra@codesourcery.com>
PR ld/15146 ld/ * plugin.c (plugin_notice): Add null check before dereferencing pointer.
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/plugin.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index bfd2efcb50..af8f7fde2d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-19 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR ld/15146
+ * plugin.c (plugin_notice): Add null check before dereferencing
+ pointer.
+
2013-02-19 Alan Modra <amodra@gmail.com>
* emultempl/elf32.em (emit_note_gnu_build_id): New static var.
diff --git a/ld/plugin.c b/ld/plugin.c
index d880164ded..23a4a78ee9 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;
}