[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: [PATCH 06/13] dbghelp: Use local elf_section_header declaration.
From: Jacek Caban <jacek () codeweavers ! com>
Date: 2020-03-31 16:21:51
Message-ID: 233c7efa-24d3-8350-eb05-d87208f6c3cf () codeweavers ! com
[Download RAW message or body]
Based on glibc.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
---
dlls/dbghelp/elf_module.c | 18 +++++++++++++++---
dlls/dbghelp/image_private.h | 18 +++++++++++++++---
2 files changed, 30 insertions(+), 6 deletions(-)
["0006-dbghelp-Use-local-elf_section_header-declaration.txt" (text/x-patch)]
diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c
index cb30eb23d4..3a9af1d15d 100644
--- a/dlls/dbghelp/elf_module.c
+++ b/dlls/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/dlls/dbghelp/image_private.h b/dlls/dbghelp/image_private.h
index 600cf72159..8c6f463ecb 100644
--- a/dlls/dbghelp/image_private.h
+++ b/dlls/dbghelp/image_private.h
@@ -66,6 +66,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
*/
@@ -85,13 +99,11 @@ struct image_file_map
const char* shstrtab;
char* target_copy;
struct elf_header elfhdr;
-#ifdef __ELF__
struct
{
- Elf64_Shdr shdr;
+ struct elf_section_header shdr;
const char* mapped;
}* sect;
-#endif
} elf;
struct macho_file_map
{
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic