summary refs log tree commit diff
path: root/sysdeps/sparc/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-03-09 03:48:24 -0800
committerDavid S. Miller <davem@davemloft.net>2010-03-09 03:48:24 -0800
commitd6d1c4c87c3f2e60d9aab570aefc3e63d0467f33 (patch)
tree3586e3e115b8199e7d60ebd442b6a2e2e53c77a2 /sysdeps/sparc/sparc64
parent058e9ba9fd03b86246b8ed3c49392fa783a5c337 (diff)
downloadglibc-d6d1c4c87c3f2e60d9aab570aefc3e63d0467f33.tar.gz
glibc-d6d1c4c87c3f2e60d9aab570aefc3e63d0467f33.tar.xz
glibc-d6d1c4c87c3f2e60d9aab570aefc3e63d0467f33.zip
sparc64: Fix handling of R_SPARC_TLS_LE_* relocations.
Diffstat (limited to 'sysdeps/sparc/sparc64')
-rw-r--r--sysdeps/sparc/sparc64/dl-machine.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h
index fcfbb06ac2..82ab5a4547 100644
--- a/sysdeps/sparc/sparc64/dl-machine.h
+++ b/sysdeps/sparc/sparc64/dl-machine.h
@@ -513,11 +513,13 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
 	  value = sym->st_value - sym_map->l_tls_offset
 	    + reloc->r_addend;
 	  if (r_type == R_SPARC_TLS_LE_HIX22)
-	    *reloc_addr = (*reloc_addr & 0xffc00000)
-	      | (((~value) >> 10) & 0x3fffff);
+	    *(unsigned int *)reloc_addr =
+	      ((*(unsigned int *)reloc_addr & 0xffc00000)
+	       | (((~value) >> 10) & 0x3fffff));
 	  else
-	    *reloc_addr = (*reloc_addr & 0xffffe000) | (value & 0x3ff)
-	      | 0x1c00;
+	    *(unsigned int *)reloc_addr =
+	      ((*(unsigned int *)reloc_addr & 0xffffe000) | (value & 0x3ff)
+	       | 0x1c00);
 	}
       break;
 # endif