diff options
author | Roland McGrath <roland@gnu.org> | 1996-07-14 13:20:46 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-07-14 13:20:46 +0000 |
commit | b1dbbaa48c188f78fa78f25cf405b8d95575de08 (patch) | |
tree | c99907d3157107dbcb1cde8fe9eb10b7614bf67e /elf/rtld.c | |
parent | f51d1dfd35f793488ee32c8226cb8955ed75acbe (diff) | |
download | glibc-b1dbbaa48c188f78fa78f25cf405b8d95575de08.zip glibc-b1dbbaa48c188f78fa78f25cf405b8d95575de08.tar.gz glibc-b1dbbaa48c188f78fa78f25cf405b8d95575de08.tar.bz2 |
* 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.
Diffstat (limited to 'elf/rtld.c')
-rw-r--r-- | elf/rtld.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -24,21 +24,10 @@ Cambridge, MA 02139, USA. */ #include <unistd.h> #include <sys/mman.h> /* 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 <assert.h> #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 (); |