Rename vg_preload_core.so to vgpreload_core.so to be consistent with
tool preload modules, which are called vgpreload_<tool>.so. Also
fixed a couple of comments relating to this.
(This need not be merged into 3_0_X.)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4514 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index dcf13fa..4f42ee4 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -30,7 +30,7 @@
val_PROGRAMS = \
stage2 \
- vg_preload_core.so
+ vgpreload_core.so
noinst_HEADERS = \
coregrind.h \
@@ -171,12 +171,12 @@
stage2_LDADD= $(stage2_extra) \
-ldl
-vg_preload_core_so_SOURCES = vg_preloaded.c
-vg_preload_core_so_CFLAGS = $(AM_CFLAGS) -fpic
-vg_preload_core_so_LDADD = -ldl
-vg_preload_core_so_LDFLAGS = \
+vgpreload_core_so_SOURCES = vg_preloaded.c
+vgpreload_core_so_CFLAGS = $(AM_CFLAGS) -fpic
+vgpreload_core_so_LDADD = -ldl
+vgpreload_core_so_LDFLAGS = \
-shared \
- -Wl,--soname,vg_preload_core.so \
+ -Wl,--soname,vgpreload_core.so \
-Wl,-z,initfirst
# Extract ld's default linker script and hack it to our needs.
diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c
index 0851003..a17959e 100644
--- a/coregrind/m_libcproc.c
+++ b/coregrind/m_libcproc.c
@@ -206,7 +206,7 @@
buf = VG_(arena_malloc)(VG_AR_CORE, VG_(strlen)(VG_(libdir)) + 20);
// Remove Valgrind-specific entries from LD_*.
- VG_(sprintf)(buf, "%s*/vg_preload_core.so", VG_(libdir));
+ VG_(sprintf)(buf, "%s*/vgpreload_core.so", VG_(libdir));
mash_colon_env(ld_preload_str, buf);
VG_(sprintf)(buf, "%s*/vgpreload_*.so", VG_(libdir));
mash_colon_env(ld_preload_str, buf);
diff --git a/coregrind/m_main.c b/coregrind/m_main.c
index 93f34ab..e550457 100644
--- a/coregrind/m_main.c
+++ b/coregrind/m_main.c
@@ -561,7 +561,7 @@
/* Prepare the client's environment. This is basically a copy of our
environment, except:
- LD_PRELOAD=$VALGRINDLIB/vg_preload_core.so:($VALGRINDLIB/vgpreload_TOOL.so:)?$LD_PRELOAD
+ LD_PRELOAD=$VALGRINDLIB/vgpreload_core.so:($VALGRINDLIB/vgpreload_TOOL.so:)?$LD_PRELOAD
If this is missing, then it is added.
@@ -572,7 +572,7 @@
*/
static char **fix_environment(char **origenv, const char *preload)
{
- static const char preload_core_so[] = "vg_preload_core.so";
+ static const char preload_core_so[] = "vgpreload_core.so";
static const char ld_preload[] = "LD_PRELOAD=";
static const char valgrind_clo[] = VALGRINDCLO "=";
static const int ld_preload_len = sizeof(ld_preload)-1;
@@ -586,8 +586,7 @@
int envc;
const int preloadlen = (preload == NULL) ? 0 : strlen(preload);
- /* Find the vg_preload_core.so; also make room for the tool preload
- library */
+ // Find the vgpreload_core.so; also make room for the tool preload library
preload_core_path_len = sizeof(preload_core_so) + vgliblen + preloadlen + 16;
preload_core_path = malloc(preload_core_path_len);
vg_assert(preload_core_path);
diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c
index 41c257e..9885e77 100644
--- a/coregrind/m_syswrap/syswrap-generic.c
+++ b/coregrind/m_syswrap/syswrap-generic.c
@@ -2329,7 +2329,7 @@
VG_(reap_threads)(tid);
// Remove the valgrind-specific stuff from the environment so the
- // child doesn't get vg_preload_core.so, vg_preload_TOOL.so, etc.
+ // child doesn't get vgpreload_core.so, vgpreload_<tool>.so, etc.
// This is done unconditionally, since if we are tracing the child,
// stage1/2 will set up the appropriate client environment.
// Nb: we make a copy of the environment before trying to mangle it
diff --git a/coregrind/pub_core_redir.h b/coregrind/pub_core_redir.h
index 3743588..873a4a5 100644
--- a/coregrind/pub_core_redir.h
+++ b/coregrind/pub_core_redir.h
@@ -85,7 +85,7 @@
replacement.
Functions named with this macro should be in client space, ie. in
- vg_preload_<tool>.h or vg_preload_core.h. */
+ vgpreload_<tool>.h or vgpreload_core.h. */
#define VG_NOTIFY_ON_LOAD(name) _vgw_##name
#define VG_NOTIFY_ON_LOAD_PREFIX "_vgw_"
diff --git a/include/pub_tool_redir.h b/include/pub_tool_redir.h
index 8a65715..2e657ed 100644
--- a/include/pub_tool_redir.h
+++ b/include/pub_tool_redir.h
@@ -64,7 +64,8 @@
Note also that the replacement function should probably (must be?) in
client space, so it runs on the simulated CPU. So it must be in
- either vg_preload_<tool>.so or vg_preload_core.so.
+ either vgpreload_<tool>.so or vgpreload_core.so. It also only works
+ with functions in shared objects, I think.
It is important that the Z-encoded soname contains no unencoded
underscores, since the intercept-handlers in vg_symtab2.c detect