fix Xtensa linker relaxation for weak symbols

Bob Wilson bwilson@tensilica.com
Wed Apr 21 18:21:00 GMT 2004


Building a recent version of glibc (well, more recent than what I had previously 
been using...) has exposed a problem with the Xtensa port of the linker.  The 
linker relaxation, enabled by default for Xtensa, was incorrectly replacing weak 
aliases during partial links.  This patch fixes it so that comparisons of 
relocations require matching the same symbol hash entry except during final, 
static links where a less strict comparison of values is OK.

Tested by running the ld testsuite and building glibc.  Committed on the 
mainline and branch.

2004-04-21  Bob Wilson  <bob.wilson@acm.org>

	* elf32-xtensa.c (is_same_value): Add final_static_link argument and
	require relocations against a weak symbol to reference the same
	symbol hash entry if not a final, static link.
	(get_cached_value, add_value_map): Add final_static_link argument.
	(remove_literals): Pass final_static_link argument as needed.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bfd-weak.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20040421/cf822b9a/attachment.ksh>


More information about the Binutils mailing list