From: Bart Van Assche Date: Sun, 1 Jun 2008 16:33:37 +0000 (+0000) Subject: Changed _Spec::mandatory from HChar* into const HChar*. If no symbol information... X-Git-Tag: svn/VALGRIND_3_4_0~529 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46f92fc29fe38b0452621bdca673c2e9a94639fe;p=thirdparty%2Fvalgrind.git Changed _Spec::mandatory from HChar* into const HChar*. If no symbol information is found in ld.so during startup of the exp-drd tool, let Valgrind abort and print an informative error message. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8170 --- diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c index f4787079cf..959fecdef8 100644 --- a/coregrind/m_redir.c +++ b/coregrind/m_redir.c @@ -222,7 +222,7 @@ typedef HChar* from_fnpatt; /* from fnname pattern */ Addr to_addr; /* where redirecting to */ Bool isWrap; /* wrap or replacement? */ - HChar* mandatory; /* non-NULL ==> abort V and print the + const HChar* mandatory; /* non-NULL ==> abort V and print the string if from_sopatt is loaded but from_fnpatt cannot be found */ /* VARIABLE PARTS -- used transiently whilst processing redirections */ @@ -807,7 +807,7 @@ static void add_hardwired_active ( Addr from, Addr to ) __attribute__((unused)) /* not used on all platforms */ static void add_hardwired_spec ( HChar* sopatt, HChar* fnpatt, Addr to_addr, - HChar* mandatory ) + const HChar* const mandatory ) { Spec* spec = dinfo_zalloc(sizeof(Spec)); vg_assert(spec); @@ -878,13 +878,14 @@ void VG_(redir_initialise) ( void ) ); # elif defined(VGP_ppc32_linux) + { + static const HChar croakage[] + = "Possible fix: install glibc's debuginfo package on this machine."; + /* If we're using memcheck, use these intercepts right from the start, otherwise ld.so makes a lot of noise. */ if (0==VG_(strcmp)("Memcheck", VG_(details).name)) { - static HChar* croakage = "Possible fix: install glibc's debuginfo " - "package on this machine."; - /* this is mandatory - can't sanely continue without it */ add_hardwired_spec( "ld.so.1", "strlen", @@ -903,16 +904,27 @@ void VG_(redir_initialise) ( void ) NULL /* not mandatory - so why bother at all? */ /* glibc-2.6.1 (openSUSE 10.3, ppc32) seems fine without it */ ); + } else if (0 == VG_(strcmp)("exp-drd", VG_(details).name)) { + /* Only continue if symbol information in ld.so.1 is present, */ + /* because otherwise exp-drd's suppression patterns on ld.so do */ + /* not have any effect. */ + add_hardwired_spec( + "ld.so.1", "strlen", + (Addr)(&VG_(ppc32_linux_REDIR_FOR_strlen)), + croakage + ); + } } # elif defined(VGP_ppc64_linux) + { + static const HChar croakage[] + = "Possible fix: install glibc's debuginfo package on this machine."; + /* If we're using memcheck, use these intercepts right from the start, otherwise ld.so makes a lot of noise. */ if (0==VG_(strcmp)("Memcheck", VG_(details).name)) { - static HChar* croakage = "Possible fix: install glibc's debuginfo " - "package on this machine."; - /* this is mandatory - can't sanely continue without it */ add_hardwired_spec( "ld64.so.1", "strlen", @@ -927,6 +939,16 @@ void VG_(redir_initialise) ( void ) /* glibc-2.5 (FC6, ppc64) seems fine without it */ ); + } else if (0 == VG_(strcmp)("exp-drd", VG_(details).name)) { + /* Only continue if symbol information in ld64.so.1 is present, */ + /* because otherwise exp-drd's suppression patterns on ld.so do */ + /* not have any effect. */ + add_hardwired_spec( + "ld64.so.1", "strlen", + (Addr)VG_(fnptr_to_fnentry)( &VG_(ppc64_linux_REDIR_FOR_strlen) ), + croakage + ); + } } # elif defined(VGP_ppc32_aix5)