PERFORCE change 152254 for review

Peter Wemm peter at FreeBSD.org
Fri Oct 31 01:23:43 PDT 2008


http://perforce.freebsd.org/chv.cgi?CH=152254

Change 152254 by peter at peter_overcee on 2008/10/31 08:23:15

	Fix the !@^#!$@^!@# bug that I've been looking for over the last 5
	days.  Add 8 bytes of padding to fake the return address for syscalls
	that have memory args.
	
	Basic valgrind functionality on 64 bit!  (runs /bin/ls etc!)

Affected files ...

.. //depot/projects/valgrind/coregrind/m_syscall.c#8 edit

Differences ...

==== //depot/projects/valgrind/coregrind/m_syscall.c#8 (text+ko) ====

@@ -349,14 +349,15 @@
 "       movq    24(%rsp), %rcx\n" /* a8 from stack */
 "       pushq	%rcx\n"
 "       pushq	%r11\n"
+"	subq	$8,%rsp\n"	/* fake return addr */
 "	syscall\n"
 "	jb	1f\n"
-"	addq	$16,%rsp\n"
+"	addq	$24,%rsp\n"
 "	movq	40(%rsp),%rsi\n"
 "	movq	%rdx, (%rsi)\n"
 "	ret\n"
 "1:\n"
-"	addq	$16,%rsp\n"
+"	addq	$24,%rsp\n"
 "	movq	32(%rsp), %rsi\n"
 "	movl	$1,(%rsi)\n"
 "	ret\n"


More information about the p4-projects mailing list