]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge part of r9129 (factor out duplicated Z-encodings of names) from the
authorNicholas Nethercote <njn@valgrind.org>
Tue, 10 Feb 2009 04:23:41 +0000 (04:23 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 10 Feb 2009 04:23:41 +0000 (04:23 +0000)
DARWIN branch.

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

coregrind/m_replacemalloc/vg_replace_malloc.c
drd/drd_strmem_intercepts.c
exp-ptrcheck/h_intercepts.c
exp-ptrcheck/tests/bad_percentify.stderr.exp-glibc28-amd64
exp-ptrcheck/tests/filter_stderr
helgrind/hg_intercepts.c
include/pub_tool_redir.h
memcheck/mc_replace_strmem.c

index e0e3b1da33ee8b96e56386541e5c7f77fd630818..eaa568deb7a10156e32b378940e7f41f9c29a69f 100644 (file)
 #include "pub_core_redir.h"         // for VG_REPLACE_FUNCTION_*
 #include "pub_core_replacemalloc.h"
 
-/* --------- Some handy Z-encoded names. --------- */
-
-/* --- Soname of the standard C library. --- */
-
-#if defined(VGO_linux)
-#  define  m_libc_soname     libcZdsoZa              // libc.so*
-#elif defined(VGP_ppc32_aix5)
-   /* AIX has both /usr/lib/libc.a and /usr/lib/libc_r.a. */
-#  define  m_libc_soname     libcZaZdaZLshrZdoZR     // libc*.a(shr.o)
-#elif defined(VGP_ppc64_aix5)
-#  define  m_libc_soname     libcZaZdaZLshrZu64ZdoZR // libc*.a(shr_64.o)
-#else
-#  error "Unknown platform"
-#endif
-
-/* --- Soname of the GNU C++ library. --- */
-
-#define  m_libstdcxx_soname  libstdcZpZpZa           // libstdc++*
-
-/* --- Soname of XLC's C++ library. --- */
-
-/* AIX: xlC's C++ runtime library is called libC.a, and the
-   interesting symbols appear to be in ansicore_32.o or ansicore_64.o
-   respectively. */
-#if defined(VGP_ppc32_aix5)
-#  define  m_libC_dot_a   libCZdaZLansicoreZu32ZdoZR // libC.a(ansicore_32.o)
-#elif defined(VGP_ppc64_aix5)
-#  define  m_libC_dot_a   libCZdaZLansicoreZu64ZdoZR // libC.a(ansicore_64.o)
-#endif
-
 
 /* 2 Apr 05: the Portland Group compiler, which uses cfront/ARM style
    mangling, could be supported properly by the redirects in this
@@ -203,37 +173,37 @@ static void init(void) __attribute__((constructor));
 //     (from_so, from_fn,  v's replacement)
 
 // malloc
-ALLOC_or_NULL(m_libstdcxx_soname, malloc,      malloc);
-ALLOC_or_NULL(m_libc_soname,      malloc,      malloc);
+ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, malloc,      malloc);
+ALLOC_or_NULL(VG_Z_LIBC_SONAME,      malloc,      malloc);
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
-ALLOC_or_NULL(m_libc_soname,      malloc_common, malloc);
+ALLOC_or_NULL(VG_Z_LIBC_SONAME,      malloc_common, malloc);
 #endif
 
 
 /*---------------------- new ----------------------*/
 
 // operator new(unsigned int), not mangled (for gcc 2.96)
-ALLOC_or_BOMB(m_libstdcxx_soname,  builtin_new,    __builtin_new);
-ALLOC_or_BOMB(m_libc_soname,       builtin_new,    __builtin_new);
+ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME,  builtin_new,    __builtin_new);
+ALLOC_or_BOMB(VG_Z_LIBC_SONAME,       builtin_new,    __builtin_new);
 
-ALLOC_or_BOMB(m_libstdcxx_soname,  __builtin_new,  __builtin_new);
-ALLOC_or_BOMB(m_libc_soname,       __builtin_new,  __builtin_new);
+ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME,  __builtin_new,  __builtin_new);
+ALLOC_or_BOMB(VG_Z_LIBC_SONAME,       __builtin_new,  __builtin_new);
 
 // operator new(unsigned int), GNU mangling
 #if VG_WORDSIZE == 4
- ALLOC_or_BOMB(m_libstdcxx_soname, _Znwj,          __builtin_new);
- ALLOC_or_BOMB(m_libc_soname,      _Znwj,          __builtin_new);
+ ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwj,          __builtin_new);
+ ALLOC_or_BOMB(VG_Z_LIBC_SONAME,      _Znwj,          __builtin_new);
 #endif
 
 // operator new(unsigned long), GNU mangling
 #if VG_WORDSIZE == 8 || defined(VGP_ppc32_aix5)
- ALLOC_or_BOMB(m_libstdcxx_soname, _Znwm,          __builtin_new);
- ALLOC_or_BOMB(m_libc_soname,      _Znwm,          __builtin_new);
+ ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwm,          __builtin_new);
+ ALLOC_or_BOMB(VG_Z_LIBC_SONAME,      _Znwm,          __builtin_new);
 #endif
 
 // operator new(unsigned long), ARM/cfront mangling
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
- ALLOC_or_BOMB(m_libC_dot_a,       __nw__FUl,      __builtin_new);
+ ALLOC_or_BOMB(VG_Z_LIBC_DOT_A,       __nw__FUl,      __builtin_new);
 #endif
 
 
@@ -241,43 +211,43 @@ ALLOC_or_BOMB(m_libc_soname,       __builtin_new,  __builtin_new);
 
 // operator new(unsigned, std::nothrow_t const&), GNU mangling
 #if VG_WORDSIZE == 4
- ALLOC_or_NULL(m_libstdcxx_soname, _ZnwjRKSt9nothrow_t,  __builtin_new);
- ALLOC_or_NULL(m_libc_soname,      _ZnwjRKSt9nothrow_t,  __builtin_new);
+ ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwjRKSt9nothrow_t,  __builtin_new);
+ ALLOC_or_NULL(VG_Z_LIBC_SONAME,      _ZnwjRKSt9nothrow_t,  __builtin_new);
 #endif
 
 // operator new(unsigned long, std::nothrow_t const&), GNU mangling
 #if VG_WORDSIZE == 8 || defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
