From 7c81011531448a126a640b45547abab2b1195465 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 29 Sep 2000 06:52:39 +0000 Subject: [PATCH] Update. 2000-09-28 Ulrich Drepper * sysdeps/alpha/dl-machine.h (elf_machine_rela): Handle unaligned relocation also for R_ALPHA_RELATIVE. Reported by Ivan Kokshaysky . --- ChangeLog | 6 ++++++ sysdeps/alpha/dl-machine.h | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b341887..77f9f6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-09-28 Ulrich Drepper + + * sysdeps/alpha/dl-machine.h (elf_machine_rela): Handle unaligned + relocation also for R_ALPHA_RELATIVE. + Reported by Ivan Kokshaysky . + 2000-09-18 Bruno Haible * intl/dcigettext.c: Outside libc, use local variable names that don't 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; -- 2.7.4