This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR20932, Internal error during record link assignment

On looking at this testcase in detail, I've come to the conclusion
that bfd_elf_record_link_assignment should handle warning symbols.
Warning symbols aren't all that special;  They just cause the linker
to issue a message when referenced.  Since we allow linker scripts to
override other defined symbols, allow the same for the "real" symbol
pointed to by a bfd_link_hash_warning symbol.

	PR ld/20932
	* elflink.c (bfd_elf_record_link_assignment): Handle warning symbols.

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->;
   if (h->versioned == unknown)
       /* Set versioned if symbol version is unknown.  */
@@ -624,11 +627,8 @@ bfd_elf_record_link_assignment (bfd *output_bfd,
       hv-> = (struct bfd_link_hash_entry *) h;
       (*bed->elf_backend_copy_indirect_symbol) (info, h, hv);
-    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;

Alan Modra
Australia Development Lab, IBM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]