|
From: <sv...@va...> - 2011-03-06 16:33:21
|
Author: bart Date: 2011-03-06 16:33:08 +0000 (Sun, 06 Mar 2011) New Revision: 11597 Log: DRD/Darwin: Ignore races triggered by the dynamic loader (dyld) lazy binding mechanism. Modified: trunk/drd/drd_darwin_intercepts.c Modified: trunk/drd/drd_darwin_intercepts.c =================================================================== --- trunk/drd/drd_darwin_intercepts.c 2011-03-06 12:39:12 UTC (rev 11596) +++ trunk/drd/drd_darwin_intercepts.c 2011-03-06 16:33:08 UTC (rev 11597) @@ -1,21 +1,21 @@ #include <stdint.h> #include <stdio.h> #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 @@ VALGRIND_GET_ORIG_FN(fn); + DRD_IGNORE_VAR(*imageLoaderCache); + CALL_FN_W_WW(res, fn, imageLoaderCache, lazyBindingInfoOffset); return res; } - -#endif |