- ALLOC_or_NULL(m_libstdcxx_soname, _ZnwmRKSt9nothrow_t,  __builtin_new);
- ALLOC_or_NULL(m_libc_soname,      _ZnwmRKSt9nothrow_t,  __builtin_new);
+ ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwmRKSt9nothrow_t,  __builtin_new);
+ ALLOC_or_NULL(VG_Z_LIBC_SONAME,      _ZnwmRKSt9nothrow_t,  __builtin_new);
 #endif
 
 // operator new(unsigned long, std::nothrow_t const&), ARM/cfront mangling
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
- ALLOC_or_NULL(m_libC_dot_a,    __nw__FUlRCQ2_3std9nothrow_t, __builtin_new);
+ ALLOC_or_NULL(VG_Z_LIBC_DOT_A,    __nw__FUlRCQ2_3std9nothrow_t, __builtin_new);
 #endif
 
 
 /*---------------------- new [] ----------------------*/
 
 // operator new[](unsigned int), not mangled (for gcc 2.96)
-ALLOC_or_BOMB(m_libstdcxx_soname,  __builtin_vec_new, __builtin_vec_new );
-ALLOC_or_BOMB(m_libc_soname,       __builtin_vec_new, __builtin_vec_new );
+ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME,  __builtin_vec_new, __builtin_vec_new );
+ALLOC_or_BOMB(VG_Z_LIBC_SONAME,       __builtin_vec_new, __builtin_vec_new );
 
 // operator new[](unsigned int), GNU mangling
 #if VG_WORDSIZE == 4
- ALLOC_or_BOMB(m_libstdcxx_soname, _Znaj,             __builtin_vec_new );
- ALLOC_or_BOMB(m_libc_soname,      _Znaj,             __builtin_vec_new );
+ ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znaj,             __builtin_vec_new );
+ ALLOC_or_BOMB(VG_Z_LIBC_SONAME,      _Znaj,             __builtin_vec_new );
 #endif
 
 // operator new[](unsigned long), GNU mangling
 #if VG_WORDSIZE == 8 || defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
- ALLOC_or_BOMB(m_libstdcxx_soname, _Znam,             __builtin_vec_new );
- ALLOC_or_BOMB(m_libc_soname,      _Znam,             __builtin_vec_new );
+ ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znam,             __builtin_vec_new );
+ ALLOC_or_BOMB(VG_Z_LIBC_SONAME,      _Znam,             __builtin_vec_new );
 #endif
 
 // operator new[](unsigned long), ARM/cfront mangling
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
- ALLOC_or_BOMB(m_libC_dot_a,       __vn__FUl,         __builtin_vec_new);
+ ALLOC_or_BOMB(VG_Z_LIBC_DOT_A,       __vn__FUl,         __builtin_vec_new);
 #endif
 
 
@@ -285,19 +255,19 @@ ALLOC_or_BOMB(m_libc_soname,       __builtin_vec_new, __builtin_vec_new );
 
 // operator new[](unsigned, std::nothrow_t const&), GNU mangling
 #if VG_WORDSIZE == 4
- ALLOC_or_NULL(m_libstdcxx_soname, _ZnajRKSt9nothrow_t, __builtin_vec_new );
- ALLOC_or_NULL(m_libc_soname,      _ZnajRKSt9nothrow_t, __builtin_vec_new );
+ ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new );
+ ALLOC_or_NULL(VG_Z_LIBC_SONAME,      _ZnajRKSt9nothrow_t, __builtin_vec_new );
 #endif
 
 // operator new[](unsigned long, std::nothrow_t const&), GNU mangling
 #if VG_WORDSIZE == 8 || defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
- ALLOC_or_NULL(m_libstdcxx_soname, _ZnamRKSt9nothrow_t, __builtin_vec_new );
- ALLOC_or_NULL(m_libc_soname,      _ZnamRKSt9nothrow_t, __builtin_vec_new );
+ ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new );
+ ALLOC_or_NULL(VG_Z_LIBC_SONAME,      _ZnamRKSt9nothrow_t, __builtin_vec_new );
 #endif
 
 // operator new [](unsigned long, std::nothrow_t const&), ARM/cfront mangling
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
- ALLOC_or_BOMB(m_libC_dot_a,   __vn__FUlRCQ2_3std9nothrow_t, __builtin_vec_new );
+ ALLOC_or_BOMB(VG_Z_LIBC_DOT_A,   __vn__FUlRCQ2_3std9nothrow_t, __builtin_vec_new );
 #endif
 
 
@@ -319,62 +289,62 @@ ALLOC_or_BOMB(m_libc_soname,       __builtin_vec_new, __builtin_vec_new );
    }
 
 // free
-FREE(m_libstdcxx_soname,  free,                 free );
-FREE(m_libc_soname,       free,                 free );
+FREE(VG_Z_LIBSTDCXX_SONAME,  free,                 free );
+FREE(VG_Z_LIBC_SONAME,       free,                 free );
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
-FREE(m_libc_soname,       free_common,          free );
+FREE(VG_Z_LIBC_SONAME,       free_common,          free );
 #endif
 
 
 /*---------------------- cfree ----------------------*/
 
 // cfree
-FREE(m_libstdcxx_soname,  cfree,                free );
-FREE(m_libc_soname,       cfree,                free );
+FREE(VG_Z_LIBSTDCXX_SONAME,  cfree,                free );
+FREE(VG_Z_LIBC_SONAME,       cfree,                free );
 
 
 /*---------------------- delete ----------------------*/
 // operator delete(void*), not mangled (for gcc 2.96)
-FREE(m_libstdcxx_soname,   __builtin_delete,     __builtin_delete );
-FREE(m_libc_soname,        __builtin_delete,     __builtin_delete );
+FREE(VG_Z_LIBSTDCXX_SONAME,   __builtin_delete,     __builtin_delete );
+FREE(VG_Z_LIBC_SONAME,        __builtin_delete,     __builtin_delete );
 
 // operator delete(void*), GNU mangling
-FREE(m_libstdcxx_soname,  _ZdlPv,               __builtin_delete );
-FREE(m_libc_soname,       _ZdlPv,               __builtin_delete );
+FREE(VG_Z_LIBSTDCXX_SONAME,  _ZdlPv,               __builtin_delete );
+FREE(VG_Z_LIBC_SONAME,       _ZdlPv,               __builtin_delete );
 
 // operator delete(void*), ARM/cfront mangling
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
-FREE(m_libC_dot_a,        __dl__FPv,            __builtin_delete );
+FREE(VG_Z_LIBC_DOT_A,        __dl__FPv,            __builtin_delete );
 #endif
 
 
 /*---------------------- delete nothrow ----------------------*/
 
 // operator delete(void*, std::nothrow_t const&), GNU mangling
