|
From: <sv...@va...> - 2005-05-02 10:28:48
|
Author: tom
Date: 2005-05-02 11:28:42 +0100 (Mon, 02 May 2005)
New Revision: 3591
Modified:
trunk/coregrind/amd64-linux/core_platform.c
trunk/coregrind/amd64/helpers.S
trunk/coregrind/core.h
Log:
Move the replacement code for the amd64 vsyscalls into the trampoline pag=
e
so that it is copied into the client space. This avoid warnings from memc=
heck
because it doesn't think that code inside valgrind is valid.
Modified: trunk/coregrind/amd64/helpers.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/amd64/helpers.S 2005-05-02 10:25:34 UTC (rev 3590)
+++ trunk/coregrind/amd64/helpers.S 2005-05-02 10:28:42 UTC (rev 3591)
@@ -46,6 +46,8 @@
.global VG_(trampoline_code_length)
.global VG_(tramp_rt_sigreturn_offset)
.global VG_(tramp_syscall_offset)
+.global VG_(tramp_gettimeofday_offset)
+.global VG_(tramp_time_offset)
=09
VG_(trampoline_code_start):
rt_sigreturn_start:
@@ -58,6 +60,18 @@
.align 16
syscall_start:
/* unused on amd64 */
+
+ .align 16
+gettimeofday_start:
+ movq $__NR_gettimeofday, %rax
+ syscall
+ ret
+
+ .align 16
+time_start:
+ movq $__NR_time, %rax
+ syscall
+ ret
tramp_code_end:
=09
.data
@@ -67,6 +81,10 @@
.long rt_sigreturn_start - VG_(trampoline_code_start)
VG_(tramp_syscall_offset):
.long syscall_start - VG_(trampoline_code_start)
+VG_(tramp_gettimeofday_offset):
+ .long gettimeofday_start - VG_(trampoline_code_start)
+VG_(tramp_time_offset):
+ .long time_start - VG_(trampoline_code_start)
.text
=20
=20
Modified: trunk/coregrind/amd64-linux/core_platform.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/amd64-linux/core_platform.c 2005-05-02 10:25:34 UTC (=
rev 3590)
+++ trunk/coregrind/amd64-linux/core_platform.c 2005-05-02 10:28:42 UTC (=
rev 3591)
@@ -1,28 +1,10 @@
#include "core.h"
=20
-/* Rerouted entry point for __NR_gettimeofday */
-static void amd64_linux_rerouted__vgettimeofday(void)
-{
-asm(
-" movq $96, %rax\n"
-" syscall\n"
-);
-}
-
-/* Rerouted entry point for __NR_time */
-static void amd64_linux_rerouted__vtime(void)
-{
-asm(
-" movq $201, %rax\n"
-" syscall\n"
-);
-}
-
void VGP_(setup_redirects)(void)
{
/* Redirect vsyscalls to local versions */
VG_(add_redirect_addr_to_addr)(0xFFFFFFFFFF600000ULL,
- (Addr)amd64_linux_rerouted__vgettimeof=
day);
+ VG_(client_trampoline_code)+VG_(tramp_=
gettimeofday_offset));
VG_(add_redirect_addr_to_addr)(0xFFFFFFFFFF600400ULL,
- (Addr)amd64_linux_rerouted__vtime);
+ VG_(client_trampoline_code)+VG_(tramp_=
time_offset));
}
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-05-02 10:25:34 UTC (rev 3590)
+++ trunk/coregrind/core.h 2005-05-02 10:28:42 UTC (rev 3591)
@@ -1509,6 +1509,8 @@
extern const Int VG_(tramp_sigreturn_offset);
extern const Int VG_(tramp_rt_sigreturn_offset);
extern const Int VG_(tramp_syscall_offset);
+extern const Int VG_(tramp_gettimeofday_offset);
+extern const Int VG_(tramp_time_offset);
=20
/* ---------------------------------------------------------------------
Things relating to the used tool
|