This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Correct elf32-ppc dynamic relocs
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com, Rusty Russell <rusty at rustcorp dot com dot au>
- Date: Tue, 17 Dec 2002 13:24:13 +1030
- Subject: Re: Correct elf32-ppc dynamic relocs
- References: <20021216234954.GD944@bubble.sa.bigpond.net.au>
On Tue, Dec 17, 2002 at 10:19:54AM +1030, Alan Modra wrote:
> I'll commit this after some testing.
> * elf32-ppc.c (ppc_elf_relocate_section): When emitting dynamic
> relocs against a section symbol, subtract the output section symbol
> value.
Not installing. While the patch is fairly obviously correct,
glibc's ld.so expects relocs against local syms to be buggy. :-(
Extract from dl-machine.h:
/* The condition on the next two lines is a hack around a bug in Solaris
tools on Sparc. It's not clear whether it should really be here at all,
but if not the binutils need to be changed. */
if (rinfo == R_PPC_RELATIVE
|| (sym->st_shndx != SHN_UNDEF
&& ELF32_ST_BIND (sym->st_info) == STB_LOCAL))
{
/* Has already been relocated. */
Elf32_Word loadbase = map->l_addr;
finaladdr = loadbase + reloc->r_addend;
}
--
Alan Modra
IBM OzLabs - Linux Technology Centre