1b. Then the host loads ld.so and the guest exe. This is done in
the sequence
load_client -> VG_(do_exec) -> VG_(do_exec_inner) ->
- exe_handlers->load_fn ( == VG_(load_ELF) ).
+ exe_handlers->load_fn ( == VG_(load_ELF) )
+ [or load_MACHO].
- This does the mmap'ing and creats the associated NSegments.
+ This does the mmap'ing and creates the associated NSegments.
The NSegments may get merged, (see maybe_merge_nsegments)
so there could be more PT_LOADs than there are NSegments.
static MutexT DRD_(pthread_to_drd_mutex_type)(int kind)
{
/*
+ * Static checkers don't like this as there are repeated branch
+ * but because there is variation between different platforms
+ * it's messy to make something without repetition.
+ *
* See also PTHREAD_MUTEX_KIND_MASK_NP in glibc source file
* <nptl/pthreadP.h>.
*/
else if (kind == PTHREAD_MUTEX_NORMAL)
return mutex_type_default_mutex;
else if (kind == PTHREAD_MUTEX_DEFAULT)
+ // @todo PJF what about Solaris?
+#if defined(VGO_freebsd)
+ return mutex_type_errorcheck_mutex;
+#else
return mutex_type_default_mutex;
+#endif
#if defined(HAVE_PTHREAD_MUTEX_ADAPTIVE_NP)
else if (kind == PTHREAD_MUTEX_ADAPTIVE_NP)
return mutex_type_default_mutex;