From owner-svn-src-all@FreeBSD.ORG Wed Sep 19 05:11:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01B5F1065670; Wed, 19 Sep 2012 05:11:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E15D28FC0C; Wed, 19 Sep 2012 05:11:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8J5BPqJ029824; Wed, 19 Sep 2012 05:11:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8J5BPZL029822; Wed, 19 Sep 2012 05:11:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209190511.q8J5BPZL029822@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Sep 2012 05:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240686 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 05:11:26 -0000 Author: kib Date: Wed Sep 19 05:11:25 2012 New Revision: 240686 URL: http://svn.freebsd.org/changeset/base/240686 Log: Do not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOAD for a non-absolute path. PR: bin/171604 MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Sep 19 00:27:50 2012 (r240685) +++ head/libexec/rtld-elf/rtld.c Wed Sep 19 05:11:25 2012 (r240686) @@ -1429,7 +1429,7 @@ find_library(const char *xname, const Ob { 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 Ob (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 Ob (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); }