OSX 10.9/10.8: Debuginfo reading FSM: enable recording of r-- mappings
so as to enable arrival at acceptance states via calls to
VG_(di_notify_vm_protect).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14139 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
index 6b3e822..13d27f0 100644
--- a/coregrind/m_debuginfo/debuginfo.c
+++ b/coregrind/m_debuginfo/debuginfo.c
@@ -844,7 +844,7 @@
# error "Unknown platform"
# endif
-# if defined(VGP_x86_darwin) && DARWIN_VERS == DARWIN_10_7
+# if defined(VGP_x86_darwin) && DARWIN_VERS >= DARWIN_10_7
is_ro_map = seg->hasR && !seg->hasW && !seg->hasX;
# endif
@@ -981,7 +981,7 @@
}
-/* This is a MacOSX 10.7 32-bit only special. See comments on the
+/* This is a MacOSX >= 10.7 32-bit only special. See comments on the
declaration of struct _DebugInfoFSM for details. */
void VG_(di_notify_vm_protect)( Addr a, SizeT len, UInt prot )
{
diff --git a/coregrind/m_debuginfo/priv_storage.h b/coregrind/m_debuginfo/priv_storage.h
index 5740442..000d5f1 100644
--- a/coregrind/m_debuginfo/priv_storage.h
+++ b/coregrind/m_debuginfo/priv_storage.h
@@ -506,13 +506,19 @@
that is, take the first r-x and rw- mapping we see, and we're done.
- On MacOSX 10.7, 32-bit, there appears to be a new variant:
+ On MacOSX >= 10.7, 32-bit, there appears to be a new variant:
start --> r-- mapping --> rw- mapping
--> upgrade r-- mapping to r-x mapping --> accept
- where the upgrade is done by a call to vm_protect. Hence we
- need to also track this possibility.
+ where the upgrade is done by a call to mach_vm_protect (OSX 10.7)
+ or kernelrpc_mach_vm_protect_trap (OSX 10.9 and possibly 10.8).
+ Hence we need to also track this possibility.
+
+ From perusal of dyld sources, it appears that this scheme could
+ also be used 64 bit libraries, although that doesn't seem to happen
+ in practice. dyld uses this scheme when the text section requires
+ relocation, which only appears to be the case for 32 bit objects.
*/
struct _DebugInfoMapping