]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Hook libpthread.so's .init section to start up Valgrind too.
authorJulian Seward <jseward@acm.org>
Fri, 10 May 2002 23:20:58 +0000 (23:20 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 10 May 2002 23:20:58 +0000 (23:20 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@262

coregrind/arch/x86-linux/vg_libpthread.c
coregrind/vg_libpthread.c
vg_libpthread.c

index df895171a3eec24b6bce74a5ffd0fc831a733b9e..5e6e14c61ca9232265676fc86a5070e556a6d9ec 100644 (file)
@@ -107,6 +107,13 @@ void ensure_valgrind ( char* caller )
    VG_(startup)();
 }
 
+/* While we're at it ... hook our own startup function into this
+   game. */
+__asm__ (
+   ".section .init\n"
+   "\tcall vgPlain_startup"
+);
+
 
 static
 __attribute__((noreturn))
@@ -703,9 +710,7 @@ int __pthread_atfork ( void (*prepare)(void),
 __attribute__((weak)) 
 void __pthread_initialize ( void )
 {
-   static int moans = N_MOANS;
-   if (moans-- > 0) 
-      ignored("__pthread_initialize");
+   ensure_valgrind("__pthread_initialize");
 }
 
 
index df895171a3eec24b6bce74a5ffd0fc831a733b9e..5e6e14c61ca9232265676fc86a5070e556a6d9ec 100644 (file)
@@ -107,6 +107,13 @@ void ensure_valgrind ( char* caller )
    VG_(startup)();
 }
 
+/* While we're at it ... hook our own startup function into this
+   game. */
+__asm__ (
+   ".section .init\n"
+   "\tcall vgPlain_startup"
+);
+
 
 static
 __attribute__((noreturn))
@@ -703,9 +710,7 @@ int __pthread_atfork ( void (*prepare)(void),
 __attribute__((weak)) 
 void __pthread_initialize ( void )
 {
-   static int moans = N_MOANS;
-   if (moans-- > 0) 
-      ignored("__pthread_initialize");
+   ensure_valgrind("__pthread_initialize");
 }
 
 
index df895171a3eec24b6bce74a5ffd0fc831a733b9e..5e6e14c61ca9232265676fc86a5070e556a6d9ec 100644 (file)
@@ -107,6 +107,13 @@ void ensure_valgrind ( char* caller )
    VG_(startup)();
 }
 
+/* While we're at it ... hook our own startup function into this
+   game. */
+__asm__ (
+   ".section .init\n"
+   "\tcall vgPlain_startup"
+);
+
 
 static
 __attribute__((noreturn))
@@ -703,9 +710,7 @@ int __pthread_atfork ( void (*prepare)(void),
 __attribute__((weak)) 
 void __pthread_initialize ( void )
 {
-   static int moans = N_MOANS;
-   if (moans-- > 0) 
-      ignored("__pthread_initialize");
+   ensure_valgrind("__pthread_initialize");
 }