]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Back out yesterday's change to the symbol versioning in the pthread
authorTom Hughes <tom@compton.nu>
Sun, 15 Aug 2004 14:11:12 +0000 (14:11 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 15 Aug 2004 14:11:12 +0000 (14:11 +0000)
library - it seems that I misunderstood hom the versioning works and
a system looking for a GLIBC_PRIVATE version of the clock routines
would not find the GLIB_2.2.3 one even with the inheritance. It only
seemed to be working on glibc 2.3 systems because of the version
overrides in the source code, but it failed on glibc 2.2.5 systems.

The new approach is to explicity create two versions of the routines
in question, one with a version of GLIBC_2.2.3 and one with a version
of GLIBC_PRIVATE instead. This has been tested on six different systems
and appears to work everywhere.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2586

coregrind/vg_libpthread.vs
coregrind/vg_libpthread_unimp.c

index 4196b9a924ee6dbfca5e1b3fbb7622f665186c68..847f07d41a270c6b2184d2bc1bdd0881d3941eda 100644 (file)
   GLIBC_2.2.3 {
     # Extensions.
     pthread_getattr_np;
-    # These are in GLIBC_PRIVATE in the real library now but keep them 
-    # here for now for backwards compatibiltiy - they will still be
-    # visible to programs linked agianst newer libraries because of
-    # the inheritance into GLIB_PRIVATE in this library.
-    __pthread_clock_gettime; __pthread_clock_settime;
   } GLIBC_2.2;
 
   GLIBC_2.2.6 {
   } GLIBC_2.3.2;
 
   GLIBC_PRIVATE {
-    __pthread_initialize_minimal; __pthread_cleanup_upto;
-    __pthread_unwind;
-  } GLIBC_2.3.3;
+    global:
+      __pthread_initialize_minimal; __pthread_cleanup_upto;
+      __pthread_clock_gettime; __pthread_clock_settime;
+      __pthread_unwind;
+    local:
+      __pthread_clock_gettime_*; __pthread_clock_settime_*;
+  };
index 0b1e2425f29221664bb290cb33f0282a44af903f..805563063ea542f3a0cf7d00a3c827aa16818944 100644 (file)
    Give a binding for everything the real libpthread.so binds.
    ------------------------------------------------------------------ */
 
-#include "vg_include.h"  /* For GLIBC_2_3, or not, as the case may be */
+# define strong_alias(name, aliasname) \
+  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+
+# define weak_alias(name, aliasname) \
+  extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
+
+# define symbol_version(real, name, version) \
+  __asm__(".symver " #real "," #name "@" #version)
+
+# define default_symbol_version(real, name, version) \
+  __asm__(".symver " #real "," #name "@@" #version)
 
 extern void vgPlain_unimp ( char* );
 #define unimp(str) vgPlain_unimp(str)
@@ -163,48 +173,16 @@ void sem_unlink ( void )  { unimp("sem_unlink"); }
 //void siglongjmp ( void )  { unimp("siglongjmp"); }
 //void sigwait ( void )  { unimp("sigwait"); }
 
-void __pthread_clock_gettime ( void ) { unimp("__pthread_clock_gettime"); }
-void __pthread_clock_settime ( void ) { unimp("__pthread_clock_settime"); }
-#ifdef GLIBC_2_3
-/* Needed for Red Hat 8.0 */
-__asm__(".symver __pthread_clock_gettime,"
-        "__pthread_clock_gettime@GLIBC_PRIVATE");
-__asm__(".symver __pthread_clock_settime,"
-        "__pthread_clock_settime@GLIBC_PRIVATE");
-#endif
-
-
-#if 0
-void pthread_create@@GLIBC_2.1 ( void )  { unimp("pthread_create@@GLIBC_2.1"); }
-void pthread_create@GLIBC_2.0 ( void )  { unimp("pthread_create@GLIBC_2.0"); }
-
-void sem_wait@@GLIBC_2.1 ( void )  { unimp("sem_wait@@GLIBC_2.1"); }
-void sem_wait@GLIBC_2.0 ( void )  { unimp("sem_wait@GLIBC_2.0"); }
+void __pthread_clock_gettime_private ( void ) { unimp("__pthread_clock_gettime"); }
+void __pthread_clock_settime_private ( void ) { unimp("__pthread_clock_settime"); }
+strong_alias(__pthread_clock_gettime_private, __pthread_clock_gettime_223);
+strong_alias(__pthread_clock_settime_private, __pthread_clock_settime_223);
+symbol_version(__pthread_clock_gettime_223, __pthread_clock_gettime, GLIBC_2.2.3);
+symbol_version(__pthread_clock_settime_223, __pthread_clock_settime, GLIBC_2.2.3);
+default_symbol_version(__pthread_clock_gettime_private, __pthread_clock_gettime, GLIBC_PRIVATE);
+default_symbol_version(__pthread_clock_settime_private, __pthread_clock_settime, GLIBC_PRIVATE);
 
-void sem_trywait@@GLIBC_2.1 ( void )  { unimp("sem_trywait@@GLIBC_2.1"); }
-void sem_trywait@GLIBC_2.0 ( void )  { unimp("sem_trywait@GLIBC_2.0"); }
 
-void sem_post@@GLIBC_2.1 ( void )  { unimp("sem_post@@GLIBC_2.1"); }
-void sem_post@GLIBC_2.0 ( void )  { unimp("sem_post@GLIBC_2.0"); }
-
-void sem_destroy@@GLIBC_2.1 ( void )  { unimp("sem_destroy@@GLIBC_2.1"); }
-void sem_destroy@GLIBC_2.0 ( void )  { unimp("sem_destroy@GLIBC_2.0"); }
-void sem_getvalue@@GLIBC_2.1 ( void )  { unimp("sem_getvalue@@GLIBC_2.1"); }
-void sem_getvalue@GLIBC_2.0 ( void )  { unimp("sem_getvalue@GLIBC_2.0"); }
-void sem_init@@GLIBC_2.1 ( void )  { unimp("sem_init@@GLIBC_2.1"); }
-void sem_init@GLIBC_2.0 ( void )  { unimp("sem_init@GLIBC_2.0"); }
-
-void pthread_attr_init@@GLIBC_2.1 ( void )  { unimp("pthread_attr_init@@GLIBC_2.1"); }
-void pthread_attr_init@GLIBC_2.0 ( void )  { unimp("pthread_attr_init@GLIBC_2.0"); }
-#endif
-
-
-
-# define strong_alias(name, aliasname) \
-  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
-
-# define weak_alias(name, aliasname) \
-  extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
 
 //weak_alias(pthread_rwlock_destroy, __pthread_rwlock_destroy)
 //weak_alias(pthread_rwlock_init, __pthread_rwlock_init)