|
From: <sv...@va...> - 2005-04-01 18:58:30
|
Author: tom
Date: 2005-04-01 19:58:09 +0100 (Fri, 01 Apr 2005)
New Revision: 3495
Modified:
trunk/coregrind/vg_redir.c
Log:
Rework the vsyscall redirections to work in pie code - the old form
seemed to completely confuse the compiler and it was generating
nonsense code to get the address of the replacement routines.
Modified: trunk/coregrind/vg_redir.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/vg_redir.c 2005-04-01 08:07:54 UTC (rev 3494)
+++ trunk/coregrind/vg_redir.c 2005-04-01 18:58:09 UTC (rev 3495)
@@ -377,16 +377,21 @@
96 =3D=3D __NR_gettimeofday
201 =3D=3D __NR_time
*/
+static void amd64_linux_rerouted__vgettimeofday(void)
+{
asm(
-"amd64_linux_rerouted__vgettimeofday:\n"
" movq $96, %rax\n"
" syscall\n"
-" ret\n"
-"amd64_linux_rerouted__vtime:\n"
+);
+}
+
+static void amd64_linux_rerouted__vtime(void)
+{
+asm(
" movq $201, %rax\n"
" syscall\n"
-" ret\n"
);
+}
#endif
=20
/* If address 'a' is being redirected, return the redirected-to
@@ -399,12 +404,10 @@
/* HACK. Reroute the amd64-linux vsyscalls. This should be moved
out of here into an amd64-linux specific initialisation routine.
*/
- extern void amd64_linux_rerouted__vgettimeofday;
- extern void amd64_linux_rerouted__vtime;
if (a =3D=3D 0xFFFFFFFFFF600000ULL)
- return (Addr)&amd64_linux_rerouted__vgettimeofday;
+ return (Addr)amd64_linux_rerouted__vgettimeofday;
if (a =3D=3D 0xFFFFFFFFFF600400ULL)
- return (Addr)&amd64_linux_rerouted__vtime;
+ return (Addr)amd64_linux_rerouted__vtime;
#endif
=20
r =3D VG_(SkipList_Find_Exact)(&sk_resolved_redir, &a);
|