-FREE(m_libstdcxx_soname, _ZdlPvRKSt9nothrow_t,  __builtin_delete );
-FREE(m_libc_soname,      _ZdlPvRKSt9nothrow_t,  __builtin_delete );
+FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvRKSt9nothrow_t,  __builtin_delete );
+FREE(VG_Z_LIBC_SONAME,      _ZdlPvRKSt9nothrow_t,  __builtin_delete );
 
 
 /*---------------------- delete [] ----------------------*/
 // operator delete[](void*), not mangled (for gcc 2.96)
-FREE(m_libstdcxx_soname,   __builtin_vec_delete, __builtin_vec_delete );
-FREE(m_libc_soname,        __builtin_vec_delete, __builtin_vec_delete );
+FREE(VG_Z_LIBSTDCXX_SONAME,   __builtin_vec_delete, __builtin_vec_delete );
+FREE(VG_Z_LIBC_SONAME,        __builtin_vec_delete, __builtin_vec_delete );
 
 // operator delete[](void*), GNU mangling
-FREE(m_libstdcxx_soname,  _ZdaPv,               __builtin_vec_delete );
-FREE(m_libc_soname,       _ZdaPv,               __builtin_vec_delete );
+FREE(VG_Z_LIBSTDCXX_SONAME,  _ZdaPv,               __builtin_vec_delete );
+FREE(VG_Z_LIBC_SONAME,       _ZdaPv,               __builtin_vec_delete );
 
 // operator delete[](void*), ARM/cfront mangling
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
-FREE(m_libC_dot_a,        __vd__FPv,            __builtin_vec_delete );
+FREE(VG_Z_LIBC_DOT_A,        __vd__FPv,            __builtin_vec_delete );
 #endif
 
 
 /*---------------------- delete [] nothrow ----------------------*/
 
 // operator delete[](void*, std::nothrow_t const&), GNU mangling
-FREE(m_libstdcxx_soname,  _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
-FREE(m_libc_soname,       _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
+FREE(VG_Z_LIBSTDCXX_SONAME,  _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
+FREE(VG_Z_LIBC_SONAME,       _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
 
 
 /*---------------------- calloc ----------------------*/
@@ -394,9 +364,9 @@ FREE(m_libc_soname,       _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
       return v; \
    }
 
-CALLOC(m_libc_soname, calloc);
+CALLOC(VG_Z_LIBC_SONAME, calloc);
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
-CALLOC(m_libc_soname, calloc_common);
+CALLOC(VG_Z_LIBC_SONAME, calloc_common);
 #endif
 
 
@@ -415,9 +385,9 @@ CALLOC(m_libc_soname, calloc_common);
       if (ptrV == NULL) \
          /* We need to call a malloc-like function; so let's use \
             one which we know exists. */ \
-         return VG_REPLACE_FUNCTION_ZU(m_libc_soname,malloc) (new_size); \
+         return VG_REPLACE_FUNCTION_ZU(VG_Z_LIBC_SONAME,malloc) (new_size); \
       if (new_size <= 0) { \
-         VG_REPLACE_FUNCTION_ZU(m_libc_soname,free)(ptrV); \
+         VG_REPLACE_FUNCTION_ZU(VG_Z_LIBC_SONAME,free)(ptrV); \
          MALLOC_TRACE(" = 0"); \
          return NULL; \
       } \
@@ -426,9 +396,9 @@ CALLOC(m_libc_soname, calloc_common);
       return v; \
    }
 
-REALLOC(m_libc_soname, realloc);
+REALLOC(VG_Z_LIBC_SONAME, realloc);
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
-REALLOC(m_libc_soname, realloc_common);
+REALLOC(VG_Z_LIBC_SONAME, realloc_common);
 #endif
 
 
@@ -457,7 +427,7 @@ REALLOC(m_libc_soname, realloc_common);
       return v; \
    }
 
-MEMALIGN(m_libc_soname, memalign);
+MEMALIGN(VG_Z_LIBC_SONAME, memalign);
 
 
 /*---------------------- valloc ----------------------*/
@@ -479,11 +449,11 @@ static int local__getpagesize ( void ) {
       static int pszB = 0; \
       if (pszB == 0) \
          pszB = local__getpagesize(); \
-      return VG_REPLACE_FUNCTION_ZU(m_libc_soname,memalign) \
+      return VG_REPLACE_FUNCTION_ZU(VG_Z_LIBC_SONAME,memalign) \
                 ((SizeT)pszB, size); \
    }
 
-VALLOC(m_libc_soname, valloc);
+VALLOC(VG_Z_LIBC_SONAME, valloc);
 
 
 /*---------------------- mallopt ----------------------*/
@@ -500,7 +470,7 @@ VALLOC(m_libc_soname, valloc);
       return 1; \
    }
 
-MALLOPT(m_libc_soname, mallopt);
+MALLOPT(VG_Z_LIBC_SONAME, mallopt);
 
 
 /*---------------------- malloc_trim ----------------------*/
@@ -536,7 +506,7 @@ MALLOPT(m_libc_soname, mallopt);
       return 0; \
    }
 
-MALLOC_TRIM(m_libc_soname, malloc_trim);
+MALLOC_TRIM(VG_Z_LIBC_SONAME, malloc_trim);
 
 
 /*---------------------- posix_memalign ----------------------*/
@@ -556,7 +526,7 @@ MALLOC_TRIM(m_libc_soname, malloc_trim);
           || (alignment & (alignment - 1)) != 0) \
          return VKI_EINVAL; \
       \
-      mem = VG_REPLACE_FUNCTION_ZU(m_libc_soname,memalign)(alignment, size); \
+      mem = VG_REPLACE_FUNCTION_ZU(VG_Z_LIBC_SONAME,memalign)(alignment, size); \
       \
       if (mem != NULL) { \
         *memptr = mem; \
@@ -566,12 +536,12 @@ MALLOC_TRIM(m_libc_soname, malloc_trim);
       return VKI_ENOMEM; \
    }
 
-POSIX_MEMALIGN(m_libc_soname, posix_memalign);
+POSIX_MEMALIGN(VG_Z_LIBC_SONAME, posix_memalign);
 #if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
 /* 27 Nov 07: it appears that xlc links into executables, a
    posix_memalign, which calls onwards to memalign_common, with the
    same args. */
-POSIX_MEMALIGN(m_libc_soname, memalign_common);
+POSIX_MEMALIGN(VG_Z_LIBC_SONAME, memalign_common);
 #endif
 
 
@@ -596,7 +566,7 @@ POSIX_MEMALIGN(m_libc_soname, memalign_common);
       return pszB; \
    }
 
-MALLOC_USABLE_SIZE(m_libc_soname, malloc_usable_size);
+MALLOC_USABLE_SIZE(VG_Z_LIBC_SONAME, malloc_usable_size);
 
 
 /*---------------------- (unimplemented) ----------------------*/
