2004-06-22 Roland McGrath <roland@redhat.com>

* syscall.c (syscall_fixup) [LINUX && X86_64]: For 32-bit process,
	sign extend the low 32 bits of RAX to 64 bits.
	* syscall.c (force_result): [LINUX && X86_64]: Fix RAX*4 -> RAX*8.
This commit is contained in:
Roland McGrath 2004-06-23 01:40:45 +00:00
parent 66a77f1aaf
commit 998fac7049

View File

@ -1296,6 +1296,8 @@ struct tcb *tcp;
#elif defined (X86_64)
if (upeek(pid, 8*RAX, &rax) < 0)
return -1;
if (current_personality == 1)
rax = (long int)(int)rax; /* sign extend from 32 bits */
if (rax != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) {
if (debug)
fprintf(stderr, "stray syscall exit: rax = %ld\n", rax);
@ -1615,7 +1617,7 @@ force_result(tcp, error, rval)
#else /* !I386 */
#ifdef X86_64
rax = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(RAX * 4), rax) < 0)
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(RAX * 8), rax) < 0)
return -1;
#else
#ifdef IA64