* 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.
This commit is contained in:
Roland McGrath 1996-07-14 13:20:46 +00:00
parent f51d1dfd35
commit b1dbbaa48c
2 changed files with 18 additions and 12 deletions

View file

@ -1,5 +1,10 @@
Sun Jul 14 01:51:39 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* 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 <string.h>.

View file

@ -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 ();