Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2013 16:38:04 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r248727 - in user/dchagin/lemul/sys: amd64/linux32 i386/linux
Message-ID:  <201303261638.r2QGc4ID027708@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Tue Mar 26 16:38:03 2013
New Revision: 248727
URL: http://svnweb.freebsd.org/changeset/base/248727

Log:
  Calculate the %rip value rather than hard coding numbers.

Modified:
  user/dchagin/lemul/sys/amd64/linux32/linux32_locore.s
  user/dchagin/lemul/sys/i386/linux/linux_locore.s

Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_locore.s
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux32/linux32_locore.s	Tue Mar 26 14:36:11 2013	(r248726)
+++ user/dchagin/lemul/sys/amd64/linux32/linux32_locore.s	Tue Mar 26 16:38:03 2013	(r248727)
@@ -17,7 +17,7 @@ NON_GPROF_ENTRY(linux32_sigcode)
 	call .getip0
 .getip0:
 	popl	%eax
-	add	$11, %eax
+	add	$.startsigcode-.getip0, %eax	/* ret address */
 	push	%eax
 	jmp	*LINUX_SIGF_HANDLER(%ebx)
 .startsigcode:
@@ -34,7 +34,7 @@ NON_GPROF_ENTRY(linux32_rt_sigcode)
 	call	.getip1
 .getip1:
 	popl	%eax
-	add	$11, %eax
+	add	$.startrtsigcode-.getip1, %eax	/* ret address */
 	push	%eax
 	jmp	*LINUX_RT_SIGF_HANDLER(%edi)
 .startrtsigcode:

Modified: user/dchagin/lemul/sys/i386/linux/linux_locore.s
==============================================================================
--- user/dchagin/lemul/sys/i386/linux/linux_locore.s	Tue Mar 26 14:36:11 2013	(r248726)
+++ user/dchagin/lemul/sys/i386/linux/linux_locore.s	Tue Mar 26 16:38:03 2013	(r248727)
@@ -16,7 +16,7 @@ NON_GPROF_ENTRY(linux_sigcode)
 	call .getip0
 .getip0:
 	popl	%eax
-	add	$11, %eax
+	add	$.startsigcode-.getip0, %eax	/* ret address */
 	push	%eax
 	jmp	*LINUX_SIGF_HANDLER(%ebx)
 .startsigcode:
@@ -33,7 +33,7 @@ NON_GPROF_ENTRY(linux_rt_sigcode)
 	call	.getip1
 .getip1:
 	popl	%eax
-	add	$11, %eax
+	add	$.startrtsigcode-.getip1, %eax	/* ret address */
 	push	%eax
 	jmp	*LINUX_RT_SIGF_HANDLER(%edi)
 .startrtsigcode:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303261638.r2QGc4ID027708>