X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felflink.c;h=cd9131ef3805d301d0afc7c0e954fe502e26e3eb;hb=6d633fd2827c7c46c05c45b75781ca8ab6a9afce;hp=09d06167fa55772941d59a21c3ff2c5daa8b54df;hpb=e75a280b02f870156957a6fa46cd7888714698ef;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elflink.c b/bfd/elflink.c index 09d06167fa..cd9131ef38 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -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