From a2e1b046f6891ac76830353f7afc97b0c6d27a64 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 7 Jan 1996 10:00:21 +0000 Subject: Sat Jan 6 16:39:14 1996 Roland McGrath * Makefile (subdirs): Added db. * resolv/Makefile (routines): Add res_data. * resolv/res_data.c, resolv/res_debug.c, resolv/resolv.h: Updated from BIND 4.9.3 final release. * elf/dynamic-link.h (elf_get_dynamic_info): Handle processor-specific tags. (ELF_DYNAMIC_DO_REL, ELF_DYNAMIC_DO_RELA): Handle absent DT_PLTREL tag. * elf/elf.h (DT_MIPS_NUM, DT_PROCNUM): New macros. * elf/link.h (struct link_map): Extend `l_info' by DT_PROCNUM. * sysdeps/i386/dl-machine.h (elf_machine_runtime_setup): Take new arg LAZY. Only do our work if LAZY and there is a DT_JMPREL record. * elf/dl-reloc.c (_dl_relocate_object): Call elf_machine_runtime_setup unconditionally, and pass it LAZY flag. * elf/dl-load.c: Fixed ELFMAG check to work for either byte order. Align end of load segment only to page size, not to segment alignment. --- sysdeps/i386/dl-machine.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'sysdeps/i386') diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 7c22305307..4ce4d4b001 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. i386 version. -Copyright (C) 1995 Free Software Foundation, Inc. +Copyright (C) 1995, 1996 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 @@ -140,20 +140,23 @@ elf_machine_lazy_rel (struct link_map *map, const Elf32_Rel *reloc) entries will jump to the on-demand fixup code in dl-runtime.c. */ static inline void -elf_machine_runtime_setup (struct link_map *l) +elf_machine_runtime_setup (struct link_map *l, int lazy) { Elf32_Addr *got; extern void _dl_runtime_resolve (Elf32_Word); - /* The GOT entries for functions in the PLT have not yet been filled - in. Their initial contents will arrange when called to push an - offset into the .rel.plt section, push _GLOBAL_OFFSET_TABLE_[1], - and then jump to _GLOBAL_OFFSET_TABLE[2]. */ - got = (Elf32_Addr *) (l->l_addr + l->l_info[DT_PLTGOT]->d_un.d_ptr); - got[1] = (Elf32_Addr) l; /* Identify this shared object. */ - /* This function will get called to fix up the GOT entry indicated by - the offset on the stack, and then jump to the resolved address. */ - got[2] = (Elf32_Addr) &_dl_runtime_resolve; + if (l->l_info[DT_JMPREL] && lazy) + { + /* The GOT entries for functions in the PLT have not yet been filled + in. Their initial contents will arrange when called to push an + offset into the .rel.plt section, push _GLOBAL_OFFSET_TABLE_[1], + and then jump to _GLOBAL_OFFSET_TABLE[2]. */ + got = (Elf32_Addr *) (l->l_addr + l->l_info[DT_PLTGOT]->d_un.d_ptr); + got[1] = (Elf32_Addr) l; /* Identify this shared object. */ + /* This function will get called to fix up the GOT entry indicated by + the offset on the stack, and then jump to the resolved address. */ + got[2] = (Elf32_Addr) &_dl_runtime_resolve; + } } -- cgit v1.2.3