about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc32
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-03-28 00:31:50 +0000
committerRoland McGrath <roland@gnu.org>2003-03-28 00:31:50 +0000
commit213cdddbc628deccb65f717080930f5c99eefdd2 (patch)
treea69bf0afa85f98aa93066c18538a13b57babadcb /sysdeps/powerpc/powerpc32
parent572d7b385f0229d2f7a9f5768fad6a545686eb9c (diff)
downloadglibc-213cdddbc628deccb65f717080930f5c99eefdd2.tar.gz
glibc-213cdddbc628deccb65f717080930f5c99eefdd2.tar.xz
glibc-213cdddbc628deccb65f717080930f5c99eefdd2.zip
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.
Diffstat (limited to 'sysdeps/powerpc/powerpc32')
-rw-r--r--sysdeps/powerpc/powerpc32/dl-machine.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h
index 4da239d0f4..6dfde02196 100644
--- a/sysdeps/powerpc/powerpc32/dl-machine.h
+++ b/sysdeps/powerpc/powerpc32/dl-machine.h
@@ -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,16 +374,24 @@ 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);
-  value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+      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);
+      value = RESOLVE (&sym, version, r_type);
 # ifndef RTLD_BOOTSTRAP
-  if (sym != NULL)
+      if (sym != NULL)
 # endif
-    value += sym->st_value;
+	value += sym->st_value;
 #endif
+    }
   value += reloc->r_addend;
 
   /* A small amount of code is duplicated here for speed.  In libc,