diff options
author | Roland McGrath <roland@gnu.org> | 1996-06-03 04:46:40 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-06-03 04:46:40 +0000 |
commit | 710f7bab59b9bb02f1cd46fa2db14e2b4b0a806a (patch) | |
tree | ce514b2cae73e161177b1a390c7c4118efcff0b0 /sysdeps/stub | |
parent | 6c03c2cf27b1a12cbf680377e4796b88a20ed9db (diff) | |
download | glibc-710f7bab59b9bb02f1cd46fa2db14e2b4b0a806a.tar.gz glibc-710f7bab59b9bb02f1cd46fa2db14e2b4b0a806a.tar.xz glibc-710f7bab59b9bb02f1cd46fa2db14e2b4b0a806a.zip |
Mon Jun 3 00:30:35 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> cvs/libc-960603
* elf/dl-lookup.c (_dl_lookup_symbol): Take new arg RELOC_ADDR and don't allow a defn resolving to that address. * elf/link.h: Update prototype and comment. * elf/dl-runtime.c (fixup): Define local `resolve' function and pass it to elf_machine_relplt. * elf/dl-reloc.c (_dl_relocate_object: resolve): Take new arg RELOC_ADDR and pass it through to _dl_lookup_symbol. * elf/do-rel.h (elf_dynamic_do_rel): Pass RESOLVE to elf_machine_rel instead of calling it ourselves and passing its results. (elf_dynamic_do_rel): RESOLVE fn takes new arg RELOC_ADDR. * elf/rtld.c (dl_main): Pass 0 for RELOC_ADDR to _dl_lookup_symbol. * sysdeps/i386/dl-machine.h (elf_machine_rel): Remove SYM_LOADADDR arg. Add RESOLVE function ptr arg. Call *RESOLVE as necessary. * sysdeps/m68k/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/stub/dl-machine.h: Likewise. * csu/initfini.c (_fini): Add extern decl for i_am_not_a_leaf. * elf/dlfcn.h (dl_open_mode): Enumerated type removed. (RTLD_LAZY, RTLD_NOW): Define these as macros instead. (RTLD_GLOBAL): New macro. (dlopen): Take arg of type int instead of dl_open_mode. * elf/dlopen.c: Likewise. * math/math.h (_Mldbl): New macro, either produces L suffix or not. (M_*): Use it for these constants.
Diffstat (limited to 'sysdeps/stub')
-rw-r--r-- | sysdeps/stub/dl-machine.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sysdeps/stub/dl-machine.h b/sysdeps/stub/dl-machine.h index 73943f1558..1fdb461da7 100644 --- a/sysdeps/stub/dl-machine.h +++ b/sysdeps/stub/dl-machine.h @@ -61,16 +61,19 @@ elf_machine_load_address (void) static inline void elf_machine_rel (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM], - const Elf32_Rel *reloc, - Elf32_Addr sym_loadaddr, const Elf32_Sym *sym) + const Elf32_Rel *reloc, const Elf32_Sym *sym, + Elf32_Addr (*resolve) (const Elf32_Sym **ref, + Elf32_Addr reloc_addr, + int noplt)) { Elf32_Addr *const reloc_addr = (Elf32_Addr *) reloc->r_offset; - const Elf32_Addr sym_value = sym_loadaddr + sym->st_value; + Elf32_Addr loadbase; switch (ELF32_R_TYPE (reloc->r_info)) { case R_MACHINE_COPY: - memcpy (reloc_addr, (void *) sym_value, sym->st_size); + loadbase = (*resolve) (&sym, (Elf32_Addr) reloc_addr, 0); + memcpy (reloc_addr, (void *) (loadbase + sym->st_value), sym->st_size); break; default: assert (! "unexpected dynamic reloc type"); @@ -81,8 +84,10 @@ elf_machine_rel (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM], static inline void elf_machine_rela (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM], - const Elf32_Rela *reloc, - Elf32_Addr sym_loadaddr, const Elf32_Sym *sym) + const Elf32_Rel *reloc, const Elf32_Sym *sym, + Elf32_Addr (*resolve) (const Elf32_Sym **ref, + Elf32_Addr reloc_addr, + int noplt)) { _dl_signal_error (0, "Elf32_Rela relocation requested -- unused on " ELF_MACHINE_NAME); |