This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] PR ld/22832 on SPARC.
- From: Eric Botcazou <ebotcazou at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 15 Feb 2018 14:58:06 -0000
- Subject: [binutils-gdb] PR ld/22832 on SPARC.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e513bd38a6b91401947d90ba5f301f01d3991b8e
commit e513bd38a6b91401947d90ba5f301f01d3991b8e
Author: Eric Botcazou <ebotcazou@gcc.gnu.org>
Date: Thu Feb 15 15:55:11 2018 +0100
PR ld/22832 on SPARC.
The fix for PR ld/22727 on SPARC passed TRUE as the 'create' argument
in the call to bfd_link_hash_lookup. It turns out this was a bad idea
because, if the symbol is created at this point, the link will abort
later in elf_link_output_extsym. This changes the TRUE into a FALSE
and puts an assertion on the result of the call, making it easier to
debug the issue; that's exactly in keeping with what Gold does.
bfd/
* elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup
and assert that the result of the call is not NULL.
Diff:
---
bfd/ChangeLog | 7 +++++++
bfd/elfxx-sparc.c | 3 ++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 78cb5de..aa14169 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2018-02-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ld/22832
+ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
+ Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup
+ and assert that the result of the call is not NULL.
+
2018-02-14 Nick Clifton <nickc@redhat.com>
PR 22823
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 83ead75..10c5acd 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -1604,8 +1604,9 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* Essentially R_SPARC_WPLT30 relocs against __tls_get_addr. */
h = (struct elf_link_hash_entry *)
- bfd_link_hash_lookup (info->hash, "__tls_get_addr", TRUE,
+ bfd_link_hash_lookup (info->hash, "__tls_get_addr", FALSE,
FALSE, TRUE);
+ BFD_ASSERT (h != NULL);
/* Fall through */
case R_SPARC_WPLT30: