Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jul 2017 08:33:31 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321607 - head/libexec/rtld-elf
Message-ID:  <201707270833.v6R8XVHc069508@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <tatu.kilappa@iki.fi>
  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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707270833.v6R8XVHc069508>