diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2003-07-31 06:33:53 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2003-07-31 06:33:53 +0000 |
commit | 87d254a7bf02b60e6cd0699ddca6105b3ea232c9 (patch) | |
tree | 8a8121db8c86680e1a9d34acdc844f73f8962bcf /sysdeps/sparc | |
parent | e4a6507c4c50580521b80970bfae00df472a549c (diff) | |
download | glibc-87d254a7bf02b60e6cd0699ddca6105b3ea232c9.tar.gz |
* 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 <aoliva@redhat.com>
* 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.
Diffstat (limited to 'sysdeps/sparc')
-rw-r--r-- | sysdeps/sparc/sparc32/dl-machine.h | 22 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/dl-machine.h | 47 |
2 files changed, 37 insertions, 32 deletions
diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h index 8c821b9cc2..45bb0bf152 100644 --- a/sysdeps/sparc/sparc32/dl-machine.h +++ b/sysdeps/sparc/sparc32/dl-machine.h @@ -435,8 +435,9 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, static 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 unsigned int r_type = ELF32_R_TYPE (reloc->r_info); #if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC @@ -510,8 +511,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, rtld_progname ?: "<program name unknown>", strtab + refsym->st_name); } - memcpy (reloc_addr, (void *) value, MIN (sym->st_size, - refsym->st_size)); + memcpy (reloc_addr_arg, (void *) value, + MIN (sym->st_size, refsym->st_size)); break; #endif case R_SPARC_GLOB_DAT: @@ -587,14 +588,14 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, *reloc_addr = (*reloc_addr & 0xffc00000) | (value >> 10); break; case R_SPARC_UA16: - ((unsigned char *) reloc_addr) [0] = value >> 8; - ((unsigned char *) reloc_addr) [1] = value; + ((unsigned char *) reloc_addr_arg) [0] = value >> 8; + ((unsigned char *) reloc_addr_arg) [1] = value; break; case R_SPARC_UA32: - ((unsigned char *) reloc_addr) [0] = value >> 24; - ((unsigned char *) reloc_addr) [1] = value >> 16; - ((unsigned char *) reloc_addr) [2] = value >> 8; - ((unsigned char *) reloc_addr) [3] = value; + ((unsigned char *) reloc_addr_arg) [0] = value >> 24; + ((unsigned char *) reloc_addr_arg) [1] = value >> 16; + ((unsigned char *) reloc_addr_arg) [2] = value >> 8; + ((unsigned char *) reloc_addr_arg) [3] = value; break; #endif case R_SPARC_NONE: /* Alright, Wilbur. */ @@ -610,8 +611,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/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h index 802364b662..5d87b4cb67 100644 --- a/sysdeps/sparc/sparc64/dl-machine.h +++ b/sysdeps/sparc/sparc64/dl-machine.h @@ -1,5 +1,6 @@ /* Machine-dependent ELF dynamic relocation inline functions. Sparc64 version. - Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc. + Copyright (C) 1997,1998,1999,2000,2001,2002, 2003 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -240,8 +241,9 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc, static inline void 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 unsigned long int r_type = ELF64_R_TYPE_ID (reloc->r_info); #if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC @@ -292,8 +294,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, rtld_progname ?: "<program name unknown>", strtab + refsym->st_name); } - memcpy (reloc_addr, (void *) value, MIN (sym->st_size, - refsym->st_size)); + memcpy (reloc_addr_arg, (void *) value, + MIN (sym->st_size, refsym->st_size)); break; #endif case R_SPARC_64: @@ -392,31 +394,31 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, break; #ifndef RTLD_BOOTSTRAP case R_SPARC_UA16: - ((unsigned char *) reloc_addr) [0] = value >> 8; - ((unsigned char *) reloc_addr) [1] = value; + ((unsigned char *) reloc_addr_arg) [0] = value >> 8; + ((unsigned char *) reloc_addr_arg) [1] = value; break; case R_SPARC_UA32: - ((unsigned char *) reloc_addr) [0] = value >> 24; - ((unsigned char *) reloc_addr) [1] = value >> 16; - ((unsigned char *) reloc_addr) [2] = value >> 8; - ((unsigned char *) reloc_addr) [3] = value; + ((unsigned char *) reloc_addr_arg) [0] = value >> 24; + ((unsigned char *) reloc_addr_arg) [1] = value >> 16; + ((unsigned char *) reloc_addr_arg) [2] = value >> 8; + ((unsigned char *) reloc_addr_arg) [3] = value; break; case R_SPARC_UA64: - if (! ((long) reloc_addr & 3)) + if (! ((long) reloc_addr_arg & 3)) { /* Common in .eh_frame */ - ((unsigned int *) reloc_addr) [0] = value >> 32; - ((unsigned int *) reloc_addr) [1] = value; + ((unsigned int *) reloc_addr_arg) [0] = value >> 32; + ((unsigned int *) reloc_addr_arg) [1] = value; break; } - ((unsigned char *) reloc_addr) [0] = value >> 56; - ((unsigned char *) reloc_addr) [1] = value >> 48; - ((unsigned char *) reloc_addr) [2] = value >> 40; - ((unsigned char *) reloc_addr) [3] = value >> 32; - ((unsigned char *) reloc_addr) [4] = value >> 24; - ((unsigned char *) reloc_addr) [5] = value >> 16; - ((unsigned char *) reloc_addr) [6] = value >> 8; - ((unsigned char *) reloc_addr) [7] = value; + ((unsigned char *) reloc_addr_arg) [0] = value >> 56; + ((unsigned char *) reloc_addr_arg) [1] = value >> 48; + ((unsigned char *) reloc_addr_arg) [2] = value >> 40; + ((unsigned char *) reloc_addr_arg) [3] = value >> 32; + ((unsigned char *) reloc_addr_arg) [4] = value >> 24; + ((unsigned char *) reloc_addr_arg) [5] = value >> 16; + ((unsigned char *) reloc_addr_arg) [6] = value >> 8; + ((unsigned char *) reloc_addr_arg) [7] = value; break; #endif #if !defined RTLD_BOOTSTRAP || defined _NDEBUG @@ -430,8 +432,9 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, 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; } |