PR20932, Internal error during record link assignment
authorAlan Modra <amodra@gmail.com>
Wed, 7 Dec 2016 23:21:00 +0000 (09:51 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 8 Dec 2016 11:05:11 +0000 (21:35 +1030)
PR ld/20932
* elflink.c (bfd_elf_record_link_assignment): Handle warning symbols.

bfd/ChangeLog
bfd/elflink.c

index 7c21bb893b4d07ad3ef2b2fa8e7828e75b9fccda..1c1dd90e75ed70aaf95ad34be85a07ffa60ec2a1 100644 (file)
@@ -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
index 49c38032fe5c4645bf6aa7b7e5ef41be876aa520..9b4482d952ded49320c85423d7df0f52a667ba03 100644 (file)
@@ -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;
     }