@@ -618,9 +588,9 @@ static void panic(const char *str)
       panic(#fnname); \
    }
 
-PANIC(m_libc_soname, pvalloc);
-PANIC(m_libc_soname, malloc_get_state);
-PANIC(m_libc_soname, malloc_set_state);
+PANIC(VG_Z_LIBC_SONAME, pvalloc);
+PANIC(VG_Z_LIBC_SONAME, malloc_get_state);
+PANIC(VG_Z_LIBC_SONAME, malloc_set_state);
 
 #define MALLOC_STATS(soname, fnname) \
    \
@@ -630,7 +600,7 @@ PANIC(m_libc_soname, malloc_set_state);
       /* Valgrind's malloc_stats implementation does nothing. */ \
    } 
 
-MALLOC_STATS(m_libc_soname, malloc_stats);
+MALLOC_STATS(VG_Z_LIBC_SONAME, malloc_stats);
 
 
 /*---------------------- mallinfo ----------------------*/
@@ -650,7 +620,7 @@ MALLOC_STATS(m_libc_soname, malloc_stats);
       return mi; \
    }
 
-MALLINFO(m_libc_soname, mallinfo);
+MALLINFO(VG_Z_LIBC_SONAME, mallinfo);
 
 
 /* All the code in here is unused until this function is called */
index 3eaccac1f03c560c7f350f21033c52bcc58042e9..a40057e4f9bcebd699809d4d2037fa59f094db6f 100644 (file)
 #include "valgrind.h"
 
 
-/* --------- Some handy Z-encoded names. --------- */
-
-/* --- Soname of the standard C library. --- */
-
-#if defined(VGO_linux)
-#  define  m_libc_soname     libcZdsoZa              // libc.so*
-#elif defined(VGP_ppc32_aix5)
-   /* AIX has both /usr/lib/libc.a and /usr/lib/libc_r.a. */
-#  define  m_libc_soname     libcZaZdaZLshrZdoZR     // libc*.a(shr.o)
-#elif defined(VGP_ppc64_aix5)
-#  define  m_libc_soname     libcZaZdaZLshrZu64ZdoZR // libc*.a(shr_64.o)
-#else
-#  error "Unknown platform"
-#endif
-
-/* --- Sonames for Linux ELF linkers. --- */
-
-#define  m_ld_linux_so_2         ldZhlinuxZdsoZd2           // ld-linux.so.2
-#define  m_ld_linux_x86_64_so_2  ldZhlinuxZhx86Zh64ZdsoZd2  // ld-linux-x86-64.so.2
-#define  m_ld64_so_1             ld64ZdsoZd1                // ld64.so.1
-#define  m_ld_so_1               ldZdsoZd1                  // ld.so.1
-
-
 #define STRNLEN(soname, fnname) \
    SizeT VG_REPLACE_FUNCTION_ZU(soname,fnname) ( const char* str, SizeT n ); \
    SizeT VG_REPLACE_FUNCTION_ZU(soname,fnname) ( const char* str, SizeT n ) \
@@ -70,7 +47,7 @@
       return i; \
    }
 
-STRNLEN(m_libc_soname, strnlen)
+STRNLEN(VG_Z_LIBC_SONAME, strnlen)
    
 
 // Note that this replacement often doesn't get used because gcc inlines
@@ -86,9 +63,9 @@ STRNLEN(m_libc_soname, strnlen)
       return i; \
    }
 
-STRLEN(m_libc_soname,          strlen)
-STRLEN(m_ld_linux_so_2,        strlen)
-STRLEN(m_ld_linux_x86_64_so_2, strlen)
+STRLEN(VG_Z_LIBC_SONAME,          strlen)
+STRLEN(VG_Z_LD_LINUX_SO_2,        strlen)
+STRLEN(VG_Z_LD_LINUX_X86_64_SO_2, strlen)
 
 /*--------------------------------------------------------------------*/
 /*--- end                                                          ---*/
index 3ae8c6222ed0b88c6e5f2d0a3b82c1d6601d3f04..eef99a9a04ebdfcdb16695959f740705f0d1dc9c 100644 (file)
    memcheck/mc_replace_strmem.c.  If you copy more in, please keep
    them in the same order as in mc_replace_strmem.c. */
 
-/* --------- Some handy Z-encoded names. --------- */
-
-/* --- Soname of the standard C library. --- */
-
-#if defined(VGO_linux)
-#  define  m_libc_soname     libcZdsoZa              // libc.so*
-#elif defined(VGP_ppc32_aix5)
-   /* AIX has both /usr/lib/libc.a and /usr/lib/libc_r.a. */
-#  define  m_libc_soname     libcZaZdaZLshrZdoZR     // libc*.a(shr.o)
-#elif defined(VGP_ppc64_aix5)
-#  define  m_libc_soname     libcZaZdaZLshrZu64ZdoZR // libc*.a(shr_64.o)
-#else
-#  error "Unknown platform"
-#endif
-
-/* --- Sonames for Linux ELF linkers. --- */
-
-#define  m_ld_linux_so_2         ldZhlinuxZdsoZd2           // ld-linux.so.2
-#define  m_ld_linux_x86_64_so_2  ldZhlinuxZhx86Zh64ZdsoZd2  // ld-linux-x86-64.so.2
-#define  m_ld64_so_1             ld64ZdsoZd1                // ld64.so.1
-#define  m_ld_so_1               ldZdsoZd1                  // ld.so.1
-
-
-
 
 #define STRNLEN(soname, fnname) \
    SizeT VG_REPLACE_FUNCTION_ZU(soname,fnname) ( const char* str, SizeT n ); \
@@ -78,7 +54,7 @@
       return i; \
    }
 
-STRNLEN(m_libc_soname, strnlen)
+STRNLEN(VG_Z_LIBC_SONAME, strnlen)
 
 
 // Note that this replacement often doesn't get used because gcc inlines
@@ -94,10 +70,10 @@ STRNLEN(m_libc_soname, strnlen)
       return i; \
    }
 
-STRLEN(m_libc_soname,          strlen)
-STRLEN(m_ld_linux_so_2,        strlen)
-STRLEN(m_ld_linux_x86_64_so_2, strlen)
-STRLEN(m_ld_so_1,              strlen)
+STRLEN(VG_Z_LIBC_SONAME,          strlen)
+STRLEN(VG_Z_LD_LINUX_SO_2,        strlen)
+STRLEN(VG_Z_LD_LINUX_X86_64_SO_2, strlen)
+STRLEN(VG_Z_LD_SO_1,              strlen)
 
 
 #define STRCMP(soname, fnname) \
