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: R_SPARC_RELATIVE vs R_SPARC_UA32 & unaligned unwind tables - again


On Wed, Dec 19, 2001 at 02:52:11PM +1030, Alan Modra wrote:
> #if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
>       const Elf32_Sym *const refsym = sym;
> #endif
>       Elf32_Addr value;
> #ifndef RESOLVE_CONFLICT_FIND_MAP
>       if (sym->st_shndx != SHN_UNDEF &&
> 	  ELF32_ST_BIND (sym->st_info) == STB_LOCAL)
> 	value = map->l_addr;

I don't know exactly what is this for, but in powerpc/dl-machine.h above
similar code is:

  /* 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 this is what Solaris used to do in their ld.so (which wouldn't surprise
me, theer have been other ld.so bugs found in the past), then IMHO the best things
to fix this up are:
1) check all shared libraries on say 2 different sparc linux distros to
   search for section relative dynamic relocs
2) if none are found, kill the above code from glibc
3) change binutils, so that it never creates section relative dynamic relocs
   for shared libs (because ld.so cannot be trusted). It could change the
   dynamic reloc to ELF32_R_INFO (0, non-R_SPARC_RELATIVE) and adjust addend
   accordingly.

	Jakub


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