bfd/
[deliverable/binutils-gdb.git] / bfd / elflink.c
index 09d06167fa55772941d59a21c3ff2c5daa8b54df..cd9131ef3805d301d0afc7c0e954fe502e26e3eb 100644 (file)
@@ -2935,8 +2935,11 @@ elf_smash_syms (struct elf_link_hash_entry *h, void *data)
   if (h->ref_regular)
     abort ();
 
-  /* Set sym back to newly created state, but keep undefs list pointer.  */
+  /* Set sym back to newly created state, but keep undef.next if it is
+     being used as a list pointer.  */
   bh = h->root.u.undef.next;
+  if (bh == &h->root)
+    bh = NULL;
   if (bh != NULL || inf->htab->root.undefs_tail == &h->root)
     inf->twiddled = TRUE;
   (*inf->htab->root.table.newfunc) (&h->root.root,
@@ -7045,6 +7048,8 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
                            (_("`%s' referenced in section `%A' of %B: "
                               "defined in discarded section `%A' of %B"),
                             o, input_bfd, sec, sec->owner, sym_name);
+                         bfd_set_error (bfd_error_bad_value);
+                         return FALSE;
                        }
 
                      /* Try to do the best we can to support buggy old
This page took 0.024934 seconds and 4 git commands to generate.