This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Correct elf32-ppc dynamic relocs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]