summaryrefslogtreecommitdiffstats
path: root/cpukit/libdl/rtl-mdreloc-sparc.c
diff options
context:
space:
mode:
authorJiri Gaisler <jiri@gaisler.se>2016-11-14 08:21:03 -0600
committerJoel Sherrill <joel@rtems.org>2016-11-14 08:21:12 -0600
commit316da9356ad7b612f6df6ed1e47b62268450438e (patch)
tree2a0026e7c9c818d4d895ebaf941d034859518309 /cpukit/libdl/rtl-mdreloc-sparc.c
parentpowerpc: Add _CPU_Get_current_per_CPU_control() (diff)
downloadrtems-316da9356ad7b612f6df6ed1e47b62268450438e.tar.bz2
rtl-mdreloc-sparc.c: Do not print unaligned pointer and cause unaligned access.
updates #2802.
Diffstat (limited to 'cpukit/libdl/rtl-mdreloc-sparc.c')
-rw-r--r--cpukit/libdl/rtl-mdreloc-sparc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/libdl/rtl-mdreloc-sparc.c b/cpukit/libdl/rtl-mdreloc-sparc.c
index a8bf5e15ae..509b62fb4a 100644
--- a/cpukit/libdl/rtl-mdreloc-sparc.c
+++ b/cpukit/libdl/rtl-mdreloc-sparc.c
@@ -144,6 +144,7 @@ rtems_rtl_elf_relocate_rela (const rtems_rtl_obj_t* obj,
{
Elf_Addr *where;
Elf_Word type, value, mask;
+ Elf_Addr tmp = 0;
where = (Elf_Addr *) (sect->base + rela->r_offset);
@@ -220,7 +221,6 @@ rtems_rtl_elf_relocate_rela (const rtems_rtl_obj_t* obj,
if (RELOC_UNALIGNED(type)) {
/* Handle unaligned relocations. */
- Elf_Addr tmp = 0;
char *ptr = (char *)where;
int i, size = RELOC_TARGET_SIZE (type) / 8;
@@ -238,11 +238,12 @@ rtems_rtl_elf_relocate_rela (const rtems_rtl_obj_t* obj,
} else {
*where &= ~mask;
*where |= value;
+ tmp = *where;
}
if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
printf ("rtl: %s %p @ %p in %s\n",
- reloc_names[type], (void *)*where, where, rtems_rtl_obj_oname (obj));
+ reloc_names[type], (void *)tmp, where, rtems_rtl_obj_oname (obj));
return true;