about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-load.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 3e5ddc04f1..c712a7ecd9 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1608,7 +1608,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
 			&realname, &fb);
 
       /* Look at the RUNPATH information for this binary.  */
-      if (loader != NULL && loader->l_runpath_dirs.dirs != (void *) -1)
+      if (fd == -1 && loader != NULL
+	  && loader->l_runpath_dirs.dirs != (void *) -1)
 	{
 	  if (loader->l_runpath_dirs.dirs == NULL)
 	    {
@@ -1622,13 +1623,10 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
 				   + loader->l_info[DT_RUNPATH]->d_un.d_val);
 		  decompose_rpath (&loader->l_runpath_dirs,
 				   (const char *) ptrval, loader, "RUNPATH");
-
-		  if (loader->l_runpath_dirs.dirs != (void *) -1)
-		    fd = open_path (name, namelen, preloaded,
-				    &loader->l_runpath_dirs, &realname, &fb);
 		}
 	    }
-	  else if (loader->l_runpath_dirs.dirs != (void *) -1)
+
+	  if (loader->l_runpath_dirs.dirs != (void *) -1)
 	    fd = open_path (name, namelen, preloaded,
 			    &loader->l_runpath_dirs, &realname, &fb);
 	}