From: Bart Van Assche Date: Sun, 6 Mar 2011 16:33:08 +0000 (+0000) Subject: DRD/Darwin: Ignore races triggered by the dynamic loader (dyld) lazy binding mechanism. X-Git-Tag: svn/VALGRIND_3_7_0~632 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=07a0082c5190dc124830774d606b65557408f6a2;p=thirdparty%2Fvalgrind.git DRD/Darwin: Ignore races triggered by the dynamic loader (dyld) lazy binding mechanism. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11597 --- diff --git a/drd/drd_darwin_intercepts.c b/drd/drd_darwin_intercepts.c index eae2552109..67fd3e2453 100644 --- a/drd/drd_darwin_intercepts.c +++ b/drd/drd_darwin_intercepts.c @@ -1,21 +1,21 @@ #include #include #include "valgrind.h" +#include "drd.h" #include "pub_tool_redir.h" -#if 0 - /* * On Mac OS X shared library functions are lazily bound. The binding mechanism - * uses self-modifying code. Intercept dyld_stub_binder() in order to suppress + * uses self-modifying code. Intercept fastBindLazySymbol() in order to suppress * the data accesses involved in this mechanism. * * See also the Mac OS X ABI Dynamic Loader Reference (http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/MachOReference/Reference/reference.html#//apple_ref/c/func/dyld_stub_binding_helper). * See also the dyld_stub_binder() source code (http://www.opensource.apple.com/source/dyld/dyld-132.13/src/dyld_stub_binder.s). + * See also the dyld::fastBindLazySymbol() source code (http://opensource.apple.com/source/dyld/dyld-132.13/src/dyld.cpp). */ -void* VG_WRAP_FUNCTION_ZZ(libSystemZdZaZddylib, dyldZustubZubinder) +void* VG_WRAP_FUNCTION_ZZ(dyld, ZuZZN4dyld18fastBindLazySymbolEPP11ImageLoaderm) (void** imageLoaderCache, uintptr_t lazyBindingInfoOffset); -void* VG_WRAP_FUNCTION_ZZ(libSystemZdZaZddylib, dyldZustubZubinder) +void* VG_WRAP_FUNCTION_ZZ(dyld, ZuZZN4dyld18fastBindLazySymbolEPP11ImageLoaderm) (void** imageLoaderCache, uintptr_t lazyBindingInfoOffset) { void* res; @@ -23,9 +23,9 @@ void* VG_WRAP_FUNCTION_ZZ(libSystemZdZaZddylib, dyldZustubZubinder) VALGRIND_GET_ORIG_FN(fn); + DRD_IGNORE_VAR(*imageLoaderCache); + CALL_FN_W_WW(res, fn, imageLoaderCache, lazyBindingInfoOffset); return res; } - -#endif