[SPARC] PR ld/22832

Eric Botcazou ebotcazou@adacore.com
Thu Feb 15 15:04:00 GMT 2018

In my fix for PR ld/22727 on SPARC, I 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 miserably abort later in 
elf_link_output_extsym.  So the attached patch 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.

Tested on SPARC64/Linux, applied on mainline and 2.30 branch as obvious.

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.

Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr22832.diff
Type: text/x-patch
Size: 570 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20180215/ac500270/attachment.bin>

More information about the Binutils mailing list