Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2008 13:56:27 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r184335 - in stable/7/sys: . kern
Message-ID:  <200810271356.m9RDuRjt041126@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Oct 27 13:56:27 2008
New Revision: 184335
URL: http://svn.freebsd.org/changeset/base/184335

Log:
  MFC r175105 (by peter):
  Fall back to the binary-specified interpreter (ld-elf.so.1) if the
  ABI override binary isn't found.
  
  MFC r183694:
  If the ABI-overriden interpreter was not loaded, do not set have_interp
  to TRUE.
  
  Approved by:	re (kensmith)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/kern/imgact_elf.c

Modified: stable/7/sys/kern/imgact_elf.c
==============================================================================
--- stable/7/sys/kern/imgact_elf.c	Mon Oct 27 13:54:54 2008	(r184334)
+++ stable/7/sys/kern/imgact_elf.c	Mon Oct 27 13:56:27 2008	(r184335)
@@ -612,7 +612,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 	u_long seg_size, seg_addr;
 	u_long addr, entry = 0, proghdr = 0;
 	int error = 0, i;
-	const char *interp = NULL;
+	const char *interp = NULL, *newinterp = NULL;
 	Elf_Brandinfo *brand_info;
 	const Elf_Note *note, *note_end;
 	char *path;
@@ -665,7 +665,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 		return (ENOEXEC);
 	sv = brand_info->sysvec;
 	if (interp != NULL && brand_info->interp_newpath != NULL)
-		interp = brand_info->interp_newpath;
+		newinterp = brand_info->interp_newpath;
 
 	/*
 	 * Avoid a possible deadlock if the current address space is destroyed
@@ -802,6 +802,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 	imgp->entry_addr = entry;
 
 	if (interp != NULL) {
+		int have_interp = FALSE;
 		VOP_UNLOCK(imgp->vp, 0, td);
 		if (brand_info->emul_path != NULL &&
 		    brand_info->emul_path[0] != '\0') {
@@ -812,9 +813,15 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 			    &imgp->entry_addr, sv->sv_pagesize);
 			free(path, M_TEMP);
 			if (error == 0)
-				interp = NULL;
+				have_interp = TRUE;
 		}
-		if (interp != NULL) {
+		if (!have_interp && newinterp != NULL) {
+			error = __elfN(load_file)(imgp->proc, newinterp, &addr,
+			    &imgp->entry_addr, sv->sv_pagesize);
+			if (error == 0)
+				have_interp = TRUE;
+		}
+		if (!have_interp) {
 			error = __elfN(load_file)(imgp->proc, interp, &addr,
 			    &imgp->entry_addr, sv->sv_pagesize);
 		}



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