aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/alpha
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-29 06:52:39 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-29 06:52:39 +0000
commit7c81011531448a126a640b45547abab2b1195465 (patch)
treec4418e4601be981ee71648b677ac9a0c04514ec0 /sysdeps/alpha
parent52d895a4ce96bba606fdc11619ae213a29fff4be (diff)
downloadglibc-7c81011531448a126a640b45547abab2b1195465.zip
glibc-7c81011531448a126a640b45547abab2b1195465.tar.gz
glibc-7c81011531448a126a640b45547abab2b1195465.tar.bz2
Update.
2000-09-28 Ulrich Drepper <drepper@redhat.com> * sysdeps/alpha/dl-machine.h (elf_machine_rela): Handle unaligned relocation also for R_ALPHA_RELATIVE. Reported by Ivan Kokshaysky <ink@jurassic.park.msu.ru>.
Diffstat (limited to 'sysdeps/alpha')
-rw-r--r--sysdeps/alpha/dl-machine.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h
index 33c32fa..69845b4 100644
--- a/sysdeps/alpha/dl-machine.h
+++ b/sysdeps/alpha/dl-machine.h
@@ -482,7 +482,19 @@ elf_machine_rela (struct link_map *map,
/* Already done in dynamic linker. */
if (map != &_dl_rtld_map)
#endif
- *reloc_addr += map->l_addr;
+ {
+ /* XXX Make some timings. Maybe it's preverable to test for
+ unaligned access and only do it the complex way if necessary. */
+ void *reloc_addr_1 = reloc_addr;
+ Elf64_Addr reloc_addr_val;
+
+ /* Load value without causing unaligned trap. */
+ memcpy (&reloc_addr_val, reloc_addr_1, 8);
+ reloc_addr_val += map->l_addr;
+
+ /* Store value without causing unaligned trap. */
+ memcpy (reloc_addr_1, &reloc_addr_val, 8);
+ }
}
else if (r_type == R_ALPHA_NONE)
return;