svn commit: r322346 - stable/11/libexec/rtld-elf

Konstantin Belousov kib at FreeBSD.org
Thu Aug 10 09:02:46 UTC 2017


Author: kib
Date: Thu Aug 10 09:02:44 2017
New Revision: 322346
URL: https://svnweb.freebsd.org/changeset/base/322346

Log:
  MFC r321607:
  Allow to specify targets by absolute paths in libmap.conf.
  
  PR:	221032

Modified:
  stable/11/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/11/libexec/rtld-elf/rtld.c	Thu Aug 10 09:00:15 2017	(r322345)
+++ stable/11/libexec/rtld-elf/rtld.c	Thu Aug 10 09:02:44 2017	(r322346)
@@ -1589,19 +1589,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);
 


More information about the svn-src-all mailing list