@@ -120,9 +96,9 @@ STRLEN(m_ld_so_1,              strlen)
       return 0; \
    }
 
-STRCMP(m_libc_soname,          strcmp)
-STRCMP(m_ld_linux_x86_64_so_2, strcmp)
-STRCMP(m_ld64_so_1,            strcmp)
+STRCMP(VG_Z_LIBC_SONAME,          strcmp)
+STRCMP(VG_Z_LD_LINUX_X86_64_SO_2, strcmp)
+STRCMP(VG_Z_LD64_SO_1,            strcmp)
 
 
 #define MEMCPY(soname, fnname) \
@@ -167,9 +143,9 @@ STRCMP(m_ld64_so_1,            strcmp)
    return dest; \
    }
 
-MEMCPY(m_libc_soname, memcpy)
-MEMCPY(m_ld_so_1,     memcpy) /* ld.so.1 */
-MEMCPY(m_ld64_so_1,   memcpy) /* ld64.so.1 */
+MEMCPY(VG_Z_LIBC_SONAME, memcpy)
+MEMCPY(VG_Z_LD_SO_1,     memcpy) /* ld.so.1 */
+MEMCPY(VG_Z_LD64_SO_1,   memcpy) /* ld64.so.1 */
 
 
 /* Copy SRC to DEST, returning the address of the terminating '\0' in
@@ -184,9 +160,9 @@ MEMCPY(m_ld64_so_1,   memcpy) /* ld64.so.1 */
       return dst; \
    }
 
-STPCPY(m_libc_soname,         stpcpy)
-STPCPY(m_ld_linux_so_2,        stpcpy)
-STPCPY(m_ld_linux_x86_64_so_2, stpcpy)
+STPCPY(VG_Z_LIBC_SONAME,          stpcpy)
+STPCPY(VG_Z_LD_LINUX_SO_2,        stpcpy)
+STPCPY(VG_Z_LD_LINUX_X86_64_SO_2, stpcpy)
 
 
 /*--------------------------------------------------------------------*/
index 572da507d3585a203f86dd43f0f0f7e5f31edeb5..2f5c8156a33595b458a9b754e8c482405ff6eeca 100644 (file)
@@ -1,6 +1,6 @@
 
 Invalid read of size 1
-   at 0x........: strlen (h_intercepts.c:97)
+   at 0x........: strlen (h_intercepts.c:...)
    by 0x........: ...
    by 0x........: ...
    by 0x........: VG_print_translation_stats (bad_percentify.c:88)
@@ -10,7 +10,7 @@ Invalid read of size 1
  Actual:   unknown
 
 Invalid read of size 1
-   at 0x........: strlen (h_intercepts.c:97)
+   at 0x........: strlen (h_intercepts.c:...)
    by 0x........: ...
    by 0x........: ...
    by 0x........: VG_print_translation_stats (bad_percentify.c:93)
@@ -20,7 +20,7 @@ Invalid read of size 1
  Actual:   unknown
 
 Invalid read of size 1
-   at 0x........: strlen (h_intercepts.c:97)
+   at 0x........: strlen (h_intercepts.c:...)
    by 0x........: ...
    by 0x........: ...
    by 0x........: VG_print_translation_stats (bad_percentify.c:98)
index c679ff1b32c6c91b82b8dc260e5f70d751f5c7d4..23d9bca55db03d5ff7c50a0554bf015f61c8658b 100755 (executable)
@@ -31,4 +31,8 @@ sed \
 -e "s/printf (printf.c:[0-9]*)/.../" \
 -e "s/strdup (strdup.c:[0-9]*)/.../" \
 -e "s/pthread_key_create.c:[0-9]*/in \/...libpthread.../" \
--e "s/genops.c:[0-9]*/in \/...libc.../"
+-e "s/genops.c:[0-9]*/in \/...libc.../" |
+
+# Anonymise line numbers in h_intercepts.c.
+sed "s/h_intercepts.c:[0-9]*/h_intercepts.c:.../" 
+
index 54b18fb9400e0ccb993e3016b2c660a26be98991..0b66a5d4577da023e74222ed27c6032923d91810 100644 (file)
@@ -1592,28 +1592,6 @@ QT4_FUNC(void*, _ZN6QMutexD2Ev, void* mutex)
    new functions, please keep them in the same order as they appear in
    mc_replace_strmem.c. */
 
-/* --------- Some handy Z-encoded names. --------- */
-
-/* --- Soname of the standard C library. --- */
-
-#if defined(VGO_linux)
-#  define  m_libc_soname     libcZdsoZa              // libc.so*
-#elif defined(VGP_ppc32_aix5)
-   /* AIX has both /usr/lib/libc.a and /usr/lib/libc_r.a. */
-#  define  m_libc_soname     libcZaZdaZLshrZdoZR     // libc*.a(shr.o)
-#elif defined(VGP_ppc64_aix5)
-#  define  m_libc_soname     libcZaZdaZLshrZu64ZdoZR // libc*.a(shr_64.o)
-#else
-#  error "Unknown platform"
-#endif
-
-/* --- Sonames for Linux ELF linkers. --- */
-
-#define  m_ld_linux_so_2         ldZhlinuxZdsoZd2           // ld-linux.so.2
-#define  m_ld_linux_x86_64_so_2  ldZhlinuxZhx86Zh64ZdsoZd2  // ld-linux-x86-64.so.2
-#define  m_ld64_so_1             ld64ZdsoZd1                // ld64.so.1
-#define  m_ld_so_1               ldZdsoZd1                  // ld.so.1
-
 
 #define STRCHR(soname, fnname) \
    char* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( const char* s, int c ); \
@@ -1629,12 +1607,12 @@ QT4_FUNC(void*, _ZN6QMutexD2Ev, void* mutex)
    }
 
 // Apparently index() is the same thing as strchr()
-STRCHR(m_libc_soname,          strchr)
-STRCHR(m_ld_linux_so_2,        strchr)
-STRCHR(m_ld_linux_x86_64_so_2, strchr)
-STRCHR(m_libc_soname,          index)
-STRCHR(m_ld_linux_so_2,        index)
-STRCHR(m_ld_linux_x86_64_so_2, index)
+STRCHR(VG_Z_LIBC_SONAME,          strchr)
+STRCHR(VG_Z_LD_LINUX_SO_2,        strchr)
+STRCHR(VG_Z_LD_LINUX_X86_64_SO_2, strchr)
+STRCHR(VG_Z_LIBC_SONAME,          index)
+STRCHR(VG_Z_LD_LINUX_SO_2,        index)
+STRCHR(VG_Z_LD_LINUX_X86_64_SO_2, index)
 
 
 // Note that this replacement often doesn't get used because gcc inlines
