DRD: don't inline pthread intercepts because in combination with the current fragile implementation of the CALL_FN_* macros inlining intercepts can easily trigger stack alignment errors on Darwin.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11536 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c
index 44da42d..ac0b8f7 100644
--- a/drd/drd_pthread_intercepts.c
+++ b/drd/drd_pthread_intercepts.c
@@ -105,10 +105,8 @@
    PTH_FUNC(ret_ty, zf ## ZDZa, implf, argl_decl, argl);
 
 /*
- * Not inlining one of the intercept functions will cause the regression
- * tests to fail because this would cause an additional stackfram to appear
- * in the output. The __always_inline macro guarantees that inlining will
- * happen, even when compiling with optimization disabled.
+ * Macros for controlling inlining explicitly such that call stacks in
+ * regression tests do not depend on compiler optimization options.
  */
 #undef __always_inline /* since already defined in <cdefs.h> */
 #if __GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 2
@@ -116,6 +114,11 @@
 #else
 #define __always_inline __inline__
 #endif
+#if __GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 2
+#define __never_inline __attribute__((noinline))
+#else
+#define __never_inline
+#endif
 
 /* Local data structures. */
 
@@ -368,7 +371,7 @@
  * glibc-2.9/nptl/pthread_create.c.
  */
 
-static __always_inline
+static __never_inline
 int pthread_create_intercept(pthread_t* thread, const pthread_attr_t* attr,
                              void* (*start)(void*), void* arg)
 {
@@ -448,7 +451,7 @@
            void *(*start) (void *), void *arg),
           (thread, attr, start, arg));
 
-static __always_inline
+static __never_inline
 int pthread_join_intercept(pthread_t pt_joinee, void **thread_return)
 {
    int      ret;
@@ -469,7 +472,7 @@
           (pthread_t pt_joinee, void **thread_return),
           (pt_joinee, thread_return));
 
