Correct elf32-ppc dynamic relocs

Alan Modra amodra@bigpond.net.au
Mon Dec 16 19:50:00 GMT 2002


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



More information about the Binutils mailing list