@@ -1650,9 +1628,9 @@ STRCHR(m_ld_linux_x86_64_so_2, index)
       return i; \
    }
 
-STRLEN(m_libc_soname,          strlen)
-STRLEN(m_ld_linux_so_2,        strlen)
-STRLEN(m_ld_linux_x86_64_so_2, strlen)
+STRLEN(VG_Z_LIBC_SONAME,          strlen)
+STRLEN(VG_Z_LD_LINUX_SO_2,        strlen)
+STRLEN(VG_Z_LD_LINUX_X86_64_SO_2, strlen)
 
 
 #define STRCPY(soname, fnname) \
@@ -1667,7 +1645,7 @@ STRLEN(m_ld_linux_x86_64_so_2, strlen)
       return (char*)dst_orig; \
    }
 
-STRCPY(m_libc_soname, strcpy)
+STRCPY(VG_Z_LIBC_SONAME, strcpy)
 
 
 #define STRCMP(soname, fnname) \
@@ -1690,9 +1668,9 @@ STRCPY(m_libc_soname, strcpy)
       return 0; \
    }
 
-STRCMP(m_libc_soname,          strcmp)
-STRCMP(m_ld_linux_x86_64_so_2, strcmp)
-STRCMP(m_ld64_so_1,            strcmp)
+STRCMP(VG_Z_LIBC_SONAME,          strcmp)
+STRCMP(VG_Z_LD_LINUX_X86_64_SO_2, strcmp)
+STRCMP(VG_Z_LD64_SO_1,            strcmp)
 
 
 #define MEMCPY(soname, fnname) \
@@ -1737,9 +1715,9 @@ STRCMP(m_ld64_so_1,            strcmp)
       return dst; \
    }
 
-MEMCPY(m_libc_soname, memcpy)
-MEMCPY(m_ld_so_1,     memcpy) /* ld.so.1 */
-MEMCPY(m_ld64_so_1,   memcpy) /* ld64.so.1 */
+MEMCPY(VG_Z_LIBC_SONAME,    memcpy)
+MEMCPY(VG_Z_LD_SO_1,        memcpy) /* ld.so.1 */
+MEMCPY(VG_Z_LD64_SO_1,      memcpy) /* ld64.so.1 */
 /* icc9 blats these around all over the place.  Not only in the main
    executable but various .so's.  They are highly tuned and read
    memory beyond the source boundary (although work correctly and
index 4266b2a65f1067679026e8305e0afc635bb6b9d0..d3e59a87a6f583d4143dc882e43d861637487512 100644 (file)
 #define VG_WRAP_FUNCTION_ZU(soname,fnname) VG_CONCAT4(_vgwZU_,soname,_,fnname)
 #define VG_WRAP_FUNCTION_ZZ(soname,fnname) VG_CONCAT4(_vgwZZ_,soname,_,fnname)
 
+/* --------- Some handy Z-encoded names. --------- */
+
+/* --- Soname of the standard C library. --- */
+
+#if defined(VGO_linux)
+#  define  VG_Z_LIBC_SONAME  libcZdsoZa              // libc.so*
+#elif defined(VGP_ppc32_aix5)
+   /* AIX has both /usr/lib/libc.a and /usr/lib/libc_r.a. */
+#  define  VG_Z_LIBC_SONAME  libcZaZdaZLshrZdoZR     // libc*.a(shr.o)
+#elif defined(VGP_ppc64_aix5)
+#  define  VG_Z_LIBC_SONAME  libcZaZdaZLshrZu64ZdoZR // libc*.a(shr_64.o)
+#else
+#  error "Unknown platform"
+#endif
+
+/* --- Soname of the GNU C++ library. --- */
+
+// DDD: this one and those below should probably be conditionally compiled,
+// as should all the redirects in the tools that use them.
+#define  VG_Z_LIBSTDCXX_SONAME  libstdcZpZpZa           // libstdc++*
+
+/* --- Soname of XLC's C++ library. --- */
+
+/* AIX: xlC's C++ runtime library is called libC.a, and the
+   interesting symbols appear to be in ansicore_32.o or ansicore_64.o
+   respectively. */
+#if defined(VGP_ppc32_aix5)
+#  define  VG_Z_LIBC_DOT_A   libCZdaZLansicoreZu32ZdoZR // libC.a(ansicore_32.o)
+#elif defined(VGP_ppc64_aix5)
+#  define  VG_Z_LIBC_DOT_A   libCZdaZLansicoreZu64ZdoZR // libC.a(ansicore_64.o)
+#endif
+
+/* --- Sonames for Linux ELF linkers. --- */
+
+#define  VG_Z_LD_LINUX_SO_2         ldZhlinuxZdsoZd2           // ld-linux.so.2
+#define  VG_Z_LD_LINUX_X86_64_SO_2  ldZhlinuxZhx86Zh64ZdsoZd2  // ld-linux-x86-64.so.2
+#define  VG_Z_LD64_SO_1             ld64ZdsoZd1                // ld64.so.1
+#define  VG_Z_LD_SO_1               ldZdsoZd1                  // ld.so.1
+
 
 #endif   // __PUB_TOOL_REDIR_H
 
index 46c15479c0f04b983a5ba0a063ef9b3da150b7c2..8e8553c7cdfd499b7650ec4deaf43a71fe7797e7 100644 (file)
@@ -97,28 +97,6 @@ Bool is_overlap ( void* dst, const void* src, SizeT dstlen, SizeT srclen )
                              s, src, dst, len, 0); \
 }
 
-/* --------- Some handy Z-encoded names. --------- */
-
-/* --- Soname of the standard C library. --- */
-
-#if defined(VGO_linux)
-#  define  m_libc_soname     libcZdsoZa              // libc.so*
-#elif defined(VGP_ppc32_aix5)
-   /* AIX has both /usr/lib/libc.a and /usr/lib/libc_r.a. */
-#  define  m_libc_soname     libcZaZdaZLshrZdoZR     // libc*.a(shr.o)
-#elif defined(VGP_ppc64_aix5)
-#  define  m_libc_soname     libcZaZdaZLshrZu64ZdoZR // libc*.a(shr_64.o)
-#else
-#  error "Unknown platform"
-#endif
-
-/* --- Sonames for Linux ELF linkers. --- */
-
-#define  m_ld_linux_so_2         ldZhlinuxZdsoZd2           // ld-linux.so.2
-#define  m_ld_linux_x86_64_so_2  ldZhlinuxZhx86Zh64ZdsoZd2  // ld-linux-x86-64.so.2
-#define  m_ld64_so_1             ld64ZdsoZd1                // ld64.so.1
-#define  m_ld_so_1               ldZdsoZd1                  // ld.so.1
-
 
 #define STRRCHR(soname, fnname) \
    char* VG_REPLACE_FUNCTION_ZU(soname,fnname)( const char* s, int c ); \