-static __always_inline
+static __never_inline
 int pthread_detach_intercept(pthread_t pt_thread)
 {
    int ret;
@@ -491,7 +494,7 @@
 // NOTE: be careful to intercept only pthread_cancel() and not
 // pthread_cancel_init() on Linux.
 
-static __always_inline
+static __never_inline
 int pthread_cancel_intercept(pthread_t pt_thread)
 {
    int res;
@@ -509,7 +512,7 @@
 PTH_FUNCS(int, pthreadZucancel, pthread_cancel_intercept,
           (pthread_t thread), (thread))
 
-static __always_inline
+static __never_inline
 int pthread_once_intercept(pthread_once_t *once_control,
                            void (*init_routine)(void))
 {
@@ -531,7 +534,7 @@
           (pthread_once_t *once_control, void (*init_routine)(void)),
           (once_control, init_routine));
 
-static __always_inline
+static __never_inline
 int pthread_mutex_init_intercept(pthread_mutex_t *mutex,
                                  const pthread_mutexattr_t* attr)
 {
@@ -556,7 +559,7 @@
           (pthread_mutex_t *mutex, const pthread_mutexattr_t* attr),
           (mutex, attr));
 
-static __always_inline
+static __never_inline
 int pthread_mutex_destroy_intercept(pthread_mutex_t* mutex)
 {
    int ret;
@@ -574,7 +577,7 @@
 PTH_FUNCS(int, pthreadZumutexZudestroy, pthread_mutex_destroy_intercept,
           (pthread_mutex_t *mutex), (mutex));
 
-static __always_inline
+static __never_inline
 int pthread_mutex_lock_intercept(pthread_mutex_t* mutex)
 {
    int   ret;
@@ -592,7 +595,7 @@
 PTH_FUNCS(int, pthreadZumutexZulock, pthread_mutex_lock_intercept,
           (pthread_mutex_t *mutex), (mutex));
 
-static __always_inline
+static __never_inline
 int pthread_mutex_trylock_intercept(pthread_mutex_t* mutex)
 {
    int   ret;
@@ -610,7 +613,7 @@
 PTH_FUNCS(int, pthreadZumutexZutrylock, pthread_mutex_trylock_intercept,
           (pthread_mutex_t *mutex), (mutex));
 
-static __always_inline
+static __never_inline
 int pthread_mutex_timedlock_intercept(pthread_mutex_t *mutex,
                                       const struct timespec *abs_timeout)
 {
@@ -630,7 +633,7 @@
           (pthread_mutex_t *mutex, const struct timespec *abs_timeout),
           (mutex, abs_timeout));
 
-static __always_inline
+static __never_inline
 int pthread_mutex_unlock_intercept(pthread_mutex_t *mutex)
 {
    int ret;
@@ -650,7 +653,7 @@
 PTH_FUNCS(int, pthreadZumutexZuunlock, pthread_mutex_unlock_intercept,
           (pthread_mutex_t *mutex), (mutex));
 
-static __always_inline
+static __never_inline
 int pthread_cond_init_intercept(pthread_cond_t* cond,
                                 const pthread_condattr_t* attr)
 {
@@ -670,7 +673,7 @@
           (pthread_cond_t* cond, const pthread_condattr_t* attr),
           (cond, attr));
 
-static __always_inline
+static __never_inline
 int pthread_cond_destroy_intercept(pthread_cond_t* cond)
 {
    int ret;
@@ -688,7 +691,7 @@
 PTH_FUNCS(int, pthreadZucondZudestroy, pthread_cond_destroy_intercept,
           (pthread_cond_t* cond), (cond));
 
-static __always_inline
+static __never_inline
 int pthread_cond_wait_intercept(pthread_cond_t *cond, pthread_mutex_t *mutex)
 {
    int   ret;
@@ -707,7 +710,7 @@
           (pthread_cond_t *cond, pthread_mutex_t *mutex),
           (cond, mutex));
 
-static __always_inline
+static __never_inline
 int pthread_cond_timedwait_intercept(pthread_cond_t *cond,
                                      pthread_mutex_t *mutex,
                                      const struct timespec* abstime)
@@ -735,7 +738,7 @@
 // argument to be passed to pthread_cond_signal_np() and hence will cause this
 // last function to crash.
 
-static __always_inline
+static __never_inline
 int pthread_cond_signal_intercept(pthread_cond_t* cond)
 {
    int   ret;
@@ -753,7 +756,7 @@
 PTH_FUNCS(int, pthreadZucondZusignal, pthread_cond_signal_intercept,
           (pthread_cond_t* cond), (cond));
 
-static __always_inline
+static __never_inline
 int pthread_cond_broadcast_intercept(pthread_cond_t* cond)
 {
    int   ret;
@@ -772,7 +775,7 @@
           (pthread_cond_t* cond), (cond));
 
 #if defined(HAVE_PTHREAD_SPIN_LOCK)
-static __always_inline
+static __never_inline
 int pthread_spin_init_intercept(pthread_spinlock_t *spinlock, int pshared)
 {
    int ret;
@@ -790,7 +793,7 @@
 PTH_FUNCS(int, pthreadZuspinZuinit, pthread_spin_init_intercept,
           (pthread_spinlock_t *spinlock, int pshared), (spinlock, pshared));
 
-static __always_inline
+static __never_inline
 int pthread_spin_destroy_intercept(pthread_spinlock_t *spinlock)
 {
    int ret;
@@ -808,7 +811,7 @@
 PTH_FUNCS(int, pthreadZuspinZudestroy, pthread_spin_destroy_intercept,
           (pthread_spinlock_t *spinlock), (spinlock));
 
-static __always_inline
+static __never_inline
 int pthread_spin_lock_intercept(pthread_spinlock_t *spinlock)
 {
    int   ret;
@@ -826,7 +829,7 @@
 PTH_FUNCS(int, pthreadZuspinZulock, pthread_spin_lock_intercept,
           (pthread_spinlock_t *spinlock), (spinlock));
 
-static __always_inline
+static __never_inline
 int pthread_spin_trylock_intercept(pthread_spinlock_t *spinlock)
 {
    int   ret;
@@ -844,7 +847,7 @@
 PTH_FUNCS(int, pthreadZuspinZutrylock, pthread_spin_trylock_intercept,
           (pthread_spinlock_t *spinlock), (spinlock));
 
-static __always_inline
+static __never_inline
 int pthread_spin_unlock_intercept(pthread_spinlock_t *spinlock)
 {
    int   ret;
@@ -865,7 +868,7 @@
 
 
 #if defined(HAVE_PTHREAD_BARRIER_INIT)
-static __always_inline
+static __never_inline
 int pthread_barrier_init_intercept(pthread_barrier_t* barrier,
                                    const pthread_barrierattr_t* attr,
                                    unsigned count)
@@ -886,7 +889,7 @@
           (pthread_barrier_t* barrier, const pthread_barrierattr_t* attr,
            unsigned count), (barrier, attr, count));
 
-static __always_inline
+static __never_inline
 int pthread_barrier_destroy_intercept(pthread_barrier_t* barrier)
 {
    int   ret;
@@ -904,7 +907,7 @@
 PTH_FUNCS(int, pthreadZubarrierZudestroy, pthread_barrier_destroy_intercept,
           (pthread_barrier_t* barrier), (barrier));
 
-static __always_inline
+static __never_inline
 int pthread_barrier_wait_intercept(pthread_barrier_t* barrier)
 {
    int   ret;
@@ -926,7 +929,7 @@
 #endif   // HAVE_PTHREAD_BARRIER_INIT
 
 
-static __always_inline
+static __never_inline
 int sem_init_intercept(sem_t *sem, int pshared, unsigned int value)
 {
    int   ret;
@@ -944,7 +947,7 @@
 PTH_FUNCS(int, semZuinit, sem_init_intercept,
           (sem_t *sem, int pshared, unsigned int value), (sem, pshared, value));
 
-static __always_inline
+static __never_inline
 int sem_destroy_intercept(sem_t *sem)
 {
    int   ret;
@@ -961,7 +964,7 @@
 
 PTH_FUNCS(int, semZudestroy, sem_destroy_intercept, (sem_t *sem), (sem));
 
-static __always_inline
+static __never_inline
 sem_t* sem_open_intercept(const char *name, int oflag, mode_t mode,
                           unsigned int value)
 {
@@ -982,7 +985,7 @@
           (const char *name, int oflag, mode_t mode, unsigned int value),
           (name, oflag, mode, value));
 
-static __always_inline int sem_close_intercept(sem_t *sem)
+static __never_inline int sem_close_intercept(sem_t *sem)
 {
    int   ret;
    int   res;
@@ -998,7 +1001,7 @@
 
 PTH_FUNCS(int, semZuclose, sem_close_intercept, (sem_t *sem), (sem));
 
-static __always_inline int sem_wait_intercept(sem_t *sem)
+static __never_inline int sem_wait_intercept(sem_t *sem)
 {
    int   ret;
    int   res;
@@ -1014,7 +1017,7 @@
 
 PTH_FUNCS(int, semZuwait, sem_wait_intercept, (sem_t *sem), (sem));
 
-static __always_inline int sem_trywait_intercept(sem_t *sem)
+static __never_inline int sem_trywait_intercept(sem_t *sem)
 {
    int   ret;
    int   res;
@@ -1030,7 +1033,7 @@
 
 PTH_FUNCS(int, semZutrywait, sem_trywait_intercept, (sem_t *sem), (sem));
 
-static __always_inline
+static __never_inline
 int sem_timedwait_intercept(sem_t *sem, const struct timespec *abs_timeout)
 {
    int   ret;
@@ -1049,7 +1052,7 @@
           (sem_t *sem, const struct timespec *abs_timeout),
           (sem, abs_timeout));
 
-static __always_inline int sem_post_intercept(sem_t *sem)
+static __never_inline int sem_post_intercept(sem_t *sem)
 {
    int   ret;
    int   res;
@@ -1065,7 +1068,7 @@
 
 PTH_FUNCS(int, semZupost, sem_post_intercept, (sem_t *sem), (sem));
 
-static __always_inline
+static __never_inline
 int pthread_rwlock_init_intercept(pthread_rwlock_t* rwlock,
                                   const pthread_rwlockattr_t* attr)
 {
@@ -1084,7 +1087,7 @@
           (pthread_rwlock_t* rwlock, const pthread_rwlockattr_t* attr),
           (rwlock, attr));
 
-static __always_inline
+static __never_inline
 int pthread_rwlock_destroy_intercept(pthread_rwlock_t* rwlock)
 {
    int   ret;
@@ -1101,7 +1104,7 @@
           pthreadZurwlockZudestroy, pthread_rwlock_destroy_intercept,
           (pthread_rwlock_t* rwlock), (rwlock));
 
-static __always_inline
+static __never_inline
 int pthread_rwlock_rdlock_intercept(pthread_rwlock_t* rwlock)
 {
    int   ret;
@@ -1120,7 +1123,7 @@
           pthreadZurwlockZurdlock, pthread_rwlock_rdlock_intercept,
           (pthread_rwlock_t* rwlock), (rwlock));
 
-static __always_inline
+static __never_inline
 int pthread_rwlock_wrlock_intercept(pthread_rwlock_t* rwlock)
 {
    int   ret;
@@ -1139,7 +1142,7 @@
           pthreadZurwlockZuwrlock, pthread_rwlock_wrlock_intercept,
           (pthread_rwlock_t* rwlock), (rwlock));
 
-static __always_inline
+static __never_inline
 int pthread_rwlock_timedrdlock_intercept(pthread_rwlock_t* rwlock)
 {
    int   ret;
@@ -1158,7 +1161,7 @@
           pthreadZurwlockZutimedrdlock, pthread_rwlock_timedrdlock_intercept,
           (pthread_rwlock_t* rwlock), (rwlock));
 
-static __always_inline
+static __never_inline
 int pthread_rwlock_timedwrlock_intercept(pthread_rwlock_t* rwlock)
 {
    int   ret;
@@ -1177,7 +1180,7 @@
           pthreadZurwlockZutimedwrlock, pthread_rwlock_timedwrlock_intercept,
           (pthread_rwlock_t* rwlock), (rwlock));
 
-static __always_inline
+static __never_inline
 int pthread_rwlock_tryrdlock_intercept(pthread_rwlock_t* rwlock)
 {
    int   ret;
@@ -1196,7 +1199,7 @@
           pthreadZurwlockZutryrdlock, pthread_rwlock_tryrdlock_intercept,
           (pthread_rwlock_t* rwlock), (rwlock));
 
-static __always_inline
+static __never_inline
 int pthread_rwlock_trywrlock_intercept(pthread_rwlock_t* rwlock)
 {
    int   ret;
@@ -1215,7 +1218,7 @@
           pthreadZurwlockZutrywrlock, pthread_rwlock_trywrlock_intercept,
           (pthread_rwlock_t* rwlock), (rwlock));
 
-static __always_inline
+static __never_inline
 int pthread_rwlock_unlock_intercept(pthread_rwlock_t* rwlock)
 {
    int   ret;
diff --git a/drd/tests/annotate_hb_err.stderr.exp b/drd/tests/annotate_hb_err.stderr.exp
index b52069b..197021a 100644
--- a/drd/tests/annotate_hb_err.stderr.exp
+++ b/drd/tests/annotate_hb_err.stderr.exp
@@ -3,18 +3,18 @@
    at 0x........: U_AnnotateHappensBefore (unified_annotations.h:?)
    by 0x........: main (annotate_hb_err.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (annotate_hb_err.c:?)
 
 wrong type of synchronization object
    at 0x........: U_AnnotateHappensBefore (unified_annotations.h:?)
    by 0x........: main (annotate_hb_err.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (annotate_hb_err.c:?)
 
 wrong type of synchronization object
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (annotate_hb_err.c:?)
 order annotation 0x........ was first observed at:
    at 0x........: U_AnnotateHappensAfter (unified_annotations.h:?)
diff --git a/drd/tests/bar_bad.stderr.exp b/drd/tests/bar_bad.stderr.exp
index 75f121f..d9b35b1 100644
--- a/drd/tests/bar_bad.stderr.exp
+++ b/drd/tests/bar_bad.stderr.exp
@@ -2,47 +2,47 @@
 
 initialise a barrier with zero count
 pthread_barrier_init: 'count' argument is zero: barrier 0x........
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (bar_bad.c:?)
 
 
 initialise a barrier twice
 Barrier reinitialization: barrier 0x........
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (bar_bad.c:?)
 barrier 0x........ was first observed at:
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (bar_bad.c:?)
 
 
 initialise a barrier which has threads waiting on it
 Barrier reinitialization: barrier 0x........
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (bar_bad.c:?)
 barrier 0x........ was first observed at:
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (bar_bad.c:?)
 
 
 destroy a barrier that has waiting threads
 Destruction of a barrier with active waiters: barrier 0x........
-   at 0x........: pthread_barrier_destroy (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_destroy_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (bar_bad.c:?)
 barrier 0x........ was first observed at:
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (bar_bad.c:?)
 
 
 destroy a barrier that was never initialised
 Not a barrier
-   at 0x........: pthread_barrier_destroy (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_destroy_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (bar_bad.c:?)
 
 Destruction of barrier that is being waited upon: barrier 0x........
    at 0x........: free (vg_replace_malloc.c:...)
    by 0x........: main (bar_bad.c:?)
 barrier 0x........ was first observed at:
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (bar_bad.c:?)
 
 
diff --git a/drd/tests/hold_lock_1.stderr.exp b/drd/tests/hold_lock_1.stderr.exp
index 1732197..54b7168 100644
--- a/drd/tests/hold_lock_1.stderr.exp
+++ b/drd/tests/hold_lock_1.stderr.exp
@@ -1,24 +1,24 @@
 
 Locking mutex ...
 Acquired at:
-   at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_lock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (hold_lock.c:?)
 Lock on mutex 0x........ was held during ... ms (threshold: 500 ms).
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (hold_lock.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (hold_lock.c:?)
 
 Locking rwlock exclusively ...
 Acquired at:
-   at 0x........: pthread_rwlock_wrlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_wrlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (hold_lock.c:?)
 Lock on rwlock 0x........ was held during ... ms (threshold: 500 ms).
-   at 0x........: pthread_rwlock_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (hold_lock.c:?)
 rwlock 0x........ was first observed at:
-   at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (hold_lock.c:?)
 
 Locking rwlock shared ...
diff --git a/drd/tests/hold_lock_2.stderr.exp b/drd/tests/hold_lock_2.stderr.exp
index 81e355c..b699e12 100644
--- a/drd/tests/hold_lock_2.stderr.exp
+++ b/drd/tests/hold_lock_2.stderr.exp
@@ -3,13 +3,13 @@
 Locking rwlock exclusively ...
 Locking rwlock shared ...
 Acquired at:
-   at 0x........: pthread_rwlock_rdlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_rdlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (hold_lock.c:?)
 Lock on rwlock 0x........ was held during ... ms (threshold: 500 ms).
-   at 0x........: pthread_rwlock_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (hold_lock.c:?)
 rwlock 0x........ was first observed at:
-   at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (hold_lock.c:?)
 
 Done.
diff --git a/drd/tests/pth_barrier_race.stderr.exp b/drd/tests/pth_barrier_race.stderr.exp
index 15b69ba..99f92d8 100644
--- a/drd/tests/pth_barrier_race.stderr.exp
+++ b/drd/tests/pth_barrier_race.stderr.exp
@@ -1,13 +1,13 @@
 
 Destruction of barrier not synchronized with barrier wait call: barrier 0x........
-   at 0x........: pthread_barrier_destroy (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_destroy_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_barrier_race.c:?)
 Conflicting wait call by thread 2:
-   at 0x........: pthread_barrier_wait (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_wait_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread (pth_barrier_race.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 barrier 0x........ was first observed at:
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_barrier_race.c:?)
 
 
diff --git a/drd/tests/pth_barrier_reinit.stderr.exp b/drd/tests/pth_barrier_reinit.stderr.exp
index 36dcd50..9103a88 100644
--- a/drd/tests/pth_barrier_reinit.stderr.exp
+++ b/drd/tests/pth_barrier_reinit.stderr.exp
@@ -1,9 +1,9 @@
 
 Barrier reinitialization: barrier 0x........
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_barrier_reinit.c:?)
 barrier 0x........ was first observed at:
-   at 0x........: pthread_barrier_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_barrier_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_barrier_reinit.c:?)
 
 
diff --git a/drd/tests/pth_cancel_locked.stderr.exp b/drd/tests/pth_cancel_locked.stderr.exp
index e00753e..fa9637c 100644
--- a/drd/tests/pth_cancel_locked.stderr.exp
+++ b/drd/tests/pth_cancel_locked.stderr.exp
@@ -1,9 +1,9 @@
 
 Mutex still locked at thread exit: mutex 0x........, recursion count 1, owner 2.
-   at 0x........: pthread_join (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_join_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_cancel_locked.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_cancel_locked.c:?)
 
 Test finished.
diff --git a/drd/tests/pth_cancel_locked.stderr.exp-darwin b/drd/tests/pth_cancel_locked.stderr.exp-darwin
index 00a2f8f..e45c9b9 100644
--- a/drd/tests/pth_cancel_locked.stderr.exp-darwin
+++ b/drd/tests/pth_cancel_locked.stderr.exp-darwin
@@ -1,9 +1,9 @@
 
 Mutex still locked at thread exit: mutex 0x........, recursion count 1, owner 2.
-   at 0x........: pthread_join (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_join_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_cancel_locked.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_cancel_locked.c:?)
 
 Mutex still locked at thread exit: mutex 0x........, recursion count 1, owner 2.
diff --git a/drd/tests/pth_cond_race.stderr.exp b/drd/tests/pth_cond_race.stderr.exp
index 4c73f5f..e46da2c 100644
--- a/drd/tests/pth_cond_race.stderr.exp
+++ b/drd/tests/pth_cond_race.stderr.exp
@@ -1,14 +1,14 @@
 
 Thread 2:
 Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (pth_cond_race.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_cond_race.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_cond_race.c:?)
 
 
diff --git a/drd/tests/pth_inconsistent_cond_wait.stderr.exp1 b/drd/tests/pth_inconsistent_cond_wait.stderr.exp1
index ef294c3..8f6cabc 100644
--- a/drd/tests/pth_inconsistent_cond_wait.stderr.exp1
+++ b/drd/tests/pth_inconsistent_cond_wait.stderr.exp1
@@ -1,38 +1,38 @@
 
 Thread 3:
 Inconsistent association of condition variable and mutex: condition variable 0x........, mutexes 0x........ and 0x........
-   at 0x........: pthread_cond_timedwait (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_timedwait_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (pth_inconsistent_cond_wait.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 
 Thread 1:
 Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 
 Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 
 
diff --git a/drd/tests/pth_inconsistent_cond_wait.stderr.exp2 b/drd/tests/pth_inconsistent_cond_wait.stderr.exp2
index ad24a27..7dd5713 100644
--- a/drd/tests/pth_inconsistent_cond_wait.stderr.exp2
+++ b/drd/tests/pth_inconsistent_cond_wait.stderr.exp2
@@ -1,38 +1,38 @@
 
 Thread 2:
 Inconsistent association of condition variable and mutex: condition variable 0x........, mutexes 0x........ and 0x........
-   at 0x........: pthread_cond_timedwait (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_timedwait_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (pth_inconsistent_cond_wait.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 
 Thread 1:
 Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 
 Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_inconsistent_cond_wait.c:?)
 
 
diff --git a/drd/tests/pth_mutex_reinit.stderr.exp b/drd/tests/pth_mutex_reinit.stderr.exp
index 9307666..dcd38be 100644
--- a/drd/tests/pth_mutex_reinit.stderr.exp
+++ b/drd/tests/pth_mutex_reinit.stderr.exp
@@ -1,9 +1,9 @@
 
 Mutex reinitialization: mutex 0x........, recursion count 0, owner 1.
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_mutex_reinit.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_mutex_reinit.c:?)
 
 Done.
diff --git a/drd/tests/pth_uninitialized_cond.stderr.exp b/drd/tests/pth_uninitialized_cond.stderr.exp
index a693944..d94ef2b 100644
--- a/drd/tests/pth_uninitialized_cond.stderr.exp
+++ b/drd/tests/pth_uninitialized_cond.stderr.exp
@@ -2,7 +2,7 @@
 Statically initialized condition variable.
 Uninitialized condition variable.
 condition variable has not been initialized: cond 0x........
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_uninitialized_cond.c:?)
 
 Done.
diff --git a/drd/tests/recursive_mutex.stderr.exp-darwin b/drd/tests/recursive_mutex.stderr.exp-darwin
index 04a1839..75bccbc 100644
--- a/drd/tests/recursive_mutex.stderr.exp-darwin
+++ b/drd/tests/recursive_mutex.stderr.exp-darwin
@@ -3,11 +3,11 @@
 Non-recursive mutex.
 second lock call failed !
 Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: lock_twice (recursive_mutex.c:?)
    by 0x........: main (recursive_mutex.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_trylock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_trylock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: lock_twice (recursive_mutex.c:?)
    by 0x........: main (recursive_mutex.c:?)
 
diff --git a/drd/tests/recursive_mutex.stderr.exp-linux b/drd/tests/recursive_mutex.stderr.exp-linux
index efa983a..7505521 100644
--- a/drd/tests/recursive_mutex.stderr.exp-linux
+++ b/drd/tests/recursive_mutex.stderr.exp-linux
@@ -6,11 +6,11 @@
 Error checking mutex.
 second lock call failed !
 Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: lock_twice (recursive_mutex.c:?)
    by 0x........: main (recursive_mutex.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (recursive_mutex.c:?)
 
 second unlock call failed !
@@ -18,11 +18,11 @@
 Non-recursive mutex.
 second lock call failed !
 Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: lock_twice (recursive_mutex.c:?)
    by 0x........: main (recursive_mutex.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_trylock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_trylock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: lock_twice (recursive_mutex.c:?)
    by 0x........: main (recursive_mutex.c:?)
 
diff --git a/drd/tests/rwlock_type_checking.stderr.exp b/drd/tests/rwlock_type_checking.stderr.exp
index b3d2dc9..96cc4c0 100644
--- a/drd/tests/rwlock_type_checking.stderr.exp
+++ b/drd/tests/rwlock_type_checking.stderr.exp
@@ -1,6 +1,6 @@
 
 Attempt to use a user-defined rwlock as a POSIX rwlock: rwlock 0x.........
-   at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (rwlock_type_checking.c:?)
 rwlock 0x........ was first observed at:
    at 0x........: main (rwlock_type_checking.c:?)
@@ -8,7 +8,7 @@
 Attempt to use a POSIX rwlock as a user-defined rwlock: rwlock 0x.........
    at 0x........: main (rwlock_type_checking.c:?)
 rwlock 0x........ was first observed at:
-   at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (rwlock_type_checking.c:?)
 
 Finished.
diff --git a/drd/tests/tc04_free_lock.stderr.exp b/drd/tests/tc04_free_lock.stderr.exp
index 8208334..068c26a 100644
--- a/drd/tests/tc04_free_lock.stderr.exp
+++ b/drd/tests/tc04_free_lock.stderr.exp
@@ -3,14 +3,14 @@
    at 0x........: free (vg_replace_malloc.c:...)
    by 0x........: main (tc04_free_lock.c:24)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc04_free_lock.c:20)
 
 Destroying locked mutex: mutex 0x........, recursion count 1, owner 1.
    at 0x........: bar (tc04_free_lock.c:40)
    by 0x........: main (tc04_free_lock.c:26)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_lock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: bar (tc04_free_lock.c:38)
    by 0x........: main (tc04_free_lock.c:26)
 
@@ -18,7 +18,7 @@
    at 0x........: foo (tc04_free_lock.c:49)
    by 0x........: main (tc04_free_lock.c:27)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: foo (tc04_free_lock.c:46)
    by 0x........: main (tc04_free_lock.c:27)
 
@@ -26,7 +26,7 @@
    at 0x........: bar (tc04_free_lock.c:40)
    by 0x........: main (tc04_free_lock.c:28)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_lock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: bar (tc04_free_lock.c:38)
    by 0x........: main (tc04_free_lock.c:28)
 
diff --git a/drd/tests/tc09_bad_unlock.stderr.exp b/drd/tests/tc09_bad_unlock.stderr.exp
index 7f8e2cc..8fe5fb2 100644
--- a/drd/tests/tc09_bad_unlock.stderr.exp
+++ b/drd/tests/tc09_bad_unlock.stderr.exp
@@ -1,26 +1,26 @@
 
 Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:27)
    by 0x........: main (tc09_bad_unlock.c:49)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:23)
    by 0x........: main (tc09_bad_unlock.c:49)
 
 Thread 2:
 Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: child_fn (tc09_bad_unlock.c:11)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:31)
    by 0x........: main (tc09_bad_unlock.c:49)
 
 Thread 1:
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:41)
    by 0x........: main (tc09_bad_unlock.c:49)
 
@@ -28,22 +28,22 @@
    at 0x........: nearly_main (tc09_bad_unlock.c:45)
    by 0x........: main (tc09_bad_unlock.c:49)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:31)
    by 0x........: main (tc09_bad_unlock.c:49)
 
 ---------------------
 Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:27)
    by 0x........: main (tc09_bad_unlock.c:50)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:23)
    by 0x........: main (tc09_bad_unlock.c:50)
 
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:41)
    by 0x........: main (tc09_bad_unlock.c:50)
 
@@ -51,7 +51,7 @@
    at 0x........: nearly_main (tc09_bad_unlock.c:45)
    by 0x........: main (tc09_bad_unlock.c:50)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:31)
    by 0x........: main (tc09_bad_unlock.c:50)
 
diff --git a/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8 b/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8
index 277705a..9b85b34 100644
--- a/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8
+++ b/drd/tests/tc09_bad_unlock.stderr.exp-glibc2.8
@@ -1,26 +1,26 @@
 
 Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:27)
    by 0x........: main (tc09_bad_unlock.c:49)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:23)
    by 0x........: main (tc09_bad_unlock.c:49)
 
 Thread 2:
 Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: child_fn (tc09_bad_unlock.c:11)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:31)
    by 0x........: main (tc09_bad_unlock.c:49)
 
 Thread 1:
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:41)
    by 0x........: main (tc09_bad_unlock.c:49)
 
@@ -28,22 +28,22 @@
    at 0x........: nearly_main (tc09_bad_unlock.c:45)
    by 0x........: (below main)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:31)
    by 0x........: main (tc09_bad_unlock.c:49)
 
 ---------------------
 Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:27)
    by 0x........: main (tc09_bad_unlock.c:50)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:23)
    by 0x........: main (tc09_bad_unlock.c:50)
 
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:41)
    by 0x........: main (tc09_bad_unlock.c:50)
 
@@ -51,7 +51,7 @@
    at 0x........: nearly_main (tc09_bad_unlock.c:45)
    by 0x........: (below main)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc09_bad_unlock.c:31)
    by 0x........: main (tc09_bad_unlock.c:50)
 
diff --git a/drd/tests/tc10_rec_lock.stderr.exp b/drd/tests/tc10_rec_lock.stderr.exp
index a37bbd4..8ca2069 100644
--- a/drd/tests/tc10_rec_lock.stderr.exp
+++ b/drd/tests/tc10_rec_lock.stderr.exp
@@ -7,11 +7,11 @@
 before unlock #3
 before unlock #4
 Mutex not locked by calling thread: mutex 0x........, recursion count 0, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc10_rec_lock.c:42)
    by 0x........: main (tc10_rec_lock.c:47)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: nearly_main (tc10_rec_lock.c:24)
    by 0x........: main (tc10_rec_lock.c:47)
 
diff --git a/drd/tests/tc12_rwl_trivial.stderr.exp b/drd/tests/tc12_rwl_trivial.stderr.exp
index 6ba7b18..0f41595 100644
--- a/drd/tests/tc12_rwl_trivial.stderr.exp
+++ b/drd/tests/tc12_rwl_trivial.stderr.exp
@@ -1,9 +1,9 @@
 
 Reader-writer lock not locked by calling thread: rwlock 0x.........
-   at 0x........: pthread_rwlock_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc12_rwl_trivial.c:35)
 rwlock 0x........ was first observed at:
-   at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc12_rwl_trivial.c:24)
 
 
diff --git a/drd/tests/tc18_semabuse.stderr.exp b/drd/tests/tc18_semabuse.stderr.exp
index 6c8c45b..74f672e 100644
--- a/drd/tests/tc18_semabuse.stderr.exp
+++ b/drd/tests/tc18_semabuse.stderr.exp
@@ -1,16 +1,16 @@
 
 Semaphore reinitialization: semaphore 0x........
-   at 0x........: sem_init (drd_pthread_intercepts.c:?)
+   at 0x........: sem_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc18_semabuse.c:26)
 semaphore 0x........ was first observed at:
-   at 0x........: sem_init (drd_pthread_intercepts.c:?)
+   at 0x........: sem_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc18_semabuse.c:23)
 
 Invalid semaphore: semaphore 0x........
-   at 0x........: sem_wait (drd_pthread_intercepts.c:?)
+   at 0x........: sem_wait_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc18_semabuse.c:34)
 semaphore 0x........ was first observed at:
-   at 0x........: sem_init (drd_pthread_intercepts.c:?)
+   at 0x........: sem_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc18_semabuse.c:23)
 
 
diff --git a/drd/tests/tc22_exit_w_lock.stderr.exp-64bit b/drd/tests/tc22_exit_w_lock.stderr.exp-64bit
index cf7e0d2..f51d183 100644
--- a/drd/tests/tc22_exit_w_lock.stderr.exp-64bit
+++ b/drd/tests/tc22_exit_w_lock.stderr.exp-64bit
@@ -1,9 +1,9 @@
 
 Mutex still locked at thread exit: mutex 0x........, recursion count 1, owner 3.
-   at 0x........: pthread_join (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_join_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc22_exit_w_lock.c:43)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_lock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_lock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: child_fn1 (tc22_exit_w_lock.c:18)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
diff --git a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc
index 3854362..0619171 100644
--- a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc
+++ b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-ppc
@@ -1,6 +1,6 @@
 
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_wait_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:69)
 
 
@@ -8,6 +8,6 @@
  Invalid address alignment at address 0x........
    at 0x........: (within libpthread-?.?.so)
    by 0x........: pthread_cond_wait@@GLIBC_2.3.2(within libpthread-?.?.so)
-   by 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?)
+   by 0x........: pthread_cond_wait_intercept (drd_pthread_intercepts.c:?)
 
 ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 0 from 0)
