This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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 Tue, Dec 18, 2001 at 10:36:02PM -0500, DJ Delorie wrote:
> 
> > Making a wild guess at the problem, and solution...
> 
> Well, it made a change, but not nearly enough.  Before, the value is
> something like 0x790000.  After, it's like 0x730000.  It needs to be
> like 0xef790000 (the so is loaded at 0xef730000).

glibc's sparc32/dl-machine.h looks wrong to me.

An extract:

#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
  if (__builtin_expect (r_type == R_SPARC_RELATIVE, 0))
    {
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
      if (map != &_dl_rtld_map) /* Already done in rtld itself. */
# endif
	*reloc_addr += map->l_addr + reloc->r_addend;
    }
  else
#endif
    {
#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;
      else
	{
	  value = RESOLVE (&sym, version, r_type);
	  if (sym)
	    value += sym->st_value;
	}
#else
      value = 0;
#endif
      value += reloc->r_addend;	/* Assume copy relocs have zero addend.  */

Seems like local sym values are ignored, at least inside the #ifndef
RESOLVE_CONFLICT_FIND MAP (whatever that is), and of course section
syms are local.


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