[Xtensa] a few small repairs in bfd

Bob Wilson bwilson@tensilica.com
Mon Feb 4 23:28:00 GMT 2008


I've committed this patch to fix a few small issues for Xtensa:

1) When the linker finds an invalid relocation against a dynamic symbol, it 
should not continue trying to process that relocation.  The symptom of this is 
getting multiple error messages for the same problem, so it's not critical but 
still good to fix.

2) All code for Xtensa on GNU/Linux is supposed to be PIC, but it is possible 
for someone to compile non-PIC code with a toolchain configured for xtensa-elf. 
  If the non-PIC code uses the "longcalls" option, it should be able to 
basically work, as long as the linker ignores R_XTENSA_ASM_EXPAND relocations 
against dynamic symbols.

3) The ld-elf/weak-dyn-1 test was failing because it uses a special linker 
script to generate a shared object, and that script did not include the special 
Xtensa .xt.lit section.  The patch avoids a seg fault in this case, even though 
the output is unlikely to be useful for much of anything.

I tested this patch by manually linking a few combinations of PIC and non-PIC 
code, as well as running the binutils testsuites for both xtensa-elf and 
xtensa-linux-uclibc targets.

2008-02-04  Bob Wilson  <bob.wilson@acm.org>
	
	* elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid
	relocation, do not continue processing it.  Ignore R_XTENSA_ASM_EXPAND
	relocations against dynamic symbols.
	(elf_xtensa_finish_dynamic_sections): Do not fail if there is no
	.xt.lit section.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd-nonpic-errs.patch
Type: text/x-diff
Size: 2082 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20080204/f303a8a3/attachment.bin>


More information about the Binutils mailing list