|
From: Julian S. <js...@ac...> - 2003-12-21 23:55:29
|
CVS commit by jseward:
Use the redir machinery to forcibly remap stpcpy in libc.so.6 to our
own version in mac_replace_strmem.c. We have to do this the hard way
because overenthusiastic PLT bypassing in glibc means the usual
symbol-override stuff doesn't work. IOW, for the usual reason that we
have to use the redir machinery at all.
This makes many programs run much more quietly on SuSE 9.
M +11 -5 vg_symtab2.c 1.67
--- valgrind/coregrind/vg_symtab2.c #1.66:1.67
@@ -2107,4 +2107,9 @@ void VG_(add_redirect_sym)(const Char *f
redir->to_addr = 0;
+ if (VG_(clo_verbosity) >= 2)
+ VG_(message)(Vg_UserMsg,
+ "REDIRECT %s(%s) to %s(%s)",
+ from_lib, from_sym, to_lib, to_sym);
+
if (!resolve_redir_allsegs(redir)) {
/* can't resolve immediately; add to list */
@@ -2164,11 +2169,12 @@ void VG_(setup_code_redirect_table) ( vo
VG_(add_redirect_sym)("soname:libc.so.6", redirects[i].from,
"soname:libpthread.so.0", redirects[i].to);
-
- if (VG_(clo_verbosity) >= 2)
- VG_(message)(Vg_UserMsg,
- "REPLACING libc(%s) with libpthread(%s)",
- redirects[i].from, redirects[i].to);
}
+ /* Overenthusiastic use of PLT bypassing by the glibc people also
+ means we need to patch the following functions to our own
+ implementations of said, in mac_replace_strmem.c.
+ */
+ VG_(add_redirect_sym)("soname:libc.so.6", "stpcpy",
+ "*vgpreload_memcheck.so*", "stpcpy");
}
|