This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix internal error in the linker by replacing a call to abort with an error message.
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 7 Dec 2016 10:20:19 -0000
- Subject: [binutils-gdb] Fix internal error in the linker by replacing a call to abort with an error message.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c2596ca5d7f6ab6d38882bf0f0fc44fe352afcb1
commit c2596ca5d7f6ab6d38882bf0f0fc44fe352afcb1
Author: Nick Clifton <nickc@redhat.com>
Date: Wed Dec 7 10:19:42 2016 +0000
Fix internal error in the linker by replacing a call to abort with an error message.
PR ld/20932
* elflink.c (bfd_elf_record_link_assignment): Replace call to
abort with an error message and error return value.
Diff:
---
bfd/ChangeLog | 6 ++++++
bfd/elflink.c | 7 +++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 26fb42b..7c21bb8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2016-12-07 Nick Clifton <nickc@redhat.com>
+
+ PR ld/20932
+ * elflink.c (bfd_elf_record_link_assignment): Replace call to
+ abort with an error message and error return value.
+
2016-12-06 Nick Clifton <nickc@redhat.com>
PR binutils/20931
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 320f3be..49c3803 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -625,8 +625,11 @@ bfd_elf_record_link_assignment (bfd *output_bfd,
(*bed->elf_backend_copy_indirect_symbol) (info, h, hv);
break;
case bfd_link_hash_warning:
- abort ();
- break;
+ /* 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);
+ return FALSE;
}
/* If this symbol is being provided by the linker script, and it is