]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
DRD/Darwin: Ignore races triggered by the dynamic loader (dyld) lazy binding mechanism.
authorBart Van Assche <bvanassche@acm.org>
Sun, 6 Mar 2011 16:33:08 +0000 (16:33 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 6 Mar 2011 16:33:08 +0000 (16:33 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11597

drd/drd_darwin_intercepts.c

index eae2552109ef91c7f046aed546b5d739170e8940..67fd3e24536e73345341f1e70f26c6ea57da77e5 100644 (file)
@@ -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 @@ 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