optimize Xtensa relaxation

Bob Wilson bwilson@tensilica.com
Fri Oct 5 20:46:00 GMT 2007


OK, having gotten some smaller cleanups committed, I'm moving on to something of 
more substance (though still not the problem I set out to solve)....

This patch reduces the Xtensa port's use of "fix" record to handle linker 
relaxations that result in cross-object references.  We were just being lazy and 
using the fix records all the time, regardless of whether the reference was to 
another object or even whether it had changed at all.

I tested this with the ld testsuite and also by building and running a few 
larger programs.  Committed on trunk.

2007-10-05  Bob Wilson  <bob.wilson@acm.org>
	
	* elf32-xtensa.c (relax_section): Call pin_internal_relocs when
	changing a relocation's offset.  Adjust call to translate_reloc.  Do
	not add a fix record for a DIFF reloc.  For other relocs, only add a
	fix record if the translated target is in a different object file;
	otherwise, just update the relocation.  Call pin_internal_relocs when
	updating a reloc but not when adding a fix record.
	(translate_reloc): Get the target section from a new argument, not
	from the relocation.  Change check for relaxable sections to an
	assertion.  Compute separate offset adjustments for the base symbol
	and the addend, and set the new relocation's addend correctly.  Return
	the new target section.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd-avoid-fixes.patch
Type: text/x-diff
Size: 6116 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20071005/c8aaf42d/attachment.bin>


More information about the Binutils mailing list