From: Eric Botcazou Date: Thu, 15 Feb 2018 14:55:11 +0000 (+0100) Subject: PR ld/22832 on SPARC. X-Git-Tag: users/ARM/embedded-binutils-2_30-branch-2018q2~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d31b3bc9174ca62d7527a63e6428718311faff9c;p=thirdparty%2Fbinutils-gdb.git 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) : 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 --git a/bfd/ChangeLog b/bfd/ChangeLog index bc4b38817fc..ecd27e515f3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2018-02-15 Eric Botcazou + + PR ld/22832 + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) : + 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-09 Eric Botcazou * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Reorder conditions. diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index eff17a6801e..bf4d4dc25c8 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -1630,8 +1630,9 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, /* These are basically R_SPARC_TLS_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); } else break;