1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2001-08-24  Jakub Jelinek  <jakub@redhat.com>

	* elf/do-rel.h (elf_machine_rel_relative): Define for rela if
	necessary.  Undefine newly defined macros at the end.
	* sysdeps/hppa/dl-machine.h (elf_machine_rela_relative):
	Rename from elf_machine_rel_relative.
	* sysdeps/cris/dl-machine.h (elf_machine_rela_relative): Likewise.
	* sysdeps/m68k/dl-machine.h (elf_machine_rela_relative): Likewise.
	* sysdeps/powerpc/dl-machine.h (elf_machine_rela_relative): Likewise.
	* sysdeps/ia64/dl-machine.h (elf_machine_rela_relative): Likewise.
	Fix argument types.
	* sysdeps/alpha/dl-machine.h (elf_machine_rela_relative): Likewise.
	Fix argument types.
	* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela_relative):
	Likewise.  Fix argument types.
	* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela_relative):
	Likewise.  Fix argument types.
	* sysdeps/sh/dl-machine.h (elf_machine_rela_relative): Likewise.
	Fix argument types.
	* sysdeps/mips/dl-machine.h (elf_machine_rel_relative): Use
	ElfW(Rel) in argument.
	* sysdeps/mips/mips64/dl-machine.h (elf_machine_rel_relative): New
	function.
This commit is contained in:
Ulrich Drepper
2001-08-24 14:58:03 +00:00
parent a4c4e6db68
commit 1f2a1df36b
13 changed files with 66 additions and 29 deletions

View File

@ -1,3 +1,27 @@
2001-08-24 Jakub Jelinek <jakub@redhat.com>
* elf/do-rel.h (elf_machine_rel_relative): Define for rela if
necessary. Undefine newly defined macros at the end.
* sysdeps/hppa/dl-machine.h (elf_machine_rela_relative):
Rename from elf_machine_rel_relative.
* sysdeps/cris/dl-machine.h (elf_machine_rela_relative): Likewise.
* sysdeps/m68k/dl-machine.h (elf_machine_rela_relative): Likewise.
* sysdeps/powerpc/dl-machine.h (elf_machine_rela_relative): Likewise.
* sysdeps/ia64/dl-machine.h (elf_machine_rela_relative): Likewise.
Fix argument types.
* sysdeps/alpha/dl-machine.h (elf_machine_rela_relative): Likewise.
Fix argument types.
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela_relative):
Likewise. Fix argument types.
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela_relative):
Likewise. Fix argument types.
* sysdeps/sh/dl-machine.h (elf_machine_rela_relative): Likewise.
Fix argument types.
* sysdeps/mips/dl-machine.h (elf_machine_rel_relative): Use
ElfW(Rel) in argument.
* sysdeps/mips/mips64/dl-machine.h (elf_machine_rel_relative): New
function.
2001-08-24 Alexandre Oliva <aoliva@redhat.com> 2001-08-24 Alexandre Oliva <aoliva@redhat.com>
* sysdeps/sh/dl-machine.h (elf_machine_rela): Fix typo. * sysdeps/sh/dl-machine.h (elf_machine_rela): Fix typo.

View File

