|
From: <sv...@va...> - 2005-10-13 15:51:27
|
Author: tom
Date: 2005-10-13 16:51:12 +0100 (Thu, 13 Oct 2005)
New Revision: 4916
Log:
Use an soname of libc.so* for libc redirects so that we catch a wider
range of libc's such as uclibc as well as glibc. Fixes bug 114289.
Modified:
trunk/coregrind/m_replacemalloc/vg_replace_malloc.c
trunk/memcheck/mac_replace_strmem.c
Modified: trunk/coregrind/m_replacemalloc/vg_replace_malloc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_replacemalloc/vg_replace_malloc.c 2005-10-13 15:29:=
39 UTC (rev 4915)
+++ trunk/coregrind/m_replacemalloc/vg_replace_malloc.c 2005-10-13 15:51:=
12 UTC (rev 4916)
@@ -55,7 +55,7 @@
=20
/* Some handy Z-encoded names */
#define m_libstc_plus_plus_star libstdcZpZpZa // libstdc++*
-#define m_libc_dot_so_dot_6 libcZdsoZd6 // libc.so.6
+#define m_libc_dot_so_star libcZdsoZa // libc.so*
//#define m_libpgc_dot_so libpgcZdso // libpgc.so
=20
/* 2 Apr 05: the Portland Group compiler, which uses cfront/ARM style
@@ -127,7 +127,7 @@
{ \
void* v; \
\
- MALLOC_TRACE(#fnname "(%llu)", (ULong)n ); \
+ MALLOC_TRACE(#fnname "(%llu)", (ULong)n ); \
if (!init_done) init(); \
\
v =3D (void*)VALGRIND_NON_SIMD_CALL1( info.tl_##vg_replacement, n =
); \
@@ -146,27 +146,27 @@
=20
// malloc
ALLOC_or_NULL(m_libstc_plus_plus_star, malloc, malloc);
-ALLOC_or_NULL(m_libc_dot_so_dot_6, malloc, malloc);
+ALLOC_or_NULL(m_libc_dot_so_star, malloc, malloc);
//ALLOC_or_NULL(m_libpgc_dot_so, malloc, malloc);
=20
=20
// operator new(unsigned int), unmangled for some bizarre reason
ALLOC_or_BOMB(m_libstc_plus_plus_star, builtin_new, __builtin_new);
-ALLOC_or_BOMB(m_libc_dot_so_dot_6, builtin_new, __builtin_new);
+ALLOC_or_BOMB(m_libc_dot_so_star, builtin_new, __builtin_new);
=20
ALLOC_or_BOMB(m_libstc_plus_plus_star, __builtin_new, __builtin_new);
-ALLOC_or_BOMB(m_libc_dot_so_dot_6, __builtin_new, __builtin_new);
+ALLOC_or_BOMB(m_libc_dot_so_star, __builtin_new, __builtin_new);
=20
=20
// operator new(unsigned int), GNU mangling, 32-bit platforms
// operator new(unsigned long), GNU mangling, 64-bit platforms
#if VG_WORDSIZE =3D=3D 4
ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwj, __builtin_new);
- ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znwj, __builtin_new);
+ ALLOC_or_BOMB(m_libc_dot_so_star, _Znwj, __builtin_new);
#endif
#if VG_WORDSIZE =3D=3D 8
ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwm, __builtin_new);
- ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znwm, __builtin_new);
+ ALLOC_or_BOMB(m_libc_dot_so_star, _Znwm, __builtin_new);
#endif
=20
=20
@@ -178,28 +178,28 @@
// operator new(unsigned long, std::nothrow_t const&), GNU mangling, 64-=
bit
#if VG_WORDSIZE =3D=3D 4
ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnwjRKSt9nothrow_t, __builtin_=
new);
- ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnwjRKSt9nothrow_t, __builtin_=
new);
+ ALLOC_or_NULL(m_libc_dot_so_star, _ZnwjRKSt9nothrow_t, __builtin_=
new);
#endif
#if VG_WORDSIZE =3D=3D 8
ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnwmRKSt9nothrow_t, __builtin_=
new);
- ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnwmRKSt9nothrow_t, __builtin_=
new);
+ ALLOC_or_NULL(m_libc_dot_so_star, _ZnwmRKSt9nothrow_t, __builtin_=
new);
#endif
=20
=20
// operator new[](unsigned int), unmangled for some bizarre reason
ALLOC_or_BOMB(m_libstc_plus_plus_star, __builtin_vec_new, __builtin_vec_=
new );
-ALLOC_or_BOMB(m_libc_dot_so_dot_6, __builtin_vec_new, __builtin_vec_=
new );
+ALLOC_or_BOMB(m_libc_dot_so_star, __builtin_vec_new, __builtin_vec_=
new );
=20
=20
// operator new[](unsigned int), GNU mangling, 32-bit platforms
// operator new[](unsigned long), GNU mangling, 64-bit platforms
#if VG_WORDSIZE =3D=3D 4
ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znaj, __builtin_vec=
_new );
- ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znaj, __builtin_vec=
_new );
+ ALLOC_or_BOMB(m_libc_dot_so_star, _Znaj, __builtin_vec=
_new );
#endif
#if VG_WORDSIZE =3D=3D 8
ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znam, __builtin_vec=
_new );
- ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znam, __builtin_vec=
_new );
+ ALLOC_or_BOMB(m_libc_dot_so_star, _Znam, __builtin_vec_=
new );
#endif
=20
=20
@@ -207,11 +207,11 @@
// operator new[](unsigned long, std::nothrow_t const&), GNU mangling, 6=
4-bit
#if VG_WORDSIZE =3D=3D 4
ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnajRKSt9nothrow_t, __builtin_v=
ec_new );
- ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnajRKSt9nothrow_t, __builtin_v=
ec_new );
+ ALLOC_or_NULL(m_libc_dot_so_star, _ZnajRKSt9nothrow_t, __builtin_v=
ec_new );
#endif
#if VG_WORDSIZE =3D=3D 8
ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnamRKSt9nothrow_t, __builtin_v=
ec_new );
- ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnamRKSt9nothrow_t, __builtin_v=
ec_new );
+ ALLOC_or_NULL(m_libc_dot_so_star, _ZnamRKSt9nothrow_t, __builtin_v=
ec_new );
#endif
=20
=20
@@ -232,33 +232,33 @@
=20
// free
FREE(m_libstc_plus_plus_star, free, free );
-FREE(m_libc_dot_so_dot_6, free, free );
+FREE(m_libc_dot_so_star, free, free );
=20
// cfree
FREE(m_libstc_plus_plus_star, cfree, free );
-FREE(m_libc_dot_so_dot_6, cfree, free );
+FREE(m_libc_dot_so_star, cfree, free );
=20
// do we really need these?
FREE(m_libstc_plus_plus_star, __builtin_delete, __builtin_delete );
-FREE(m_libc_dot_so_dot_6, __builtin_delete, __builtin_delete );
+FREE(m_libc_dot_so_star, __builtin_delete, __builtin_delete );
=20
// operator delete(void*), GNU mangling
FREE(m_libstc_plus_plus_star, _ZdlPv, __builtin_delete );
-FREE(m_libc_dot_so_dot_6, _ZdlPv, __builtin_delete );
+FREE(m_libc_dot_so_star, _ZdlPv, __builtin_delete );
=20
// operator delete(void*, std::nothrow_t const&), GNU mangling
FREE(m_libstc_plus_plus_star, _ZdlPvRKSt9nothrow_t, __builtin_delete );
-FREE(m_libc_dot_so_dot_6, _ZdlPvRKSt9nothrow_t, __builtin_delete );
+FREE(m_libc_dot_so_star, _ZdlPvRKSt9nothrow_t, __builtin_delete );
=20
// operator delete[](void*), GNU mangling
FREE(m_libstc_plus_plus_star, __builtin_vec_delete, __builtin_vec_delet=
e );
-FREE(m_libc_dot_so_dot_6, __builtin_vec_delete, __builtin_vec_delet=
e );
+FREE(m_libc_dot_so_star, __builtin_vec_delete, __builtin_vec_delet=
e );
FREE(m_libstc_plus_plus_star, _ZdaPv, __builtin_vec_delet=
e );
-FREE(m_libc_dot_so_dot_6, _ZdaPv, __builtin_vec_delet=
e );
+FREE(m_libc_dot_so_star, _ZdaPv, __builtin_vec_delet=
e );
=20
// operator delete[](void*, std::nothrow_t const&), GNU mangling
FREE(m_libstc_plus_plus_star, _ZdaPvRKSt9nothrow_t, __builtin_vec_delet=
e );
-FREE(m_libc_dot_so_dot_6, _ZdaPvRKSt9nothrow_t, __builtin_vec_delet=
e );
+FREE(m_libc_dot_so_star, _ZdaPvRKSt9nothrow_t, __builtin_vec_delet=
e );
=20
=20
#define CALLOC(soname, fnname) \
@@ -276,7 +276,7 @@
return v; \
}
=20
-CALLOC(m_libc_dot_so_dot_6, calloc);
+CALLOC(m_libc_dot_so_star, calloc);
=20
=20
#define REALLOC(soname, fnname) \
@@ -291,9 +291,9 @@
if (ptrV =3D=3D NULL) \
/* We need to call a malloc-like function; so let's use \
one which we know exists. */ \
- return VG_REPLACE_FUNCTION(libcZdsoZd6,malloc) (new_size); \
+ return VG_REPLACE_FUNCTION(libcZdsoZa,malloc) (new_size); \
if (new_size <=3D 0) { \
- VG_REPLACE_FUNCTION(libcZdsoZd6,free)(ptrV); \
+ VG_REPLACE_FUNCTION(libcZdsoZa,free)(ptrV); \
MALLOC_TRACE(" =3D 0"); \
return NULL; \
} \
@@ -303,7 +303,7 @@
return v; \
}
=20
-REALLOC(m_libc_dot_so_dot_6, realloc);
+REALLOC(m_libc_dot_so_star, realloc);
=20
=20
#define MEMALIGN(soname, fnname) \
@@ -329,7 +329,7 @@
return v; \
}
=20
-MEMALIGN(m_libc_dot_so_dot_6, memalign);
+MEMALIGN(m_libc_dot_so_star, memalign);
=20
=20
#define VALLOC(soname, fnname) \
@@ -337,10 +337,10 @@
void* VG_REPLACE_FUNCTION(soname,fnname) ( SizeT size ); \
void* VG_REPLACE_FUNCTION(soname,fnname) ( SizeT size ) \
{ \
- return VG_REPLACE_FUNCTION(libcZdsoZd6,memalign)(VKI_PAGE_SIZE, si=
ze); \
+ return VG_REPLACE_FUNCTION(libcZdsoZa,memalign)(VKI_PAGE_SIZE, siz=
e); \
}
=20
-VALLOC(m_libc_dot_so_dot_6, valloc);
+VALLOC(m_libc_dot_so_star, valloc);
=20
=20
/* Various compatibility wrapper functions, for glibc and libstdc++. */
@@ -355,7 +355,7 @@
return 1; \
}
=20
-MALLOPT(m_libc_dot_so_dot_6, mallopt);
+MALLOPT(m_libc_dot_so_star, mallopt);
=20
=20
#define POSIX_MEMALIGN(soname, fnname) \
@@ -371,7 +371,7 @@
|| (alignment & (alignment - 1)) !=3D 0) \
return VKI_EINVAL; \
\
- mem =3D VG_REPLACE_FUNCTION(libcZdsoZd6,memalign)(alignment, size)=
; \
+ mem =3D VG_REPLACE_FUNCTION(libcZdsoZa,memalign)(alignment, size);=
\
\
if (mem !=3D NULL) { \
*memptr =3D mem; \
@@ -381,7 +381,7 @@
return VKI_ENOMEM; \
}
=20
-POSIX_MEMALIGN(m_libc_dot_so_dot_6, posix_memalign);
+POSIX_MEMALIGN(m_libc_dot_so_star, posix_memalign);
=20
=20
#define MALLOC_USABLE_SIZE(soname, fnname) \
@@ -403,7 +403,7 @@
return pszB; \
}
=20
-MALLOC_USABLE_SIZE(m_libc_dot_so_dot_6, malloc_usable_size);
+MALLOC_USABLE_SIZE(m_libc_dot_so_star, malloc_usable_size);
=20
=20
/* Bomb out if we get any of these. */
@@ -423,11 +423,11 @@
panic(#fnname); \
}
=20
-PANIC(m_libc_dot_so_dot_6, pvalloc);
-PANIC(m_libc_dot_so_dot_6, malloc_stats);
-PANIC(m_libc_dot_so_dot_6, malloc_trim);
-PANIC(m_libc_dot_so_dot_6, malloc_get_state);
-PANIC(m_libc_dot_so_dot_6, malloc_set_state);
+PANIC(m_libc_dot_so_star, pvalloc);
+PANIC(m_libc_dot_so_star, malloc_stats);
+PANIC(m_libc_dot_so_star, malloc_trim);
+PANIC(m_libc_dot_so_star, malloc_get_state);
+PANIC(m_libc_dot_so_star, malloc_set_state);
=20
// mi must be static; if it is auto then Memcheck thinks it is
// uninitialised when used by the caller of this function, because Memch=
eck
@@ -444,7 +444,7 @@
return mi; \
}
=20
-MALLINFO(m_libc_dot_so_dot_6, mallinfo);
+MALLINFO(m_libc_dot_so_star, mallinfo);
=20
=20
/* All the code in here is unused until this function is called */
Modified: trunk/memcheck/mac_replace_strmem.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mac_replace_strmem.c 2005-10-13 15:29:39 UTC (rev 4915=
)
+++ trunk/memcheck/mac_replace_strmem.c 2005-10-13 15:51:12 UTC (rev 4916=
)
@@ -118,7 +118,7 @@
}
=20
// Some handy Z-encoded names
-#define m_libc_so_6 libcZdsoZd6 // libc.so.6
+#define m_libc_so_star libcZdsoZa // libc.so*
#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
=20
@@ -138,8 +138,8 @@
}
=20
// Apparently rindex() is the same thing as strrchr()
-STRRCHR(m_libc_so_6, strrchr)
-STRRCHR(m_libc_so_6, rindex)
+STRRCHR(m_libc_so_star, strrchr)
+STRRCHR(m_libc_so_star, rindex)
STRRCHR(m_ld_linux_so_2, rindex)
=20
=20
@@ -157,10 +157,10 @@
}
=20
// Apparently index() is the same thing as strchr()
-STRCHR(m_libc_so_6, strchr)
+STRCHR(m_libc_so_star, strchr)
STRCHR(m_ld_linux_so_2, strchr)
STRCHR(m_ld_linux_x86_64_so_2, strchr)
-STRCHR(m_libc_so_6, index)
+STRCHR(m_libc_so_star, index)
STRCHR(m_ld_linux_so_2, index)
STRCHR(m_ld_linux_x86_64_so_2, index)
=20
@@ -186,7 +186,7 @@
return dst_orig; \
}
=20
-STRCAT(m_libc_so_6, strcat)
+STRCAT(m_libc_so_star, strcat)
=20
=20
#define STRNCAT(soname, fnname) \
@@ -212,7 +212,7 @@
return dst_orig; \
}
=20
-STRNCAT(m_libc_so_6, strncat)
+STRNCAT(m_libc_so_star, strncat)
=20
=20
#define STRNLEN(soname, fnname) \
@@ -224,7 +224,7 @@
return i; \
}
=20
-STRNLEN(m_libc_so_6, strnlen)
+STRNLEN(m_libc_so_star, strnlen)
=20
=20
// Note that this replacement often doesn't get used because gcc inlines
@@ -240,7 +240,7 @@
return i; \
}
=20
-STRLEN(m_libc_so_6, strlen)
+STRLEN(m_libc_so_star, strlen)
STRLEN(m_ld_linux_so_2, strlen)
STRLEN(m_ld_linux_x86_64_so_2, strlen)
=20
@@ -266,7 +266,7 @@
return dst_orig; \
}
=20
-STRCPY(m_libc_so_6, strcpy)
+STRCPY(m_libc_so_star, strcpy)
=20
=20
#define STRNCPY(soname, fnname) \
@@ -287,7 +287,7 @@
return dst_orig; \
}
=20
-STRNCPY(m_libc_so_6, strncpy)
+STRNCPY(m_libc_so_star, strncpy)
=20
=20
#define STRNCMP(soname, fnname) \
@@ -308,7 +308,7 @@
} \
}
=20
-STRNCMP(m_libc_so_6, strncmp)
+STRNCMP(m_libc_so_star, strncmp)
=20
=20
#define STRCMP(soname, fnname) \
@@ -329,7 +329,7 @@
return 0; \
}
=20
-STRCMP(m_libc_so_6, strcmp)
+STRCMP(m_libc_so_star, strcmp)
STRCMP(m_ld_linux_x86_64_so_2, strcmp)
=20
=20
@@ -345,7 +345,7 @@
return NULL; \
}
=20
-MEMCHR(m_libc_so_6, memchr)
+MEMCHR(m_libc_so_star, memchr)
=20
=20
#define MEMCPY(soname, fnname) \
@@ -391,7 +391,7 @@
return dst; \
}
=20
-MEMCPY(m_libc_so_6, memcpy)
+MEMCPY(m_libc_so_star, memcpy)
=20
=20
#define MEMCMP(soname, fnname) \
@@ -417,8 +417,8 @@
return 0; \
}
=20
-MEMCMP(m_libc_so_6, memcmp)
-MEMCMP(m_libc_so_6, bcmp)
+MEMCMP(m_libc_so_star, memcmp)
+MEMCMP(m_libc_so_star, bcmp)
=20
=20
/* Copy SRC to DEST, returning the address of the terminating '\0' in
@@ -444,7 +444,7 @@
return dst; \
}
=20
-STPCPY(m_libc_so_6, stpcpy)
+STPCPY(m_libc_so_star, stpcpy)
STPCPY(m_ld_linux_so_2, stpcpy)
STPCPY(m_ld_linux_x86_64_so_2, stpcpy)
=20
@@ -461,7 +461,7 @@
return s; \
}
=20
-MEMSET(m_libc_so_6, memset)
+MEMSET(m_libc_so_star, memset)
=20
=20
#define MEMMOVE(soname, fnname) \
@@ -483,7 +483,7 @@
return dst; \
}
=20
-MEMMOVE(m_libc_so_6, memmove)
+MEMMOVE(m_libc_so_star, memmove)
=20
=20
/* Find the first occurrence of C in S or the final NUL byte. */
@@ -500,7 +500,7 @@
} \
}
=20
-GLIBC232_STRCHRNUL(m_libc_so_6, strchrnul)
+GLIBC232_STRCHRNUL(m_libc_so_star, strchrnul)
=20
=20
/* Find the first occurrence of C in S. */
@@ -516,7 +516,7 @@
} \
}
=20
-GLIBC232_RAWMEMCHR(m_libc_so_6, rawmemchr)
+GLIBC232_RAWMEMCHR(m_libc_so_star, rawmemchr)
=20
=20
/*--------------------------------------------------------------------*/
|