From e4a5d947a3b81372599b908f73a19348b69b2bb8 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Thu, 11 Feb 1999 07:53:28 +0000 Subject: [PATCH] Zero p->retval[1] when starting a process. This value ends up in %edx when the process starts, and having it nonzero causes statically-linked Linux binaries to fail. PR: i386/10015 Submitted by: Marcel Moolenaar --- sys/amd64/amd64/machdep.c | 9 ++++++++- sys/i386/i386/machdep.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 0a6b14a6b31a..b785ebf0a1b3 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.323 1999/01/28 11:45:29 newton Exp $ + * $Id: machdep.c,v 1.324 1999/02/03 14:10:50 dg Exp $ */ #include "apm.h" @@ -860,6 +860,13 @@ setregs(p, entry, stack) /* Initialize the npx (if any) for the current process. */ npxinit(__INITIAL_NPXCW__); #endif + + /* + * XXX - Linux emulator + * Make sure sure edx is 0x0 on entry. Linux binaries depend + * on it. + */ + p->p_retval[1] = 0; } static int diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 0a6b14a6b31a..b785ebf0a1b3 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.323 1999/01/28 11:45:29 newton Exp $ + * $Id: machdep.c,v 1.324 1999/02/03 14:10:50 dg Exp $ */ #include "apm.h" @@ -860,6 +860,13 @@ setregs(p, entry, stack) /* Initialize the npx (if any) for the current process. */ npxinit(__INITIAL_NPXCW__); #endif + + /* + * XXX - Linux emulator + * Make sure sure edx is 0x0 on entry. Linux binaries depend + * on it. + */ + p->p_retval[1] = 0; } static int