elf32 sparc rela incorrect section and addend

Alan Modra amodra@bigpond.net.au
Tue Feb 17 21:14:00 GMT 2009
On Tue, Feb 17, 2009 at 07:24:32PM +0000, Neil Mayes wrote:
> I have a local global variable which is located in .data @ 0x020005AC
> whereas the rela (R_SPARC_LO10) tells me its within the .text section.
> Symbol value == 0x02000000 (.text vitual address) with an addend ==
> 0x020005AC, which is actually the absolute address.

See this comment in elfxx-sparce.c:

			  /* We are turning this relocation into one
			     against a section symbol.  It would be
			     proper to subtract the symbol's value,
			     osec->vma, from the emitted reloc addend,
			     but ld.so expects buggy relocs.  */

Since you are writing a new dynamic loader for rtems you have the
opportunity to fix this for rtems.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list