2013-02-19 Sandra Loosemore <sandra@codesourcery.com>
authorSandra Loosemore <sandra@codesourcery.com>
Tue, 19 Feb 2013 03:59:08 +0000 (03:59 +0000)
committerSandra Loosemore <sandra@codesourcery.com>
Tue, 19 Feb 2013 03:59:08 +0000 (03:59 +0000)
PR ld/15146

ld/
* plugin.c (plugin_notice): Add null check before dereferencing
pointer.

ld/ChangeLog
ld/plugin.c

index bfd2efcb508297a55a0faff281e002c588118750..af8f7fde2dc9d927ce1a22b39a7bc5ba07e14839 100644 (file)
@@ -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.
index d880164ded9511d56c038f04f82f54ffbef1ac52..23a4a78ee9919474525d1657958e7a84f38a9abc 100644 (file)
@@ -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;
        }