mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[WINESYNC] dbghelp: Translate the 32-bit ELF header to the 64-bit one.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 799e0bfa57c4c2a7922c43031bd0d95c6add6a1a by Zebediah Figura <zfigura@codeweavers.com>
This commit is contained in:
parent
7adbd03d5f
commit
1983f47206
3 changed files with 29 additions and 6 deletions
|
@ -351,8 +351,33 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
|
|||
|
||||
fmap->addr_size = e_ident[EI_CLASS] == ELFCLASS64 ? 64 : 32;
|
||||
|
||||
if (!elf_map_file_read(fmap, emfd, &fmap->u.elf.elfhdr, sizeof(fmap->u.elf.elfhdr), 0))
|
||||
goto done;
|
||||
if (fmap->addr_size == 32)
|
||||
{
|
||||
Elf32_Ehdr elfhdr32;
|
||||
|
||||
if (!elf_map_file_read(fmap, emfd, &elfhdr32, sizeof(elfhdr32), 0))
|
||||
goto done;
|
||||
|
||||
memcpy(fmap->u.elf.elfhdr.e_ident, elfhdr32.e_ident, EI_NIDENT);
|
||||
fmap->u.elf.elfhdr.e_type = elfhdr32.e_type;
|
||||
fmap->u.elf.elfhdr.e_machine = elfhdr32.e_machine;
|
||||
fmap->u.elf.elfhdr.e_version = elfhdr32.e_version;
|
||||
fmap->u.elf.elfhdr.e_entry = elfhdr32.e_entry;
|
||||
fmap->u.elf.elfhdr.e_phoff = elfhdr32.e_phoff;
|
||||
fmap->u.elf.elfhdr.e_shoff = elfhdr32.e_shoff;
|
||||
fmap->u.elf.elfhdr.e_flags = elfhdr32.e_flags;
|
||||
fmap->u.elf.elfhdr.e_ehsize = elfhdr32.e_ehsize;
|
||||
fmap->u.elf.elfhdr.e_phentsize = elfhdr32.e_phentsize;
|
||||
fmap->u.elf.elfhdr.e_phnum = elfhdr32.e_phnum;
|
||||
fmap->u.elf.elfhdr.e_shentsize = elfhdr32.e_shentsize;
|
||||
fmap->u.elf.elfhdr.e_shnum = elfhdr32.e_shnum;
|
||||
fmap->u.elf.elfhdr.e_shstrndx = elfhdr32.e_shstrndx;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!elf_map_file_read(fmap, emfd, &fmap->u.elf.elfhdr, sizeof(fmap->u.elf.elfhdr), 0))
|
||||
goto done;
|
||||
}
|
||||
|
||||
fmap->u.elf.sect = HeapAlloc(GetProcessHeap(), 0,
|
||||
fmap->u.elf.elfhdr.e_shnum * sizeof(fmap->u.elf.sect[0]));
|
||||
|
|
|
@ -61,14 +61,12 @@ typedef struct section macho_section;
|
|||
#if defined(__ELF__) && !defined(DBGHELP_STATIC_LIB)
|
||||
|
||||
#ifdef _WIN64
|
||||
#define Elf_Ehdr Elf64_Ehdr
|
||||
#define Elf_Shdr Elf64_Shdr
|
||||
#define Elf_Phdr Elf64_Phdr
|
||||
#define Elf_Dyn Elf64_Dyn
|
||||
#define Elf_Sym Elf64_Sym
|
||||
#define Elf_auxv_t Elf64_auxv_t
|
||||
#else
|
||||
#define Elf_Ehdr Elf32_Ehdr
|
||||
#define Elf_Shdr Elf32_Shdr
|
||||
#define Elf_Phdr Elf32_Phdr
|
||||
#define Elf_Dyn Elf32_Dyn
|
||||
|
@ -99,7 +97,7 @@ struct image_file_map
|
|||
struct image_file_map* alternate; /* another ELF file (linked to this one) */
|
||||
char* target_copy;
|
||||
#if defined(__ELF__) && !defined(DBGHELP_STATIC_LIB)
|
||||
Elf_Ehdr elfhdr;
|
||||
Elf64_Ehdr elfhdr;
|
||||
struct
|
||||
{
|
||||
Elf_Shdr shdr;
|
||||
|
|
|
@ -3,4 +3,4 @@ directories:
|
|||
files:
|
||||
include/dbghelp.h: sdk/include/psdk/dbghelp.h
|
||||
tags:
|
||||
wine: a612f1f56fefd00ebe6d8f7bcf7c826f5aa85eab
|
||||
wine: 799e0bfa57c4c2a7922c43031bd0d95c6add6a1a
|
||||
|
|
Loading…
Reference in a new issue