From owner-svn-src-head@freebsd.org Thu Jul 27 08:33:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4FA7DC50EA; Thu, 27 Jul 2017 08:33:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A25236C622; Thu, 27 Jul 2017 08:33:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6R8XVAb069509; Thu, 27 Jul 2017 08:33:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6R8XVHc069508; Thu, 27 Jul 2017 08:33:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707270833.v6R8XVHc069508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Jul 2017 08:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321607 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 321607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jul 2017 08:33:32 -0000 Author: kib Date: Thu Jul 27 08:33:31 2017 New Revision: 321607 URL: https://svnweb.freebsd.org/changeset/base/321607 Log: Allow to specify targets by absolute paths in libmap.conf. Submitted by: Tatu Kilappa PR: 221032 MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Jul 27 07:28:29 2017 (r321606) +++ head/libexec/rtld-elf/rtld.c Thu Jul 27 08:33:31 2017 (r321607) @@ -1590,19 +1590,20 @@ find_library(const char *xname, const Obj_Entry *refob bool nodeflib, objgiven; objgiven = refobj != NULL; - if (strchr(xname, '/') != NULL) { /* Hard coded pathname */ - if (xname[0] != '/' && !trust) { + + if (libmap_disable || !objgiven || + (name = lm_find(refobj->path, xname)) == NULL) + name = (char *)xname; + + if (strchr(name, '/') != NULL) { /* Hard coded pathname */ + if (name[0] != '/' && !trust) { _rtld_error("Absolute pathname required for shared object \"%s\"", - xname); - return NULL; + name); + return (NULL); } return (origin_subst(__DECONST(Obj_Entry *, refobj), - __DECONST(char *, xname))); + __DECONST(char *, name))); } - - if (libmap_disable || !objgiven || - (name = lm_find(refobj->path, xname)) == NULL) - name = (char *)xname; dbg(" Searching for \"%s\"", name);