From: Julian Seward Date: Thu, 17 Nov 2005 20:15:04 +0000 (+0000) Subject: (ppc32) Only include hacky redirects for malloc-replacing tools. X-Git-Tag: svn/VALGRIND_3_1_0~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3de346b9e3fef137ce39e12662fb06f7b957ba04;p=thirdparty%2Fvalgrind.git (ppc32) Only include hacky redirects for malloc-replacing tools. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5180 --- diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c index a20574f77e..2a1820c218 100644 --- a/coregrind/m_redir.c +++ b/coregrind/m_redir.c @@ -42,6 +42,8 @@ #include "pub_core_redir.h" #include "pub_core_trampoline.h" #include "pub_core_transtab.h" +#include "pub_core_tooliface.h" // VG_(needs).malloc_replacement + /*------------------------------------------------------------*/ /*--- General purpose redirection. ---*/ @@ -375,14 +377,19 @@ void VG_(setup_code_redirect_table) ( void ) #elif defined(VGP_ppc32_linux) - add_redirect_sym_to_addr( - "soname:ld.so.1", "strlen", - (Addr)&VG_(ppc32_linux_REDIR_FOR_strlen) - ); - add_redirect_sym_to_addr( - "soname:ld.so.1", "strcmp", - (Addr)&VG_(ppc32_linux_REDIR_FOR_strcmp) - ); + /* these two drive memcheck nuts if not replaced, and unfortunately + they need to be replaced right at the start, before the dynamic + linker starts. */ + if (VG_(needs).malloc_replacement) { + add_redirect_sym_to_addr( + "soname:ld.so.1", "strlen", + (Addr)&VG_(ppc32_linux_REDIR_FOR_strlen) + ); + add_redirect_sym_to_addr( + "soname:ld.so.1", "strcmp", + (Addr)&VG_(ppc32_linux_REDIR_FOR_strcmp) + ); + } #else # error Unknown platform