@ -21,12 +21,13 @@
`elf_dynamic_do_rel' and `elf_dynamic_do_rela'. */ `elf_dynamic_do_rel' and `elf_dynamic_do_rela'. */
#ifdef DO_RELA #ifdef DO_RELA
# define elf_dynamic_do_rel elf_dynamic_do_rela # define elf_dynamic_do_rel elf_dynamic_do_rela
# define RELCOUNT_IDX VERSYMIDX (DT_RELACOUNT) # define RELCOUNT_IDX VERSYMIDX (DT_RELACOUNT)
# define Rel Rela # define Rel Rela
# define elf_machine_rel elf_machine_rela # define elf_machine_rel elf_machine_rela
# define elf_machine_rel_relative elf_machine_rela_relative
#else #else
# define RELCOUNT_IDX VERSYMIDX (DT_RELCOUNT) # define RELCOUNT_IDX VERSYMIDX (DT_RELCOUNT)
#endif #endif
#ifndef VERSYMIDX #ifndef VERSYMIDX
@ -98,3 +99,5 @@ elf_dynamic_do_rel (struct link_map *map,
#undef elf_dynamic_do_rel #undef elf_dynamic_do_rel
#undef Rel #undef Rel
#undef elf_machine_rel #undef elf_machine_rel
#undef elf_machine_rel_relative
#undef RELCOUNT_IDX

View File

@ -548,8 +548,8 @@ elf_machine_rela (struct link_map *map,
} }
static inline void static inline void
elf_machine_rel_relative (Elf64_Addr l_addr, const Elf64_Rel *reloc, elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
Elf64_Addr *const reloc_addr) Elf64_Addr *const reloc_addr)
{ {
/* XXX Make some timings. Maybe it's preverable to test for /* XXX Make some timings. Maybe it's preverable to test for
unaligned access and only do it the complex way if necessary. */ unaligned access and only do it the complex way if necessary. */

View File

@ -366,8 +366,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
} }
static inline void static inline void
elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
Elf32_Addr *const reloc_addr) Elf32_Addr *const reloc_addr)
{ {
*reloc_addr = l_addr + reloc->r_addend; *reloc_addr = l_addr + reloc->r_addend;
} }

View File

@ -629,8 +629,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
} }
static inline void static inline void
elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
Elf32_Addr *const reloc_addr) Elf32_Addr *const reloc_addr)
{ {
/* XXX Nothing to do. There is no relative relocation, right? */ /* XXX Nothing to do. There is no relative relocation, right? */
} }

View File

@ -580,8 +580,8 @@ elf_machine_rela (struct link_map *map,
} }
static inline void static inline void
elf_machine_rel_relative (Elf64_Addr l_addr, const Elf64_Rel *reloc, elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
Elf64_Addr *const reloc_addr) Elf64_Addr *const reloc_addr)
{ {
/* ??? Ignore MSB and Instruction format for now. */ /* ??? Ignore MSB and Instruction format for now. */
assert (ELF64_R_TYPE (reloc->r_info) == R_IA64_REL64LSB); assert (ELF64_R_TYPE (reloc->r_info) == R_IA64_REL64LSB);

View File

@ -299,8 +299,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
} }
static inline void static inline void
elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
Elf32_Addr *const reloc_addr) Elf32_Addr *const reloc_addr)
{ {
*reloc_addr = l_addr + reloc->r_addend; *reloc_addr = l_addr + reloc->r_addend;
} }

View File

@ -536,8 +536,8 @@ elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
} }
static inline void static inline void
elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
Elf32_Addr *const reloc_addr) ElfW(Addr) *const reloc_addr)
{ {
/* XXX Nothing to do. There is no relative relocation, right? */ /* XXX Nothing to do. There is no relative relocation, right? */
} }

View File

@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. MIPS version. /* Machine-dependent ELF dynamic relocation inline functions. MIPS64 version.
Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
@ -530,10 +530,11 @@ elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version, const ElfW(Sym) *sym, const struct r_found_version *version,
ElfW(Addr) *const reloc_addr) ElfW(Addr) *const reloc_addr)
{ {
const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
ElfW(Addr) loadbase; ElfW(Addr) loadbase;
ElfW(Addr) undo __attribute__ ((unused)); ElfW(Addr) undo __attribute__ ((unused));
switch (ELFW(R_TYPE) (reloc->r_info)) switch (r_type)
{ {
case R_MIPS_REL32: case R_MIPS_REL32:
{ {
@ -565,14 +566,23 @@ elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
*reloc_addr += (sym ? (loadbase + sym->st_value) : 0) - undo; *reloc_addr += (sym ? (loadbase + sym->st_value) : 0) - undo;
} }
break; break;
#ifndef RTLD_BOOTSTRAP
case R_MIPS_NONE: /* Alright, Wilbur. */ case R_MIPS_NONE: /* Alright, Wilbur. */
break; break;
#endif
default: default:
_dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0); _dl_reloc_bad_type (map, r_type, 0);
break; break;
} }
} }
static inline void
elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
ElfW(Addr) *const reloc_addr)
{
/* XXX Nothing to do. There is no relative relocation, right? */
}
static inline void static inline void
elf_machine_lazy_rel (struct link_map *map, ElfW(Addr) l_addr, elf_machine_lazy_rel (struct link_map *map, ElfW(Addr) l_addr,
const ElfW(Rel) *reloc) const ElfW(Rel) *reloc)

View File

@ -394,8 +394,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
} }
static inline void static inline void
elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
Elf32_Addr *const reloc_addr) Elf32_Addr *const reloc_addr)
{ {
*reloc_addr = l_addr + reloc->r_addend; *reloc_addr = l_addr + reloc->r_addend;
} }

View File

@ -558,8 +558,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
} }
static inline void static inline void
elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc, elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
Elf32_Addr *const reloc_addr) Elf32_Addr *const reloc_addr)
{ {
if (reloc->r_addend) if (reloc->r_addend)
value = l_addr + reloc->r_addend; value = l_addr + reloc->r_addend;

View File

@ -459,8 +459,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
} }
static inline void static inline void
elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc, elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
Elf32_Addr *const reloc_addr) Elf32_Addr *const reloc_addr)
{ {
*reloc_addr += l_addr + reloc->r_addend; *reloc_addr += l_addr + reloc->r_addend;
} }

View File

@ -368,8 +368,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
} }
static inline void static inline void
elf_machine_rel_relative (Elf64_Addr l_addr, const Elf64_Rel *reloc, elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
Elf64_Addr *const reloc_addr) Elf64_Addr *const reloc_addr)
{ {
*reloc_addr = l_addr + reloc->r_addend; *reloc_addr = l_addr + reloc->r_addend;
} }