fix Xtensa regression in bfd

Bob Wilson bwilson@tensilica.com
Wed Apr 28 02:57:00 GMT 2004


One of my recent changes 
(http://sources.redhat.com/ml/binutils/2004-03/msg00511.html) causes problems 
with the linker.  The symptoms didn't show up until I tried building a different 
version of glibc.  The issue is that the xtensa_read_table_entries function was 
formerly called during the ELF check_relocs hook, but I changed it to be called 
during the relocate_section hook.  I failed to account for the fact that when 
called from relocate_section, the table section may have been relaxed and/or 
relocated (depending on the order in which sections are relocated).  This patch 
fixes the problems I found building glibc.  It uses the section reloc_done flag 
to mark whether a table section has been relocated yet.  (This flag doesn't seem 
to be set in most of the places where I would expect it to be set; I hope I'm 
not misusing it.)

I tested this by running the testsuite for an xtensa-elf target and by building 
glibc 2.3.2 with an xtensa-linux-gnu target.  Committed on the mainline and 2.15 
branch.


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

	* elf32-xtensa.c (xtensa_read_table_entries): Use section _cooked_size
	if set.  Check reloc_done flag before applying relocations.  Use
	output addresses, both when applying relocations and when comparing
	against the specified section.
	(elf_xtensa_relocate_section): Use output address to check if dynamic
	reloc is in a literal pool.  Set section's reloc_done flag.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bfd_reloc_done.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20040428/4f68525a/attachment.ksh>


More information about the Binutils mailing list