https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eff9360f470df98758c0f…
commit eff9360f470df98758c0fb103632cc0349a91d1d
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Fri Sep 11 18:59:48 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Sep 16 10:35:54 2020 +0200
[WINESYNC] dbghelp: Use local macho section declaration.
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 64341284c58bcc22f13f8146bcb6c8a08c0c4ff2 by Jacek Caban
<jacek(a)codeweavers.com>
---
dll/win32/dbghelp/image_private.h | 45 ++++++++++++++++++++++++++++-----------
dll/win32/dbghelp/macho_module.c | 4 ++--
sdk/tools/winesync/dbghelp.cfg | 2 +-
3 files changed, 35 insertions(+), 16 deletions(-)
diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h
index 947ee4aee67..1a5a24bc580 100644
--- a/dll/win32/dbghelp/image_private.h
+++ b/dll/win32/dbghelp/image_private.h
@@ -21,16 +21,6 @@
#pragma once
-#ifdef HAVE_LINK_H
-# include <link.h>
-#endif
-#ifdef HAVE_SYS_LINK_H
-# include <sys/link.h>
-#endif
-#ifdef HAVE_MACH_O_LOADER_H
-#include <mach-o/loader.h>
-#endif
-
#define IMAGE_NO_MAP ((void*)-1)
struct elf_header
@@ -78,6 +68,37 @@ struct macho_uuid_command
UINT8 uuid[16];
};
+struct macho_section
+{
+ char sectname[16]; /* name of this section */
+ char segname[16]; /* segment this section goes in */
+ UINT64 addr; /* memory address of this section */
+ UINT64 size; /* size in bytes of this section */
+ UINT32 offset; /* file offset of this section */
+ UINT32 align; /* section alignment (power of 2) */
+ UINT32 reloff; /* file offset of relocation entries */
+ UINT32 nreloc; /* number of relocation entries */
+ UINT32 flags; /* flags (section type and attributes)*/
+ UINT32 reserved1; /* reserved (for offset or index) */
+ UINT32 reserved2; /* reserved (for count or sizeof) */
+ UINT32 reserved3; /* reserved */
+};
+
+struct macho_section32
+{
+ char sectname[16]; /* name of this section */
+ char segname[16]; /* segment this section goes in */
+ UINT32 addr; /* memory address of this section */
+ UINT32 size; /* size in bytes of this section */
+ UINT32 offset; /* file offset of this section */
+ UINT32 align; /* section alignment (power of 2) */
+ UINT32 reloff; /* file offset of relocation entries */
+ UINT32 nreloc; /* number of relocation entries */
+ UINT32 flags; /* flags (section type and attributes)*/
+ UINT32 reserved1; /* reserved (for offset or index) */
+ UINT32 reserved2; /* reserved (for count or sizeof) */
+};
+
/* structure holding information while handling an ELF image
* allows one by one section mapping for memory savings
*/
@@ -120,15 +141,13 @@ struct image_file_map
* read from arch_offset. */
unsigned arch_offset;
-#ifdef HAVE_MACH_O_LOADER_H
int num_sections;
struct
{
- struct section_64 section;
+ struct macho_section section;
const char* mapped;
unsigned int ignored : 1;
}* sect;
-#endif
} macho;
struct pe_file_map
{
diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c
index ac4e8cbb7e5..0e532c354b3 100644
--- a/dll/win32/dbghelp/macho_module.c
+++ b/dll/win32/dbghelp/macho_module.c
@@ -624,7 +624,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const
struct mach
{
if (ifm->addr_size == 32)
{
- const struct section *section = &((const struct section *)sections)[i];
+ const struct macho_section32 *section = &((const struct macho_section32
*)sections)[i];
memcpy(fmap->sect[info->section_index].section.sectname,
section->sectname, sizeof(section->sectname));
memcpy(fmap->sect[info->section_index].section.segname,
section->segname, sizeof(section->segname));
fmap->sect[info->section_index].section.addr = section->addr;
@@ -636,7 +636,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const
struct mach
fmap->sect[info->section_index].section.flags = section->flags;
}
else
- fmap->sect[info->section_index].section = ((const struct section_64
*)sections)[i];
+ fmap->sect[info->section_index].section = ((const struct macho_section
*)sections)[i];
fmap->sect[info->section_index].mapped = IMAGE_NO_MAP;
fmap->sect[info->section_index].ignored = ignore;
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index b5400813eb8..c05f3af56ae 100644
--- a/sdk/tools/winesync/dbghelp.cfg
+++ b/sdk/tools/winesync/dbghelp.cfg
@@ -4,4 +4,4 @@ files:
include/dbghelp.h: sdk/include/psdk/dbghelp.h
include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
tags:
- wine: c695e7e99e0a06b6039d46f98fea35c363aa6cbe
+ wine: 64341284c58bcc22f13f8146bcb6c8a08c0c4ff2