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/dl-reloc.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'elf/dl-reloc.c') diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index e6778e7de3..5adf0f6dac 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -24,7 +24,6 @@ Cambridge, MA 02139, USA. */ #include #include "dynamic-link.h" - void _dl_relocate_object (struct link_map *l, struct link_map *scope[], int lazy) { @@ -56,15 +55,14 @@ _dl_relocate_object (struct link_map *l, struct link_map *scope[], int lazy) const char *strtab /* String table object symbols. */ = ((void *) l->l_addr + l->l_info[DT_STRTAB]->d_un.d_ptr); - ElfW(Addr) resolve (const ElfW(Sym) **ref, - ElfW(Addr) reloc_addr, int noplt) - { - /* Look up the referenced symbol in the specified scope. */ - return _dl_lookup_symbol (strtab + (*ref)->st_name, ref, scope, - l->l_name, reloc_addr, noplt); - } - ELF_DYNAMIC_RELOCATE (l, lazy, resolve); + /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */ +#define RESOLVE(ref, reloc_addr, noplt) \ + (_dl_lookup_symbol (strtab + (*ref)->st_name, ref, scope, \ + l->l_name, reloc_addr, noplt)) + +#include "dynamic-link.h" + ELF_DYNAMIC_RELOCATE (l, lazy); } /* Set up the PLT so its unrelocated entries will jump to -- cgit v1.2.3