From: Ulrich Drepper Date: Sat, 24 May 1997 22:55:58 +0000 (+0000) Subject: (elf_machine_runtime_setup): Update skeleton definition. X-Git-Tag: cvs/libc-2_0_4~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e5f9db6ba48e0b4999d0fa50045764ef60b9c19;p=thirdparty%2Fglibc.git (elf_machine_runtime_setup): Update skeleton definition. --- diff --git a/sysdeps/stub/dl-machine.h b/sysdeps/stub/dl-machine.h index f44266f7b7d..2e61f249d95 100644 --- a/sysdeps/stub/dl-machine.h +++ b/sysdeps/stub/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. Stub version. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997 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 @@ -102,19 +102,26 @@ elf_machine_rela (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM], /* Set up the loaded object described by L so its unrelocated PLT entries will jump to the on-demand fixup code in dl-runtime.c. */ -static inline void +static inline int elf_machine_runtime_setup (struct link_map *l) { 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]. */ - Elf32_Addr *got = (Elf32_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 (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]. */ + Elf32_Addr *got = (Elf32_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; + } + + return lazy; }