aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-12-08 09:51:00 +1030
committerAlan Modra <amodra@gmail.com>2016-12-08 21:35:11 +1030
commit8e2a4f11d477986aa360a3b588d35a194efe58f8 (patch)
treee5854c78b44bad91d9c1b72b91c9e24fc3611a2a
parentc3187fa5cc72734e6fc766a85d657018c0516bad (diff)
downloadfsf-binutils-gdb-8e2a4f11d477986aa360a3b588d35a194efe58f8.zip
fsf-binutils-gdb-8e2a4f11d477986aa360a3b588d35a194efe58f8.tar.gz
fsf-binutils-gdb-8e2a4f11d477986aa360a3b588d35a194efe58f8.tar.bz2
PR20932, Internal error during record link assignment
PR ld/20932 * elflink.c (bfd_elf_record_link_assignment): Handle warning symbols.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7c21bb8..1c1dd90 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-08 Alan Modra <amodra@gmail.com>
+
+ PR ld/20932
+ * elflink.c (bfd_elf_record_link_assignment): Handle warning symbols.
+
2016-12-07 Nick Clifton <nickc@redhat.com>
PR ld/20932
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 49c3803..9b4482d 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -577,6 +577,9 @@ bfd_elf_record_link_assignment (bfd *output_bfd,
if (h == NULL)
return provide;
+ if (h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
if (h->versioned == unknown)
{
/* Set versioned if symbol version is unknown. */
@@ -624,11 +627,8 @@ bfd_elf_record_link_assignment (bfd *output_bfd,
hv->root.u.i.link = (struct bfd_link_hash_entry *) h;
(*bed->elf_backend_copy_indirect_symbol) (info, h, hv);
break;
- case bfd_link_hash_warning:
- /* See PR 20932 for a reproducer. */
- _bfd_error_handler (_("%B: Attempt to assign a value to warning symbol '%s'"),
- output_bfd, name);
- bfd_set_error (bfd_error_invalid_operation);
+ default:
+ BFD_FAIL ();
return FALSE;
}