From: Ulrich Drepper Date: Tue, 10 Mar 1998 22:08:30 +0000 (+0000) Subject: (_dl_library_path): New variable. Initialize from LD_LIBRARY_PATH envvar X-Git-Tag: cvs/before-sparc-2_0_x-branch~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2923741d1323eba2bab9ef50ac40815e6b2f219;p=thirdparty%2Fglibc.git (_dl_library_path): New variable. Initialize from LD_LIBRARY_PATH envvar and let user overwrite the value using new --library-path option. --- diff --git a/elf/rtld.c b/elf/rtld.c index c7bac88f024..c69584856f0 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -51,6 +51,7 @@ static void print_unresolved (const char *errstring, const char *objname); int _dl_argc; char **_dl_argv; const char *_dl_rpath; +const char *_dl_library_path; /* Set nonzero during loading and initialization of executable and libraries, cleared before the executable's entry point runs. This @@ -151,6 +152,7 @@ dl_main (const ElfW(Phdr) *phdr, char *file; mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal; + _dl_library_path = getenv ("LD_LIBRARY_PATH"); /* LAZY is determined by the parameters --datadeps and --function-deps if we trace the binary. */ @@ -234,6 +236,14 @@ of this helper program; chances are you did not intend to run this program.\n", --_dl_argc; ++_dl_argv; } + else if (! strcmp (_dl_argv[1], "--library-path") + && _dl_argc > 2) + { + _dl_library_path = _dl_argv[2]; + _dl_skip_args += 2; + _dl_argc -= 2; + _dl_argv += 2; + } else break;