From f51d1dfd35f793488ee32c8226cb8955ed75acbe Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 14 Jul 1996 11:39:25 +0000 Subject: * elf/dl-reloc.c: Include "dynamic-link.h" at file scope. * elf/rtld.c: Include . * elf/dynamic-link.h (ELF_DYNAMIC_DO_REL, ELF_DYNAMIC_DO_RELA, ELF_DYNAMIC_RELOCATE): No longer take RESOLVE argument. Conditionalize defns on [RESOLVE]. * elf/do-rel.h (elf_dynamic_do_rel): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise. Instead use RESOLVE macro with same args. (elf_machine_rel): Conditionalize defn on [RESOLVE]. * elf/dl-reloc.c (RESOLVE): New macro, define before including "dynamic-link.h". It replaces `resolve' local function. * elf/dl-runtime.c: Likewise. * elf/rtld.c: Likewise. --- elf/dynamic-link.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'elf/dynamic-link.h') diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h index b69cb3f..45b6b2d 100644 --- a/elf/dynamic-link.h +++ b/elf/dynamic-link.h @@ -56,6 +56,8 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn, ElfW(Dyn) *info[DT_NUM + DT_PROCNUM]) info[DT_PLTREL]->d_un.d_val == DT_RELA); } +#ifdef RESOLVE + /* Get the definitions of `elf_dynamic_do_rel' and `elf_dynamic_do_rela'. These functions are almost identical, so we use cpp magic to avoid duplicating their code. It cannot be done in a more general function @@ -63,31 +65,33 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn, ElfW(Dyn) *info[DT_NUM + DT_PROCNUM]) #if ! ELF_MACHINE_NO_REL #include "do-rel.h" -#define ELF_DYNAMIC_DO_REL(map, lazy, resolve) \ +#define ELF_DYNAMIC_DO_REL(map, lazy) \ if ((map)->l_info[DT_REL]) \ - elf_dynamic_do_rel ((map), DT_REL, DT_RELSZ, (resolve), 0); \ + elf_dynamic_do_rel ((map), DT_REL, DT_RELSZ, 0); \ if ((map)->l_info[DT_PLTREL] && \ (map)->l_info[DT_PLTREL]->d_un.d_val == DT_REL) \ - elf_dynamic_do_rel ((map), DT_JMPREL, DT_PLTRELSZ, (resolve), (lazy)); + elf_dynamic_do_rel ((map), DT_JMPREL, DT_PLTRELSZ, (lazy)); #else -#define ELF_DYNAMIC_DO_REL(map, lazy, resolve) /* Nothing to do. */ +#define ELF_DYNAMIC_DO_REL(map, lazy) /* Nothing to do. */ #endif #if ! ELF_MACHINE_NO_RELA #define DO_RELA #include "do-rel.h" -#define ELF_DYNAMIC_DO_RELA(map, lazy, resolve) \ +#define ELF_DYNAMIC_DO_RELA(map, lazy) \ if ((map)->l_info[DT_RELA]) \ - elf_dynamic_do_rela ((map), DT_RELA, DT_RELASZ, (resolve), 0); \ + elf_dynamic_do_rela ((map), DT_RELA, DT_RELASZ, 0); \ if ((map)->l_info[DT_PLTREL] && \ (map)->l_info[DT_PLTREL]->d_un.d_val == DT_RELA) \ - elf_dynamic_do_rela ((map), DT_JMPREL, DT_PLTRELSZ, (resolve), (lazy)); + elf_dynamic_do_rela ((map), DT_JMPREL, DT_PLTRELSZ, (lazy)); #else -#define ELF_DYNAMIC_DO_RELA(map, lazy, resolve) /* Nothing to do. */ +#define ELF_DYNAMIC_DO_RELA(map, lazy) /* Nothing to do. */ #endif /* This can't just be an inline function because GCC is too dumb to inline functions containing inlines themselves. */ -#define ELF_DYNAMIC_RELOCATE(map, lazy, resolve) \ - do { ELF_DYNAMIC_DO_REL ((map), (lazy), (resolve)); \ - ELF_DYNAMIC_DO_RELA ((map), (lazy), (resolve)); } while (0) +#define ELF_DYNAMIC_RELOCATE(map, lazy) \ + do { ELF_DYNAMIC_DO_REL ((map), (lazy)); \ + ELF_DYNAMIC_DO_RELA ((map), (lazy)); } while (0) + +#endif -- cgit v1.1