diff --git a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86 b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86
index 5e16bd2..117f282 100644
--- a/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86
+++ b/drd/tests/tc23_bogus_condwait.stderr.exp-linux-x86
@@ -1,85 +1,85 @@
 
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_wait_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:69)
 
 Thread 3:
 Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: rescue_me (tc23_bogus_condwait.c:20)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:56)
 
 Thread 1:
 Mutex not locked: mutex 0x........, recursion count 0, owner 0.
-   at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_wait_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:72)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:51)
 
 Thread 3:
 Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: rescue_me (tc23_bogus_condwait.c:24)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:56)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:51)
 
 Thread 1:
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_wait_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:75)
 rwlock 0x........ was first observed at:
-   at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:57)
 
 Thread 3:
 Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: rescue_me (tc23_bogus_condwait.c:28)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:56)
 rwlock 0x........ was first observed at:
-   at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:57)
 
 Thread 1:
 Mutex not locked by calling thread: mutex 0x........, recursion count 1, owner 2.
-   at 0x........: pthread_cond_wait (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_wait_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:78)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:53)
 
 Thread 3:
 Probably a race condition: condition variable 0x........ has been signaled but the associated mutex 0x........ is not locked by the signalling thread.
-   at 0x........: pthread_cond_signal (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_signal_intercept (drd_pthread_intercepts.c:?)
    by 0x........: rescue_me (tc23_bogus_condwait.c:32)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 cond 0x........ was first observed at:
-   at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_cond_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:56)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:53)
 
 The impossible happened: mutex 0x........ is locked simultaneously by two threads (recursion count 1, owners 2 and 1) !
 Thread 2:
 Mutex not locked by calling thread: mutex 0x........, recursion count 2, owner 1.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: grab_the_lock (tc23_bogus_condwait.c:42)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 mutex 0x........ was first observed at:
