it. Also count the number of RW segements. */
extern Bool ML_(check_macho_and_get_rw_loads)( Int fd, Int* rw_loads );
+/* Same as above, but reads from memory instead of a file descriptor. */
+extern Bool ML_(check_macho_and_get_rw_loads_from_memory)( const void* buf, SizeT size, Int* rw_loads );
+
/* The central function for reading Mach-O debug info. For the
object/exe specified by the DebugInfo, find Mach-O sections, then read
the symbols, line number info, file name info, CFA (stack-unwind
Bool MC_(is_valid_aligned_word) ( Addr a )
{
tl_assert(sizeof(UWord) == 4 || sizeof(UWord) == 8);
-#if defined(VGO_darwin)
- // on Darwin some of the memcheck/tests/leak-autofreepool-*
- // tests are failing here. VALGRIND_MALLOCLIKE_BLOCK is passed
- // an address that is not word aligned. But that's also the case
- // on other platforms, on FreeBSD leak-autofreepool 0 uses addresses
- // that are only 2 aligned. The problem is more likely that Darwin
- // should not be looking at this chunk of memory.
- if (!VG_IS_WORD_ALIGNED(a) && VG_(clo_verbosity) > 1)
- {
- VG_(printf)("In %s, invariant violation, pointer %p should be word aligned\n", __func__, (void*)a);
- MC_(pp_describe_addr) (VG_(current_DiEpoch)(), a);
- }
-#else
tl_assert(VG_IS_WORD_ALIGNED(a));
-#endif
if (get_vabits8_for_aligned_word32 (a) != VA_BITS8_DEFINED)
return False;
if (sizeof(UWord) == 8) {