diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-02-18 11:00:24 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-02-18 11:00:24 +0000 |
commit | da8324650d7e867028d1d5e9bcaed962bc6b2322 (patch) | |
tree | cc31a3e0c6b34a8ee51b238c1599ca39784e3693 /elf/rtld.c | |
parent | 1b5fd8308347c4ac7f6a42aaf49ddb32ce2e09ec (diff) | |
download | glibc-da8324650d7e867028d1d5e9bcaed962bc6b2322.tar.gz glibc-da8324650d7e867028d1d5e9bcaed962bc6b2322.tar.xz glibc-da8324650d7e867028d1d5e9bcaed962bc6b2322.zip |
Update. cvs/libc-980218
1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dl-load.c (add_name_to_object): Don't translate strings. * elf/dl-minimal.c (_strerror_internal): Define it here to avoid pulling in the whole error list. (__dcgettext, dcgettext): Removed. * libc.map: Export _strerror_internal. 1998-02-18 10:50 Ulrich Drepper <drepper@cygnus.com> * sysdeps/i386/fpu/t_exp.c: New file. 1998-02-18 Andreas Jaeger <aj@arthur.rhein-neckar.de> * nis/libnss_nisplus.map: NIS+ support is new in glibc 2.1, add everything with version GLIBC_2.1. * hesiod/libnss_hesiod.map: Likewise. 1998-02-18 Andreas Jaeger <aj@arthur.rhein-neckar.de> * manual/arith.texi (Old-style number conversion): This node is a section, not a subsection. 1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dl-lookup.c (make_string): Use __stpcpy instead of stpcpy. 1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/rtld.c (dl_main): Make sure that the library search paths have been initialized before the first call to _dl_map_object. 1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makerules (common-generated): Add libc_pic.os. 1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/rtld.c (dl_main): Use PT_PHDR to figure out the load address of the executable. 1998-02-18 10:28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Diffstat (limited to 'elf/rtld.c')
-rw-r--r-- | elf/rtld.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/elf/rtld.c b/elf/rtld.c index 2ca1692584..dd79a81124 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -264,7 +264,6 @@ dl_main (const ElfW(Phdr) *phdr, size_t file_size; char *file; int has_interp = 0; - const char *library_path = NULL; /* Overwrites LD_LIBRARY_PATH if given. */ /* Test whether we want to see the content of the auxiliary array passed up from the kernel. */ @@ -323,6 +322,9 @@ dl_main (const ElfW(Phdr) *phdr, ourselves). This is an easy way to test a new ld.so before installing it. */ + /* Overwrites LD_LIBRARY_PATH if given. */ + const char *library_path = NULL; + /* Note the place where the dynamic linker actually came from. */ _dl_rtld_map.l_name = _dl_argv[0]; @@ -378,6 +380,10 @@ of this helper program; chances are you did not intend to run this program.\n", --_dl_argc; ++_dl_argv; + /* Initialize the data structures for the search paths for shared + objects. */ + _dl_init_paths (library_path); + if (mode == verify) { char *err_str = NULL; @@ -412,12 +418,20 @@ of this helper program; chances are you did not intend to run this program.\n", main_map->l_phnum = phent; main_map->l_entry = *user_entry; main_map->l_opencount = 1; + + /* Initialize the data structures for the search paths for shared + objects. */ + _dl_init_paths (NULL); } /* Scan the program header table for the dynamic section. */ for (ph = phdr; ph < &phdr[phent]; ++ph) switch (ph->p_type) { + case PT_PHDR: + /* Find out the load address. */ + main_map->l_addr = (ElfW(Addr)) phdr - ph->p_vaddr; + break; case PT_DYNAMIC: /* This tells us where to find the dynamic section, which tells us everything we need to do. */ @@ -492,10 +506,6 @@ of this helper program; chances are you did not intend to run this program.\n", preloads = NULL; npreloads = 0; - /* Initialize the data structures for the search paths for shared - objects. */ - _dl_init_paths (library_path); - preloadlist = getenv ("LD_PRELOAD"); if (preloadlist) { |