diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2012-09-22 05:27:47 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2012-09-22 05:27:47 +0000 |
| commit | ec4428b7a4ca8c74aec8d528c08c3fe7f37a0f2f (patch) | |
| tree | 8852cd6e40e58c33c22d0b59ca23110b64a70553 /libexec/rtld-elf/rtld.c | |
| parent | 126a85e4fcca6bce239e9169b484beffd07863cf (diff) | |
MFC r240686:
Do not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOAD
for a non-absolute path.
PR: bin/171604
Notes
svn path=/stable/9/; revision=240801
Diffstat (limited to 'libexec/rtld-elf/rtld.c')
| -rw-r--r-- | libexec/rtld-elf/rtld.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 32cec5755023..069809a52670 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1429,7 +1429,7 @@ find_library(const char *xname, const Obj_Entry *refobj) { char *pathname; char *name; - bool objgiven; + bool nodeflib, objgiven; objgiven = refobj != NULL; if (strchr(xname, '/') != NULL) { /* Hard coded pathname */ @@ -1464,6 +1464,7 @@ find_library(const char *xname, const Obj_Entry *refobj) (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL) return (pathname); } else { + nodeflib = objgiven ? refobj->z_nodeflib : false; if ((objgiven && (pathname = search_library_path(name, refobj->rpath)) != NULL) || (objgiven && refobj->runpath == NULL && refobj != obj_main && @@ -1471,9 +1472,8 @@ find_library(const char *xname, const Obj_Entry *refobj) (pathname = search_library_path(name, ld_library_path)) != NULL || (objgiven && (pathname = search_library_path(name, refobj->runpath)) != NULL) || - (pathname = search_library_path(name, gethints(refobj->z_nodeflib))) - != NULL || - (objgiven && !refobj->z_nodeflib && + (pathname = search_library_path(name, gethints(nodeflib))) != NULL || + (objgiven && !nodeflib && (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL)) return (pathname); } |