-   at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (tc23_bogus_condwait.c:53)
 
 
diff --git a/drd/tests/thread_name.stderr.exp b/drd/tests/thread_name.stderr.exp
index 82ad952..d8650e2 100644
--- a/drd/tests/thread_name.stderr.exp
+++ b/drd/tests/thread_name.stderr.exp
@@ -4,7 +4,7 @@
 
 Thread 2 (thread_func instance 1):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
@@ -13,7 +13,7 @@
 
 Thread 3 (thread_func instance 2):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
@@ -22,7 +22,7 @@
 
 Thread 4 (thread_func instance 3):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
@@ -31,7 +31,7 @@
 
 Thread 5 (thread_func instance 4):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
@@ -40,7 +40,7 @@
 
 Thread 6 (thread_func instance 5):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
@@ -49,7 +49,7 @@
 
 Thread 7 (thread_func instance 6):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
@@ -58,7 +58,7 @@
 
 Thread 8 (thread_func instance 7):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
@@ -67,7 +67,7 @@
 
 Thread 9 (thread_func instance 8):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
@@ -76,7 +76,7 @@
 
 Thread 10 (thread_func instance 9):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
@@ -85,7 +85,7 @@
 
 Thread 11 (thread_func instance 10):
 The object at address 0x........ is not a mutex.
-   at 0x........: pthread_mutex_unlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: thread_func (thread_name.c:?)
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
 
diff --git a/drd/tests/trylock.stderr.exp b/drd/tests/trylock.stderr.exp
index 2c5d765..f60c7a1 100644
--- a/drd/tests/trylock.stderr.exp
+++ b/drd/tests/trylock.stderr.exp
@@ -7,10 +7,10 @@
 Locking rwlock via pthread_rwlock_timedrdlock().
 Attempt to lock for writing recursively (not allowed).
 Recursive writer locking not allowed: rwlock 0x.........
-   at 0x........: pthread_rwlock_wrlock (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_wrlock_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (trylock.c:?)
 rwlock 0x........ was first observed at:
-   at 0x........: pthread_rwlock_init (drd_pthread_intercepts.c:?)
+   at 0x........: pthread_rwlock_init_intercept (drd_pthread_intercepts.c:?)
    by 0x........: main (trylock.c:?)
 
 Locking mutex via pthread_mutex_trylock().