DRD/Darwin: Ignore races triggered by the dynamic loader (dyld) lazy binding mechanism.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11597 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_darwin_intercepts.c b/drd/drd_darwin_intercepts.c
index eae2552..67fd3e2 100644
--- a/drd/drd_darwin_intercepts.c
+++ b/drd/drd_darwin_intercepts.c
@@ -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