diff options
author | peter <peter@FreeBSD.org> | 2008-01-05 08:35:56 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2008-01-05 08:35:56 +0000 |
commit | 1e0f13faf70c050a4bc6b47ae28525d8e51f632f (patch) | |
tree | 393e030939bd5a0c60a7a2813ebe870fdab4ab82 /sys/kern/imgact_elf.c | |
parent | ebfbe60329d37a8bb2ebde0c4ea506e5b2655e85 (diff) | |
download | FreeBSD-src-1e0f13faf70c050a4bc6b47ae28525d8e51f632f.zip FreeBSD-src-1e0f13faf70c050a4bc6b47ae28525d8e51f632f.tar.gz |
Fall back to the binary-specified interpreter (ld-elf.so.1) if the
ABI override binary isn't found. This could probably be smoother, but
it is what I did in p4 change #126891 on 2007/09/27. It should solve
the "ld-elf32.so.1"-in-chroot problem.
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 03da355..0742f63 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -612,7 +612,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) 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 image_params *imgp) 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 image_params *imgp) 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,14 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) &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); + have_interp = TRUE; + } + if (!have_interp) { error = __elfN(load_file)(imgp->proc, interp, &addr, &imgp->entry_addr, sv->sv_pagesize); } |