* Sync up to trunk head (r64377).
[reactos.git] / dll / win32 / dbghelp / macho_module.c
index 67ee681..e37a199 100644 (file)
@@ -383,6 +383,11 @@ static int macho_accum_segs_range(struct macho_file_map* fmap,
         TRACE("Ignoring special Wine segment %s\n", debugstr_an(sc->segname, sizeof(sc->segname)));
         return 0;
     }
+    if (!strncmp(sc->segname, "__PAGEZERO", 10))
+    {
+        TRACE("Ignoring __PAGEZERO segment\n");
+        return 0;
+    }
 
     /* If this segment starts before previously-known earliest, record
      * new earliest. */
@@ -1005,6 +1010,8 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
         struct module_format*   modfmt =
             HeapAlloc(GetProcessHeap(), 0, sizeof(struct module_format) + sizeof(struct macho_module_info));
         if (!modfmt) goto leave;
+        if (!load_addr)
+            load_addr = fmap.segs_start;
         macho_info->module = module_new(pcs, filename, DMT_MACHO, FALSE, load_addr,
                                         fmap.segs_size, 0, calc_crc32(fmap.fd));
         if (!macho_info->module)