about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-04-07 09:29:14 -0700
committerDavid S. Miller <davem@davemloft.net>2012-04-07 09:29:14 -0700
commit5ed848f3d8b5b3be92fe3006fd18a089ef982316 (patch)
treee75fbc94608615a1e3477f439bf36a6f2e114672 /sysdeps
parent96154cd892c614f13f32996ce75df1442641fb5b (diff)
downloadglibc-5ed848f3d8b5b3be92fe3006fd18a089ef982316.tar.gz
glibc-5ed848f3d8b5b3be92fe3006fd18a089ef982316.tar.xz
glibc-5ed848f3d8b5b3be92fe3006fd18a089ef982316.zip
Handle some new sparc relocation types.
	* elf/elf.h (R_SPARC_WDISP10): Define.
	* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Handle
	R_SPARC_SIZE32.
	* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Handle
	R_SPARC_SIZE64 and R_SPARC_H34.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/sparc/sparc32/dl-machine.h6
-rw-r--r--sysdeps/sparc/sparc64/dl-machine.h12
2 files changed, 18 insertions, 0 deletions
diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
index 31b540ac37..2dfeeb27a3 100644
--- a/sysdeps/sparc/sparc32/dl-machine.h
+++ b/sysdeps/sparc/sparc32/dl-machine.h
@@ -359,6 +359,12 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
   if (__builtin_expect (r_type == R_SPARC_NONE, 0))
     return;
 
+  if (__builtin_expect (r_type == R_SPARC_SIZE32, 0))
+    {
+      *reloc_addr = sym->st_size + reloc->r_addend;
+      return;
+    }
+
 #if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
   if (__builtin_expect (r_type == R_SPARC_RELATIVE, 0))
     {
diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h
index 4b14593c9b..35c24d1558 100644
--- a/sysdeps/sparc/sparc64/dl-machine.h
+++ b/sysdeps/sparc/sparc64/dl-machine.h
@@ -385,6 +385,12 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
   if (__builtin_expect (r_type == R_SPARC_NONE, 0))
     return;
 
+  if (__builtin_expect (r_type == R_SPARC_SIZE64, 0))
+    {
+      *reloc_addr = sym->st_size + reloc->r_addend;
+      return;
+    }
+
 #if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
   if (__builtin_expect (r_type == R_SPARC_RELATIVE, 0))
     {
@@ -552,6 +558,12 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 	 (((value & 0x3ff) + ELF64_R_TYPE_DATA (reloc->r_info)) & 0x1fff));
       break;
 
+      /* ABS34 code model reloc */
+    case R_SPARC_H34:
+      *(unsigned int *) reloc_addr =
+	((*(unsigned int *)reloc_addr & 0xffc00000) |
+	 ((value >> 12) & 0x3fffff));
+
       /* MEDMID code model relocs */
     case R_SPARC_H44:
       *(unsigned int *) reloc_addr =