svn commit: r203215 - projects/ppc64/sys/powerpc/powerpc
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Sat Jan 30 18:50:57 UTC 2010
Author: nwhitehorn
Date: Sat Jan 30 18:50:57 2010
New Revision: 203215
URL: http://svn.freebsd.org/changeset/base/203215
Log:
Really fix setting argc. This problem should be properly fixed in
kern_exec.c, which incorrectly uses suword() instead of suword32() to set
nargvstr, but I am afraid of breaking sparc64. This should be revisited
before merging.
With this change, all statically linked binaries appear to be working
correctly -- I can even compile things with gcc!
Discussed with: Patrick Kerharo
Modified:
projects/ppc64/sys/powerpc/powerpc/exec_machdep.c
Modified: projects/ppc64/sys/powerpc/powerpc/exec_machdep.c
==============================================================================
--- projects/ppc64/sys/powerpc/powerpc/exec_machdep.c Sat Jan 30 18:45:10 2010 (r203214)
+++ projects/ppc64/sys/powerpc/powerpc/exec_machdep.c Sat Jan 30 18:50:57 2010 (r203215)
@@ -524,7 +524,7 @@ exec_setregs(struct thread *td, u_long e
* Emulate by setting the syscall return value cells. The
* registers still have to be set for init's fork trampoline.
*/
- td->td_retval[0] = arginfo.ps_nargvstr;
+ td->td_retval[0] = *((register_t *)(&arginfo.ps_nargvstr));
td->td_retval[1] = (register_t)arginfo.ps_argvstr;
tf->fixreg[3] = *((register_t *)(&arginfo.ps_nargvstr));
tf->fixreg[4] = (register_t)arginfo.ps_argvstr;
More information about the svn-src-projects
mailing list