2003-03-25 Jakub Jelinek <jakub@redhat.com>

* sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Restore
	special handling of relocations against local symbols.
This commit is contained in:
Roland McGrath 2003-03-28 00:31:50 +00:00
parent 572d7b385f
commit 213cdddbc6

View file

@ -361,6 +361,9 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *const refsym = sym;
Elf32_Addr value;
const int r_type = ELF32_R_TYPE (reloc->r_info);
#if defined USE_TLS && !defined RTLD_BOOTSTRAP
struct link_map *sym_map;
#endif
if (r_type == R_PPC_RELATIVE)
{
@ -371,8 +374,15 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
if (__builtin_expect (r_type == R_PPC_NONE, 0))
return;
/* binutils on ppc32 includes st_value in r_addend for relocations
against local symbols. */
if (__builtin_expect (ELF32_ST_BIND (sym->st_info) == STB_LOCAL, 0)
&& sym->st_shndx != SHN_UNDEF)
value = map->l_addr;
else
{
#if defined USE_TLS && !defined RTLD_BOOTSTRAP
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
sym_map = RESOLVE_MAP (&sym, version, r_type);
value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
#else
value = RESOLVE (&sym, version, r_type);
@ -381,6 +391,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
# endif
value += sym->st_value;
#endif
}
value += reloc->r_addend;
/* A small amount of code is duplicated here for speed. In libc,