* elf32-ppc.c (struct ppc_dyn_relocs): New.
[binutils-gdb.git] / ld / plugin.c
index 435f4663b2bd042f32ea4f445673594d83e6bd96..23a4a78ee9919474525d1657958e7a84f38a9abc 100644 (file)
@@ -993,7 +993,15 @@ plugin_notice (struct bfd_link_info *info,
 
       /* If this is a ref, set non_ir_ref.  */
       else if (bfd_is_und_section (section))
-       h->non_ir_ref = TRUE;
+       {
+         /* 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 == NULL
+                 || (h->u.undef.abfd->flags & BFD_PLUGIN) != 0))
+           h->u.undef.abfd = abfd;
+         h->non_ir_ref = TRUE;
+       }
 
       /* Otherwise, it must be a new def.  Ensure any symbol defined
         in an IR dummy BFD takes on a new value from a real BFD.