diff --git a/sys/compat/freebsd/freebsd_exec_elf32.c b/sys/compat/freebsd/freebsd_exec_elf32.c index f89064b8ed7a..b7452d6214c7 100644 --- a/sys/compat/freebsd/freebsd_exec_elf32.c +++ b/sys/compat/freebsd/freebsd_exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_exec_elf32.c,v 1.11 2003/06/29 22:29:16 fvdl Exp $ */ +/* $NetBSD: freebsd_exec_elf32.c,v 1.12 2003/10/31 14:04:35 drochner Exp $ */ /* * Copyright (c) 1993, 1994 Christopher G. Demetriou @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: freebsd_exec_elf32.c,v 1.11 2003/06/29 22:29:16 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_exec_elf32.c,v 1.12 2003/10/31 14:04:35 drochner Exp $"); #include #include @@ -115,12 +115,11 @@ ELFNAME2(freebsd,probe)(p, epp, veh, itp, pos) free(ph, M_TEMP); } - if (itp[0]) { + if (itp) { if ((error = emul_find_interp(p, epp->ep_esch->es_emul->e_path, itp))) return error; } - *pos = ELF_NO_ADDR; #ifdef DEBUG_FREEBSD_ELF printf("freebsd_elf32_probe: returning 0\n"); #endif diff --git a/sys/compat/ibcs2/ibcs2_exec_elf32.c b/sys/compat/ibcs2/ibcs2_exec_elf32.c index 993f7367d41f..75cefff921ef 100644 --- a/sys/compat/ibcs2/ibcs2_exec_elf32.c +++ b/sys/compat/ibcs2/ibcs2_exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_exec_elf32.c,v 1.6 2003/06/29 22:29:20 fvdl Exp $ */ +/* $NetBSD: ibcs2_exec_elf32.c,v 1.7 2003/10/31 14:04:35 drochner Exp $ */ /* * Copyright (c) 1994, 1995, 1998 Scott Bartram @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_elf32.c,v 1.6 2003/06/29 22:29:20 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_elf32.c,v 1.7 2003/10/31 14:04:35 drochner Exp $"); #define ELFSIZE 32 @@ -132,10 +132,9 @@ ibcs2_elf32_probe(p, epp, eh, itp, pos) if ((error = ibcs2_elf32_signature(p, epp, eh)) != 0) return error; - if (itp[0]) { + if (itp) { if ((error = emul_find_interp(p, epp->ep_esch->es_emul->e_path, itp))) return error; } - *pos = ELF32_NO_ADDR; return 0; } diff --git a/sys/compat/linux/common/linux_exec_elf32.c b/sys/compat/linux/common/linux_exec_elf32.c index b2b4fefaa542..37a2ee0fe270 100644 --- a/sys/compat/linux/common/linux_exec_elf32.c +++ b/sys/compat/linux/common/linux_exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec_elf32.c,v 1.65 2003/10/27 07:07:34 chs Exp $ */ +/* $NetBSD: linux_exec_elf32.c,v 1.66 2003/10/31 14:04:36 drochner Exp $ */ /*- * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.65 2003/10/27 07:07:34 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.66 2003/10/31 14:04:36 drochner Exp $"); #ifndef ELFSIZE /* XXX should die */ @@ -294,7 +294,7 @@ ELFNAME2(linux,signature)(p, epp, eh, itp) } /* Check for certain intepreter names. */ - if (itp[0]) { + if (itp) { if (!strncmp(itp, "/lib/ld-linux", 13) || !strncmp(itp, "/lib/ld.so.", 11)) error = 0; @@ -329,12 +329,11 @@ ELFNAME2(linux,probe)(p, epp, eh, itp, pos) 1) return error; - if (itp[0]) { + if (itp) { if ((error = emul_find_interp(p, epp->ep_esch->es_emul->e_path, itp))) return (error); } - *pos = ELF_NO_ADDR; DPRINTF(("linux_probe: returning 0\n")); return 0; } diff --git a/sys/compat/netbsd32/netbsd32_exec_elf32.c b/sys/compat/netbsd32/netbsd32_exec_elf32.c index 19c278c44da5..79611b05565d 100644 --- a/sys/compat/netbsd32/netbsd32_exec_elf32.c +++ b/sys/compat/netbsd32/netbsd32_exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_exec_elf32.c,v 1.20 2003/10/13 14:22:20 agc Exp $ */ +/* $NetBSD: netbsd32_exec_elf32.c,v 1.21 2003/10/31 14:04:36 drochner Exp $ */ /* from: NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp */ /* @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_exec_elf32.c,v 1.20 2003/10/13 14:22:20 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_exec_elf32.c,v 1.21 2003/10/31 14:04:36 drochner Exp $"); #define ELFSIZE 32 @@ -105,7 +105,7 @@ ELFNAME2(netbsd32,probe_noteless)(struct proc *p, struct exec_package *epp, { int error; - if (itp[0]) { + if (itp) { /* Translate interpreter name if needed */ if ((error = emul_find_interp(p, epp->ep_esch->es_emul->e_path, itp)) != 0) @@ -114,7 +114,9 @@ ELFNAME2(netbsd32,probe_noteless)(struct proc *p, struct exec_package *epp, epp->ep_flags |= EXEC_32; epp->ep_vm_minaddr = VM_MIN_ADDRESS; epp->ep_vm_maxaddr = USRSTACK32; - *pos = ELFDEFNNAME(NO_ADDR); +#ifdef ELF_INTERP_NON_RELOCATABLE + *pos = ELF_LINK_ADDR; +#endif return 0; } diff --git a/sys/compat/svr4/svr4_exec.h b/sys/compat/svr4/svr4_exec.h index f45e3f622965..27c1a85c8e88 100644 --- a/sys/compat/svr4/svr4_exec.h +++ b/sys/compat/svr4/svr4_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_exec.h,v 1.22 2003/06/29 22:29:46 fvdl Exp $ */ +/* $NetBSD: svr4_exec.h,v 1.23 2003/10/31 14:04:36 drochner Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -68,10 +68,6 @@ #define SVR4_INTERP_ADDR 0x10000000 #endif -#ifndef SVR4_INTERP_ADDR -# define SVR4_INTERP_ADDR ELFDEFNNAME(NO_ADDR) -#endif - extern const struct emul emul_svr4; void svr4_setregs __P((struct lwp *, struct exec_package *, u_long)); diff --git a/sys/compat/svr4/svr4_exec_elf32.c b/sys/compat/svr4/svr4_exec_elf32.c index e0b42fac87db..50e8e12e188f 100644 --- a/sys/compat/svr4/svr4_exec_elf32.c +++ b/sys/compat/svr4/svr4_exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_exec_elf32.c,v 1.7 2003/06/29 22:29:46 fvdl Exp $ */ +/* $NetBSD: svr4_exec_elf32.c,v 1.8 2003/10/31 14:04:36 drochner Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: svr4_exec_elf32.c,v 1.7 2003/06/29 22:29:46 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_exec_elf32.c,v 1.8 2003/10/31 14:04:36 drochner Exp $"); #define ELFSIZE 32 /* XXX should die */ @@ -71,10 +71,12 @@ svr4_elf32_probe(p, epp, eh, itp, pos) { int error; - if (itp[0]) { + if (itp) { if ((error = emul_find_interp(p, epp->ep_esch->es_emul->e_path, itp))) return error; } +#ifdef SVR4_INTERP_ADDR *pos = SVR4_INTERP_ADDR; +#endif return 0; } diff --git a/sys/compat/svr4/svr4_exec_elf64.c b/sys/compat/svr4/svr4_exec_elf64.c index ef38d673b486..d369a5c7233e 100644 --- a/sys/compat/svr4/svr4_exec_elf64.c +++ b/sys/compat/svr4/svr4_exec_elf64.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_exec_elf64.c,v 1.8 2003/06/29 22:29:46 fvdl Exp $ */ +/* $NetBSD: svr4_exec_elf64.c,v 1.9 2003/10/31 14:04:36 drochner Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: svr4_exec_elf64.c,v 1.8 2003/06/29 22:29:46 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_exec_elf64.c,v 1.9 2003/10/31 14:04:36 drochner Exp $"); #define ELFSIZE 64 /* XXX should die */ @@ -71,10 +71,12 @@ svr4_elf64_probe(p, epp, eh, itp, pos) { int error; - if (itp[0]) { + if (itp) { if ((error = emul_find_interp(p, epp->ep_esch->es_emul->e_path, itp))) return error; } +#ifdef SVR4_INTERP_ADDR *pos = SVR4_INTERP_ADDR; +#endif return 0; } diff --git a/sys/compat/svr4_32/svr4_32_exec.h b/sys/compat/svr4_32/svr4_32_exec.h index b3ae8acdff33..2bc405fe347e 100644 --- a/sys/compat/svr4_32/svr4_32_exec.h +++ b/sys/compat/svr4_32/svr4_32_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_exec.h,v 1.7 2003/06/29 22:29:50 fvdl Exp $ */ +/* $NetBSD: svr4_32_exec.h,v 1.8 2003/10/31 14:04:36 drochner Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -67,10 +67,6 @@ int svr4_32_copyargs __P((struct proc *, struct exec_package *, struct ps_string #endif #endif -#ifndef SVR4_32_INTERP_ADDR -# define SVR4_32_INTERP_ADDR ELFDEFNNAME(NO_ADDR) -#endif - extern const struct emul emul_svr4_32; void svr4_32_setregs __P((struct lwp *, struct exec_package *, u_long)); diff --git a/sys/compat/svr4_32/svr4_32_exec_elf32.c b/sys/compat/svr4_32/svr4_32_exec_elf32.c index 2915d0d1e041..c4b86859a3fb 100644 --- a/sys/compat/svr4_32/svr4_32_exec_elf32.c +++ b/sys/compat/svr4_32/svr4_32_exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_exec_elf32.c,v 1.12 2003/06/29 22:29:50 fvdl Exp $ */ +/* $NetBSD: svr4_32_exec_elf32.c,v 1.13 2003/10/31 14:04:36 drochner Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: svr4_32_exec_elf32.c,v 1.12 2003/06/29 22:29:50 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_exec_elf32.c,v 1.13 2003/10/31 14:04:36 drochner Exp $"); #define ELFSIZE 32 /* XXX should die */ @@ -284,11 +284,13 @@ svr4_32_elf32_probe(p, epp, eh, itp, pos) { int error; - if (itp[0]) { + if (itp) { if ((error = emul_find_interp(p, epp->ep_esch->es_emul->e_path, itp))) return error; } epp->ep_flags |= EXEC_32; +#ifdef SVR4_32_INTERP_ADDR *pos = SVR4_32_INTERP_ADDR; +#endif return 0; }