@@ -135,9 +113,9 @@ Bool is_overlap ( void* dst, const void* src, SizeT dstlen, SizeT srclen )
    }
 
 // Apparently rindex() is the same thing as strrchr()
-STRRCHR(m_libc_soname,   strrchr)
-STRRCHR(m_libc_soname,   rindex)
-STRRCHR(m_ld_linux_so_2, rindex)
+STRRCHR(VG_Z_LIBC_SONAME,   strrchr)
+STRRCHR(VG_Z_LIBC_SONAME,   rindex)
+STRRCHR(VG_Z_LD_LINUX_SO_2, rindex)
    
 
 #define STRCHR(soname, fnname) \
@@ -154,12 +132,12 @@ STRRCHR(m_ld_linux_so_2, rindex)
    }
 
 // Apparently index() is the same thing as strchr()
-STRCHR(m_libc_soname,          strchr)
-STRCHR(m_ld_linux_so_2,        strchr)
-STRCHR(m_ld_linux_x86_64_so_2, strchr)
-STRCHR(m_libc_soname,          index)
-STRCHR(m_ld_linux_so_2,        index)
-STRCHR(m_ld_linux_x86_64_so_2, index)
+STRCHR(VG_Z_LIBC_SONAME,          strchr)
+STRCHR(VG_Z_LD_LINUX_SO_2,        strchr)
+STRCHR(VG_Z_LD_LINUX_X86_64_SO_2, strchr)
+STRCHR(VG_Z_LIBC_SONAME,          index)
+STRCHR(VG_Z_LD_LINUX_SO_2,        index)
+STRCHR(VG_Z_LD_LINUX_X86_64_SO_2, index)
 
 
 #define STRCAT(soname, fnname) \
@@ -183,7 +161,7 @@ STRCHR(m_ld_linux_x86_64_so_2, index)
       return dst_orig; \
    }
 
-STRCAT(m_libc_soname, strcat)
+STRCAT(VG_Z_LIBC_SONAME, strcat)
 
 
 #define STRNCAT(soname, fnname) \
@@ -211,7 +189,7 @@ STRCAT(m_libc_soname, strcat)
       return dst_orig; \
    }
 
-STRNCAT(m_libc_soname, strncat)
+STRNCAT(VG_Z_LIBC_SONAME, strncat)
 
 
 #define STRNLEN(soname, fnname) \
@@ -223,7 +201,7 @@ STRNCAT(m_libc_soname, strncat)
       return i; \
    }
 
-STRNLEN(m_libc_soname, strnlen)
+STRNLEN(VG_Z_LIBC_SONAME, strnlen)
    
 
 // Note that this replacement often doesn't get used because gcc inlines
@@ -239,9 +217,9 @@ STRNLEN(m_libc_soname, strnlen)
       return i; \
    }
 
-STRLEN(m_libc_soname,          strlen)
-STRLEN(m_ld_linux_so_2,        strlen)
-STRLEN(m_ld_linux_x86_64_so_2, strlen)
+STRLEN(VG_Z_LIBC_SONAME,       strlen)
+STRLEN(VG_Z_LD_LINUX_SO_2,        strlen)
+STRLEN(VG_Z_LD_LINUX_X86_64_SO_2, strlen)
 
 
 #define STRCPY(soname, fnname) \
@@ -265,7 +243,7 @@ STRLEN(m_ld_linux_x86_64_so_2, strlen)
       return dst_orig; \
    }
 
-STRCPY(m_libc_soname, strcpy)
+STRCPY(VG_Z_LIBC_SONAME, strcpy)
 
 
 #define STRNCPY(soname, fnname) \
@@ -288,7 +266,7 @@ STRCPY(m_libc_soname, strcpy)
       return dst_orig; \
    }
 
-STRNCPY(m_libc_soname, strncpy)
+STRNCPY(VG_Z_LIBC_SONAME, strncpy)
 
 
 #define STRNCMP(soname, fnname) \
@@ -311,7 +289,7 @@ STRNCPY(m_libc_soname, strncpy)
       } \
    }
 
-STRNCMP(m_libc_soname, strncmp)
+STRNCMP(VG_Z_LIBC_SONAME, strncmp)
 
 
 #define STRCMP(soname, fnname) \
@@ -334,9 +312,9 @@ STRNCMP(m_libc_soname, strncmp)
       return 0; \
    }
 
-STRCMP(m_libc_soname,          strcmp)
-STRCMP(m_ld_linux_x86_64_so_2, strcmp)
-STRCMP(m_ld64_so_1,            strcmp)
+STRCMP(VG_Z_LIBC_SONAME,          strcmp)
+STRCMP(VG_Z_LD_LINUX_X86_64_SO_2, strcmp)
+STRCMP(VG_Z_LD64_SO_1,            strcmp)
 
 
 #define MEMCHR(soname, fnname) \
@@ -351,7 +329,7 @@ STRCMP(m_ld64_so_1,            strcmp)
       return NULL; \
    }
 
-MEMCHR(m_libc_soname, memchr)
+MEMCHR(VG_Z_LIBC_SONAME, memchr)
 
 
 #define MEMCPY(soname, fnname) \
@@ -399,9 +377,9 @@ MEMCHR(m_libc_soname, memchr)
       return dst; \
    }
 
