https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2a7f64af1fe12fc4521e8c8191b3be9348ec78fd

commit 2a7f64af1fe12fc4521e8c8191b3be9348ec78fd
Author:     winesync <[email protected]>
AuthorDate: Fri Sep 11 18:56:31 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Sep 16 10:35:52 2020 +0200

    [WINESYNC] dbghelp: Use local elf_section_header declaration.
    
    Based on glibc.
    
    Signed-off-by: Jacek Caban <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id a6f0fe8d1ca16243771784ec34c49453c96e6479 by Jacek Caban 
<[email protected]>
---
 dll/win32/dbghelp/elf_module.c    | 18 +++++++++++++++---
 dll/win32/dbghelp/image_private.h | 18 +++++++++++++++---
 sdk/tools/winesync/dbghelp.cfg    |  2 +-
 3 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c
index cb30eb23d4e..3a9af1d15d0 100644
--- a/dll/win32/dbghelp/elf_module.c
+++ b/dll/win32/dbghelp/elf_module.c
@@ -322,10 +322,22 @@ static BOOL elf_map_shdr(struct elf_map_file_data* emfd, 
struct image_file_map*
 {
     if (fmap->addr_size == 32)
     {
-        Elf32_Shdr shdr32;
+        struct
+        {
+            UINT32  sh_name;       /* Section name (string tbl index) */
+            UINT32  sh_type;       /* Section type */
+            UINT32  sh_flags;      /* Section flags */
+            UINT32  sh_addr;       /* Section virtual addr at execution */
+            UINT32  sh_offset;     /* Section file offset */
+            UINT32  sh_size;       /* Section size in bytes */
+            UINT32  sh_link;       /* Link to another section */
+            UINT32  sh_info;       /* Additional section information */
+            UINT32  sh_addralign;  /* Section alignment */
+            UINT32  sh_entsize;    /* Entry size if section holds table */
+        } shdr32;
 
         if (!elf_map_file_read(fmap, emfd, &shdr32, sizeof(shdr32),
-                               fmap->u.elf.elfhdr.e_shoff + i * 
sizeof(Elf32_Shdr)))
+                               fmap->u.elf.elfhdr.e_shoff + i * 
sizeof(shdr32)))
             return FALSE;
 
         fmap->u.elf.sect[i].shdr.sh_name      = shdr32.sh_name;
@@ -342,7 +354,7 @@ static BOOL elf_map_shdr(struct elf_map_file_data* emfd, 
struct image_file_map*
     else
     {
         if (!elf_map_file_read(fmap, emfd, &fmap->u.elf.sect[i].shdr, 
sizeof(fmap->u.elf.sect[i].shdr),
-                               fmap->u.elf.elfhdr.e_shoff + i * 
sizeof(Elf64_Shdr)))
+                               fmap->u.elf.elfhdr.e_shoff + i * 
sizeof(fmap->u.elf.sect[i].shdr)))
             return FALSE;
     }
     return TRUE;
diff --git a/dll/win32/dbghelp/image_private.h 
b/dll/win32/dbghelp/image_private.h
index 64515ea3a31..d440461cc14 100644
--- a/dll/win32/dbghelp/image_private.h
+++ b/dll/win32/dbghelp/image_private.h
@@ -68,6 +68,20 @@ struct elf_header
     UINT16  e_shstrndx;   /* Section header string table index */
 };
 
+struct elf_section_header
+{
+    UINT32  sh_name;       /* Section name (string tbl index) */
+    UINT32  sh_type;       /* Section type */
+    UINT64  sh_flags;      /* Section flags */
+    UINT64  sh_addr;       /* Section virtual addr at execution */
+    UINT64  sh_offset;     /* Section file offset */
+    UINT64  sh_size;       /* Section size in bytes */
+    UINT32  sh_link;       /* Link to another section */
+    UINT32  sh_info;       /* Additional section information */
+    UINT64  sh_addralign;  /* Section alignment */
+    UINT64  sh_entsize;    /* Entry size if section holds table */
+};
+
 /* structure holding information while handling an ELF image
  * allows one by one section mapping for memory savings
  */
@@ -87,13 +101,11 @@ struct image_file_map
             const char*                        shstrtab;
             char*                       target_copy;
             struct elf_header           elfhdr;
-#if defined(__ELF__) && !defined(DBGHELP_STATIC_LIB)
             struct
             {
-                Elf64_Shdr                      shdr;
+                struct elf_section_header       shdr;
                 const char*                     mapped;
             }*                          sect;
-#endif
         } elf;
         struct macho_file_map
         {
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index f435483c7d9..5791a929905 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: 78845911da06fc75c6d74237f816a1547c24b20b
+  wine: a6f0fe8d1ca16243771784ec34c49453c96e6479

Reply via email to