[Xtensa] change relaxation of calls to weak symbols

Bob Wilson bwilson@tensilica.com
Thu Dec 13 19:10:00 GMT 2007


Bob Wilson wrote:
> I noticed yesterday that the Xtensa port of GAS has been relaxing all 
> calls to weak symbols, even when the --longcalls option is disabled.  
> This seems wrong to me.  The assembler doesn't know the final address of 
> a weak symbol, but that is no different than a call to a different 
> section.  This patch changes GAS to handle both of those cases (weak 
> symbol and different section) in the same way.  Tested with an 
> xtensa-elf build and committed.

The GAS testsuite for Xtensa is not worth much....  This change broke GCC's 
g++.dg/warn/weak1.C test.  It seems like the best solution is to distinguish 
weak references (which may resolve to zero) from weak definitions.  Fixed with 
the following patch, which I have committed.  In an effort to improve the 
testsuite, I also added a test for this.

2007-12-13  Bob Wilson  <bob.wilson@acm.org>

gas/
	* config/tc-xtensa.c (xg_symbolic_immeds_fit): Relax for weak
	references but not weak definitions.

gas/testsuite/
	* gas/xtensa/all.exp: Run new weak-call test.
	* gas/xtensa/weak-call.d: New.
	* gas/xtensa/weak-call.s: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas-weak-ref.patch
Type: text/x-diff
Size: 2667 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20071213/57d5665a/attachment.bin>


More information about the Binutils mailing list