-MEMCPY(m_libc_soname, memcpy)
-MEMCPY(m_ld_so_1,     memcpy) /* ld.so.1 */
-MEMCPY(m_ld64_so_1,   memcpy) /* ld64.so.1 */
+MEMCPY(VG_Z_LIBC_SONAME, memcpy)
+MEMCPY(VG_Z_LD_SO_1,     memcpy) /* ld.so.1 */
+MEMCPY(VG_Z_LD64_SO_1,   memcpy) /* ld64.so.1 */
 /* icc9 blats these around all over the place.  Not only in the main
    executable but various .so's.  They are highly tuned and read
    memory beyond the source boundary (although work correctly and
@@ -438,9 +416,9 @@ MEMCPY(NONE, _intel_fast_memcpy)
       return 0; \
    }
 
-MEMCMP(m_libc_soname, memcmp)
-MEMCMP(m_libc_soname, bcmp)
-MEMCMP(m_ld_so_1, bcmp)
+MEMCMP(VG_Z_LIBC_SONAME, memcmp)
+MEMCMP(VG_Z_LIBC_SONAME, bcmp)
+MEMCMP(VG_Z_LD_SO_1,     bcmp)
 
 
 /* Copy SRC to DEST, returning the address of the terminating '\0' in
@@ -466,9 +444,9 @@ MEMCMP(m_ld_so_1, bcmp)
       return dst; \
    }
 
-STPCPY(m_libc_soname,         stpcpy)
-STPCPY(m_ld_linux_so_2,        stpcpy)
-STPCPY(m_ld_linux_x86_64_so_2, stpcpy)
+STPCPY(VG_Z_LIBC_SONAME,          stpcpy)
+STPCPY(VG_Z_LD_LINUX_SO_2,        stpcpy)
+STPCPY(VG_Z_LD_LINUX_X86_64_SO_2, stpcpy)
    
 
 #define MEMSET(soname, fnname) \
@@ -490,7 +468,7 @@ STPCPY(m_ld_linux_x86_64_so_2, stpcpy)
       return s; \
    }
 
-MEMSET(m_libc_soname, memset)
+MEMSET(VG_Z_LIBC_SONAME, memset)
 
 
 #define MEMMOVE(soname, fnname) \
@@ -514,7 +492,7 @@ MEMSET(m_libc_soname, memset)
       return dst; \
    }
 
-MEMMOVE(m_libc_soname, memmove)
+MEMMOVE(VG_Z_LIBC_SONAME, memmove)
 
 
 /* glibc 2.5 variant of memmove which checks the dest is big enough.
@@ -550,7 +528,7 @@ MEMMOVE(m_libc_soname, memmove)
      return NULL; \
    }
 
-GLIBC25___MEMMOVE_CHK(m_libc_soname, __memmove_chk)
+GLIBC25___MEMMOVE_CHK(VG_Z_LIBC_SONAME, __memmove_chk)
 
 
 /* Find the first occurrence of C in S or the final NUL byte.  */
@@ -567,7 +545,7 @@ GLIBC25___MEMMOVE_CHK(m_libc_soname, __memmove_chk)
       } \
    }
 
-GLIBC232_STRCHRNUL(m_libc_soname, strchrnul)
+GLIBC232_STRCHRNUL(VG_Z_LIBC_SONAME, strchrnul)
 
 
 /* Find the first occurrence of C in S.  */
@@ -583,7 +561,7 @@ GLIBC232_STRCHRNUL(m_libc_soname, strchrnul)
       } \
    }
 
-GLIBC232_RAWMEMCHR(m_libc_soname, rawmemchr)
+GLIBC232_RAWMEMCHR(VG_Z_LIBC_SONAME, rawmemchr)
 
 
 /* glibc variant of strcpy that checks the dest is big enough.
@@ -611,7 +589,7 @@ GLIBC232_RAWMEMCHR(m_libc_soname, rawmemchr)
      return NULL; \
    }
 
-GLIBC25___STRCPY_CHK(m_libc_soname, __strcpy_chk)
+GLIBC25___STRCPY_CHK(VG_Z_LIBC_SONAME, __strcpy_chk)
 
 
 /* glibc variant of stpcpy that checks the dest is big enough.
@@ -638,7 +616,7 @@ GLIBC25___STRCPY_CHK(m_libc_soname, __strcpy_chk)
      return NULL; \
    }
 
-GLIBC25___STPCPY_CHK(m_libc_soname, __stpcpy_chk)
+GLIBC25___STPCPY_CHK(VG_Z_LIBC_SONAME, __stpcpy_chk)
 
 
 /* mempcpy */
@@ -674,8 +652,8 @@ GLIBC25___STPCPY_CHK(m_libc_soname, __stpcpy_chk)
       return (void*)( ((char*)dst) + len_saved ); \
    }
 
-GLIBC25_MEMPCPY(m_libc_soname, mempcpy)
-GLIBC25_MEMPCPY(m_ld_so_1,     mempcpy) /* ld.so.1 */
+GLIBC25_MEMPCPY(VG_Z_LIBC_SONAME, mempcpy)
+GLIBC25_MEMPCPY(VG_Z_LD_SO_1,     mempcpy) /* ld.so.1 */
 
 
 #define GLIBC26___MEMCPY_CHK(soname, fnname) \
@@ -719,7 +697,7 @@ GLIBC25_MEMPCPY(m_ld_so_1,     mempcpy) /* ld.so.1 */
      return NULL; \
    }
 
-GLIBC26___MEMCPY_CHK(m_libc_soname, __memcpy_chk)
+GLIBC26___MEMCPY_CHK(VG_Z_LIBC_SONAME, __memcpy_chk)
 
 
 /*------------------------------------------------------------*/
@@ -729,8 +707,8 @@ GLIBC26___MEMCPY_CHK(m_libc_soname, __memcpy_chk)
 #if defined(VGO_linux)
 
 /* putenv */
-int VG_WRAP_FUNCTION_ZU(m_libc_soname, putenv) (char* string);
-int VG_WRAP_FUNCTION_ZU(m_libc_soname, putenv) (char* string)
+int VG_WRAP_FUNCTION_ZU(VG_Z_LIBC_SONAME, putenv) (char* string);
+int VG_WRAP_FUNCTION_ZU(VG_Z_LIBC_SONAME, putenv) (char* string)
 {
     OrigFn fn;
     Word result;
@@ -746,8 +724,8 @@ int VG_WRAP_FUNCTION_ZU(m_libc_soname, putenv) (char* string)
 }
 
 /* unsetenv */
-int VG_WRAP_FUNCTION_ZU(m_libc_soname, unsetenv) (const char* name);
-int VG_WRAP_FUNCTION_ZU(m_libc_soname, unsetenv) (const char* name)
+int VG_WRAP_FUNCTION_ZU(VG_Z_LIBC_SONAME, unsetenv) (const char* name);
+int VG_WRAP_FUNCTION_ZU(VG_Z_LIBC_SONAME, unsetenv) (const char* name)
 {
     OrigFn fn;
     Word result;
@@ -763,9 +741,9 @@ int VG_WRAP_FUNCTION_ZU(m_libc_soname, unsetenv) (const char* name)
 }
 
 /* setenv */
-int VG_WRAP_FUNCTION_ZU(m_libc_soname, setenv)
+int VG_WRAP_FUNCTION_ZU(VG_Z_LIBC_SONAME, setenv)
     (const char* name, const char* value, int overwrite);
-int VG_WRAP_FUNCTION_ZU(m_libc_soname, setenv)
+int VG_WRAP_FUNCTION_ZU(VG_Z_LIBC_SONAME, setenv)
     (const char* name, const char* value, int overwrite)
 {
     OrigFn fn;