From b1dbbaa48c188f78fa78f25cf405b8d95575de08 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 14 Jul 1996 13:20:46 +0000 Subject: * elf/rtld.c (RESOLVE): Use the dl's load address, not a constant zero! (_dl_start): Move RESOLVE defn inside this function and #include "dynamic-link.h" a second time there. [RTLD_START]: Move use of this after _dl_start function. --- ChangeLog | 5 +++++ elf/rtld.c | 25 +++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a39462..29adb97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ Sun Jul 14 01:51:39 1996 Roland McGrath + * elf/rtld.c (RESOLVE): Use the dl's load address, not a constant zero! + (_dl_start): Move RESOLVE defn inside this function and #include + "dynamic-link.h" a second time there. + [RTLD_START]: Move use of this after _dl_start function. + * elf/dl-reloc.c: Include "dynamic-link.h" at file scope. * elf/rtld.c: Include . diff --git a/elf/rtld.c b/elf/rtld.c index 1058d87..6a4742b 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -24,21 +24,10 @@ Cambridge, MA 02139, USA. */ #include #include /* Check if MAP_ANON is defined. */ #include "../stdio-common/_itoa.h" - - -/* This #define produces dynamic linking inline functions for - bootstrap relocation instead of general-purpose relocation. */ -#define RTLD_BOOTSTRAP -#define RESOLVE(sym, reloc_addr, noplt) 0 +#include #include "dynamic-link.h" -#ifdef RTLD_START -RTLD_START -#else -#error "sysdeps/MACHINE/dl-machine.h fails to define RTLD_START" -#endif - /* System-specific function to do initial startup for the dynamic linker. After this, file access calls and getenv must work. This is responsible for setting _dl_secure if we need to be secure (e.g. setuid), @@ -60,11 +49,23 @@ static void dl_main (const ElfW(Phdr) *phdr, struct link_map _dl_rtld_map; +#ifdef RTLD_START +RTLD_START +#else +#error "sysdeps/MACHINE/dl-machine.h fails to define RTLD_START" +#endif + ElfW(Addr) _dl_start (void *arg) { struct link_map bootstrap_map; + /* This #define produces dynamic linking inline functions for + bootstrap relocation instead of general-purpose relocation. */ +#define RTLD_BOOTSTRAP +#define RESOLVE(sym, reloc_addr, noplt) bootstrap_map.l_addr +#include "dynamic-link.h" + /* Figure out the run-time load address of the dynamic linker itself. */ bootstrap_map.l_addr = elf_machine_load_address (); -- cgit v1.1