From 87d254a7bf02b60e6cd0699ddca6105b3ea232c9 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 31 Jul 2003 06:33:53 +0000 Subject: * elf/dynamic-link.h (elf_machine_rel, elf_machine_rela, elf_machine_rel_relative, elf_machine_rela_relative): Don't assume reloc_addr is aligned. * sysdeps/alpha/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/arm/dl-machine.h (elf_machine_rel, elf_machine_rela, elf_machine_rel_relative, elf_machine_rela_relative): Adjust. * sysdeps/cris/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/hppa/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/i386/dl-machine.h (elf_machine_rel, elf_machine_rela, elf_machine_rel_relative, elf_machine_rela_relative): Adjust. * sysdeps/ia64/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/m68k/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/mips/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela_relative, elf_machine_rela): Adjust. * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): * sysdeps/sh/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/x86_64/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. 2003-07-31 Alexandre Oliva * elf/dynamic-link.h (elf_machine_rel, elf_machine_rela, elf_machine_rel_relative, elf_machine_rela_relative): Don't assume reloc_addr is aligned. * sysdeps/alpha/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/arm/dl-machine.h (elf_machine_rel, elf_machine_rela, elf_machine_rel_relative, elf_machine_rela_relative): Adjust. * sysdeps/cris/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/hppa/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/i386/dl-machine.h (elf_machine_rel, elf_machine_rela, elf_machine_rel_relative, elf_machine_rela_relative): Adjust. * sysdeps/ia64/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/m68k/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/mips/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela_relative, elf_machine_rela): Adjust. * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): * sysdeps/sh/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. * sysdeps/x86_64/dl-machine.h (elf_machine_rela, elf_machine_rela_relative): Adjust. --- sysdeps/powerpc/powerpc32/dl-machine.h | 6 ++++-- sysdeps/powerpc/powerpc64/dl-machine.h | 37 ++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 19 deletions(-) (limited to 'sysdeps/powerpc') diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h index 0260ac88f8..a8c1e3e490 100644 --- a/sysdeps/powerpc/powerpc32/dl-machine.h +++ b/sysdeps/powerpc/powerpc32/dl-machine.h @@ -356,8 +356,9 @@ extern void _dl_reloc_overflow (struct link_map *map, inline void elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, - Elf32_Addr *const reloc_addr) + void *const reloc_addr_arg) { + Elf32_Addr *const reloc_addr = reloc_addr_arg; const Elf32_Sym *const refsym = sym; Elf32_Addr value; const int r_type = ELF32_R_TYPE (reloc->r_info); @@ -456,8 +457,9 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, static inline void elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, - Elf32_Addr *const reloc_addr) + void *const reloc_addr_arg) { + Elf32_Addr *const reloc_addr = reloc_addr_arg; *reloc_addr = l_addr + reloc->r_addend; } diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h index 7f0353f687..843737eb86 100644 --- a/sysdeps/powerpc/powerpc64/dl-machine.h +++ b/sysdeps/powerpc/powerpc64/dl-machine.h @@ -565,8 +565,9 @@ extern void _dl_reloc_overflow (struct link_map *map, static inline void elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, - Elf64_Addr *const reloc_addr) + void *const reloc_addr_arg) { + Elf64_Addr *const reloc_addr = reloc_addr_arg; *reloc_addr = l_addr + reloc->r_addend; } @@ -598,8 +599,9 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, const Elf64_Sym *sym, const struct r_found_version *version, - Elf64_Addr *const reloc_addr) + void *const reloc_addr_arg) { + Elf64_Addr *const reloc_addr = reloc_addr_arg; const int r_type = ELF64_R_TYPE (reloc->r_info); #ifndef RTLD_BOOTSTRAP const Elf64_Sym *const refsym = sym; @@ -766,27 +768,28 @@ elf_machine_rela (struct link_map *map, _dl_argv[0] ?: "", strtab + refsym->st_name); } - memcpy (reloc_addr, (char *) value, MIN (sym->st_size, refsym->st_size)); + memcpy (reloc_addr_arg, (char *) value, + MIN (sym->st_size, refsym->st_size)); return; case R_PPC64_UADDR64: /* We are big-endian. */ - ((char *) reloc_addr)[0] = (value >> 56) & 0xff; - ((char *) reloc_addr)[1] = (value >> 48) & 0xff; - ((char *) reloc_addr)[2] = (value >> 40) & 0xff; - ((char *) reloc_addr)[3] = (value >> 32) & 0xff; - ((char *) reloc_addr)[4] = (value >> 24) & 0xff; - ((char *) reloc_addr)[5] = (value >> 16) & 0xff; - ((char *) reloc_addr)[6] = (value >> 8) & 0xff; - ((char *) reloc_addr)[7] = (value >> 0) & 0xff; + ((char *) reloc_addr_arg)[0] = (value >> 56) & 0xff; + ((char *) reloc_addr_arg)[1] = (value >> 48) & 0xff; + ((char *) reloc_addr_arg)[2] = (value >> 40) & 0xff; + ((char *) reloc_addr_arg)[3] = (value >> 32) & 0xff; + ((char *) reloc_addr_arg)[4] = (value >> 24) & 0xff; + ((char *) reloc_addr_arg)[5] = (value >> 16) & 0xff; + ((char *) reloc_addr_arg)[6] = (value >> 8) & 0xff; + ((char *) reloc_addr_arg)[7] = (value >> 0) & 0xff; return; case R_PPC64_UADDR32: /* We are big-endian. */ - ((char *) reloc_addr)[0] = (value >> 24) & 0xff; - ((char *) reloc_addr)[1] = (value >> 16) & 0xff; - ((char *) reloc_addr)[2] = (value >> 8) & 0xff; - ((char *) reloc_addr)[3] = (value >> 0) & 0xff; + ((char *) reloc_addr_arg)[0] = (value >> 24) & 0xff; + ((char *) reloc_addr_arg)[1] = (value >> 16) & 0xff; + ((char *) reloc_addr_arg)[2] = (value >> 8) & 0xff; + ((char *) reloc_addr_arg)[3] = (value >> 0) & 0xff; return; case R_PPC64_ADDR32: @@ -811,8 +814,8 @@ elf_machine_rela (struct link_map *map, if (dont_expect ((value + 0x8000) >= 0x10000)) _dl_reloc_overflow (map, "R_PPC64_UADDR16", reloc_addr, refsym); /* We are big-endian. */ - ((char *) reloc_addr)[0] = (value >> 8) & 0xff; - ((char *) reloc_addr)[1] = (value >> 0) & 0xff; + ((char *) reloc_addr_arg)[0] = (value >> 8) & 0xff; + ((char *) reloc_addr_arg)[1] = (value >> 0) & 0xff; break; case R_PPC64_ADDR16_DS: -- cgit 1.4.1