ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2020
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
25 participants
382 discussions
Start a n
N
ew thread
[reactos] 144/179: [WINESYNC] dbghelp: Don't store entire mach header in image_file_map.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=00783527e0c31a767111a…
commit 00783527e0c31a767111a24f8bb0c7c1669c19d2 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: Don't store entire mach header in image_file_map. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 7254579417f337063734933975b25d21da4d31f3 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/image_private.h | 5 +++-- dll/win32/dbghelp/macho_module.c | 20 +++++++++++--------- sdk/tools/winesync/dbghelp.cfg | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h index 5da4c1e113e..6406c2e43e3 100644 --- a/dll/win32/dbghelp/image_private.h +++ b/dll/win32/dbghelp/image_private.h @@ -96,10 +96,11 @@ struct image_file_map size_t segs_start; HANDLE handle; struct image_file_map* dsym; /* the debug symbols file associated with this one */ + size_t header_size; /* size of real header in file */ + size_t commands_size; + size_t commands_count; #ifdef HAVE_MACH_O_LOADER_H - struct mach_header mach_header; - size_t header_size; /* size of real header in file */ const struct load_command* load_commands; const struct uuid_command* uuid; diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c index 1e01d84c192..5d3f8615e87 100644 --- a/dll/win32/dbghelp/macho_module.c +++ b/dll/win32/dbghelp/macho_module.c @@ -448,7 +448,7 @@ static const struct load_command* macho_map_load_commands(struct macho_file_map* if (fmap->load_commands == IMAGE_NO_MAP) { fmap->load_commands = (const struct load_command*) macho_map_range( - fmap, fmap->header_size, fmap->mach_header.sizeofcmds, NULL); + fmap, fmap->header_size, fmap->commands_size, NULL); TRACE("Mapped load commands: %p\n", fmap->load_commands); } @@ -466,7 +466,7 @@ static void macho_unmap_load_commands(struct macho_file_map* fmap) { TRACE("Unmapping load commands: %p\n", fmap->load_commands); macho_unmap_range(NULL, (const void**)&fmap->load_commands, fmap, - fmap->header_size, fmap->mach_header.sizeofcmds); + fmap->header_size, fmap->commands_size); } } @@ -504,9 +504,9 @@ static int macho_enum_load_commands(struct image_file_map *ifm, unsigned cmd, if ((lc = macho_map_load_commands(fmap)) == IMAGE_NO_MAP) return -1; - TRACE("%d total commands\n", fmap->mach_header.ncmds); + TRACE("%lu total commands\n", fmap->commands_count); - for (i = 0; i < fmap->mach_header.ncmds; i++, lc = macho_next_load_command(lc)) + for (i = 0; i < fmap->commands_count; i++, lc = macho_next_load_command(lc)) { int result; @@ -683,6 +683,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, { struct macho_file_map* fmap = &ifm->u.macho; struct fat_header fat_header; + struct mach_header mach_header; int i; WCHAR* filename; struct section_info info; @@ -745,15 +746,16 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW, /* Individual architecture (standalone or within a fat file) is in its native byte order. */ SetFilePointer(fmap->handle, fmap->arch_offset, 0, FILE_BEGIN); - if (!ReadFile(fmap->handle, &fmap->mach_header, sizeof(fmap->mach_header), &bytes_read, NULL) - || bytes_read != sizeof(fmap->mach_header)) + if (!ReadFile(fmap->handle, &mach_header, sizeof(mach_header), &bytes_read, NULL) + || bytes_read != sizeof(mach_header)) goto done; TRACE("... got possible Mach header\n"); /* and check for a Mach-O header */ - if (fmap->mach_header.magic != target_magic || - fmap->mach_header.cputype != target_cpu) goto done; + if (mach_header.magic != target_magic || mach_header.cputype != target_cpu) goto done; + fmap->commands_size = mach_header.sizeofcmds; + fmap->commands_count = mach_header.ncmds; /* Make sure the file type is one of the ones we expect. */ - switch (fmap->mach_header.filetype) + switch (mach_header.filetype) { case MH_EXECUTE: case MH_DYLIB: diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index a9c29f900c8..504be41c2ab 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: b664ae8e60e08224cdc3025c28a37cb22356aaa4 + wine: 7254579417f337063734933975b25d21da4d31f3
4 years, 3 months
1
0
0
0
[reactos] 143/179: [WINESYNC] dbghelp: Don't use system headers for ELF declarations.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=45b55dc9b2c62689862dd…
commit 45b55dc9b2c62689862ddc1a7dd8775cb184c7a6 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:57:59 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:53 2020 +0200 [WINESYNC] dbghelp: Don't use system headers for ELF declarations. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id b664ae8e60e08224cdc3025c28a37cb22356aaa4 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/elf_module.c | 6 +----- dll/win32/dbghelp/image_private.h | 17 ----------------- sdk/tools/winesync/dbghelp.cfg | 2 +- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index ae25170bfc0..23cb8a54b70 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -24,9 +24,6 @@ #if defined(__svr4__) || defined(__sun) #define __ELF__ 1 -/* large files are not supported by libelf */ -#undef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 32 #endif #include <assert.h> @@ -34,9 +31,8 @@ #include <stdlib.h> #include "dbghelp_private.h" -#include "winternl.h" - #include "image_private.h" +#include "winternl.h" #include "wine/debug.h" #include "wine/heap.h" diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h index d440461cc14..5da4c1e113e 100644 --- a/dll/win32/dbghelp/image_private.h +++ b/dll/win32/dbghelp/image_private.h @@ -21,23 +21,6 @@ #pragma once -#ifdef HAVE_ELF_H -# include <elf.h> -#endif -#ifdef HAVE_SYS_ELF32_H -# include <sys/elf32.h> -#endif -#ifdef HAVE_SYS_EXEC_ELF_H -# include <sys/exec_elf.h> -#endif -#if !defined(DT_NUM) -# if defined(DT_COUNT) -# define DT_NUM DT_COUNT -# else -/* this seems to be a satisfactory value on Solaris, which doesn't support this AFAICT */ -# define DT_NUM 24 -# endif -#endif #ifdef HAVE_LINK_H # include <link.h> #endif diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 0d9e9b6d711..a9c29f900c8 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: 56f2b950c3a090d1951edd687e1c6e9ed9388732 + wine: b664ae8e60e08224cdc3025c28a37cb22356aaa4
4 years, 3 months
1
0
0
0
[reactos] 142/179: [WINESYNC] dbghelp: Use local ELF constants definitions.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9228b75d7fb03db13034b…
commit 9228b75d7fb03db13034b0499e8c6989a8d18103 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:57:59 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:53 2020 +0200 [WINESYNC] dbghelp: Use local ELF constants definitions. Based on glibc. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 56f2b950c3a090d1951edd687e1c6e9ed9388732 by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/elf_module.c | 61 +++++++++++++++++++++++++++++++----------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index a6255e134cc..ae25170bfc0 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -101,7 +101,38 @@ struct elf_module_info struct image_file_map file_map; }; -#define ELF_AT_SYSINFO_EHDR 33 +/* Legal values for sh_type (section type). */ +#define ELF_SHT_NULL 0 /* Section header table entry unused */ +#define ELF_SHT_PROGBITS 1 /* Program data */ +#define ELF_SHT_SYMTAB 2 /* Symbol table */ +#define ELF_SHT_STRTAB 3 /* String table */ +#define ELF_SHT_RELA 4 /* Relocation entries with addends */ +#define ELF_SHT_HASH 5 /* Symbol hash table */ +#define ELF_SHT_DYNAMIC 6 /* Dynamic linking information */ +#define ELF_SHT_NOTE 7 /* Notes */ +#define ELF_SHT_NOBITS 8 /* Program space with no data (bss) */ +#define ELF_SHT_REL 9 /* Relocation entries, no addends */ +#define ELF_SHT_SHLIB 10 /* Reserved */ +#define ELF_SHT_DYNSYM 11 /* Dynamic linker symbol table */ +#define ELF_SHT_INIT_ARRAY 14 /* Array of constructors */ +#define ELF_SHT_FINI_ARRAY 15 /* Array of destructors */ +#define ELF_SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ +#define ELF_SHT_GROUP 17 /* Section group */ +#define ELF_SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ +#define ELF_SHT_NUM 19 /* Number of defined types. */ + +/* Legal values for ST_TYPE subfield of st_info (symbol type). */ +#define ELF_STT_NOTYPE 0 /* Symbol type is unspecified */ +#define ELF_STT_OBJECT 1 /* Symbol is a data object */ +#define ELF_STT_FUNC 2 /* Symbol is a code object */ +#define ELF_STT_SECTION 3 /* Symbol associated with a section */ +#define ELF_STT_FILE 4 /* Symbol's name is file name */ + +#define ELF_PT_LOAD 1 /* Loadable program segment */ + +#define ELF_DT_DEBUG 21 /* For debugging; unspecified */ + +#define ELF_AT_SYSINFO_EHDR 33 /****************************************************************** * elf_map_section @@ -116,7 +147,7 @@ static const char* elf_map_section(struct image_section_map* ism) assert(ism->fmap->modtype == DMT_ELF); if (ism->sidx < 0 || ism->sidx >= ism->fmap->u.elf.elfhdr.e_shnum || - fmap->sect[ism->sidx].shdr.sh_type == SHT_NOBITS) + fmap->sect[ism->sidx].shdr.sh_type == ELF_SHT_NOBITS) return IMAGE_NO_MAP; if (fmap->target_copy) @@ -503,7 +534,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map* if (elf_map_file_read(fmap, emfd, &phdr, sizeof(phdr), fmap->u.elf.elfhdr.e_phoff + i * sizeof(phdr)) && - phdr.p_type == PT_LOAD) + phdr.p_type == ELF_PT_LOAD) { tmp = (phdr.p_vaddr + phdr.p_memsz + page_mask) & ~page_mask; if (fmap->u.elf.elf_size < tmp) fmap->u.elf.elf_size = tmp; @@ -526,7 +557,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map* if (elf_map_file_read(fmap, emfd, &phdr, sizeof(phdr), fmap->u.elf.elfhdr.e_phoff + i * sizeof(phdr)) && - phdr.p_type == PT_LOAD) + phdr.p_type == ELF_PT_LOAD) { tmp = (phdr.p_vaddr + phdr.p_memsz + page_mask) & ~page_mask; if (fmap->u.elf.elf_size < tmp) fmap->u.elf.elf_size = tmp; @@ -612,8 +643,8 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, struct image_section_map ism, ism_str; const char *symtab; - if (!elf_find_section_type(fmap, ".symtab", SHT_SYMTAB, &ism) && - !elf_find_section_type(fmap, ".dynsym", SHT_DYNSYM, &ism)) return; + if (!elf_find_section_type(fmap, ".symtab", ELF_SHT_SYMTAB, &ism) && + !elf_find_section_type(fmap, ".dynsym", ELF_SHT_DYNSYM, &ism)) return; if ((symtab = image_map_section(&ism)) == IMAGE_NO_MAP) return; ism_str.fmap = ism.fmap; ism_str.sidx = fmap->u.elf.sect[ism.sidx].shdr.sh_link; @@ -653,7 +684,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, /* Ignore certain types of entries which really aren't of that much * interest. */ - if ((type != STT_NOTYPE && type != STT_FILE && type != STT_OBJECT && type != STT_FUNC) + if ((type != ELF_STT_NOTYPE && type != ELF_STT_FILE && type != ELF_STT_OBJECT && type != ELF_STT_FUNC) || !sym.st_shndx) { continue; @@ -664,14 +695,14 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, /* handle some specific symtab (that we'll throw away when done) */ switch (type) { - case STT_FILE: + case ELF_STT_FILE: if (symname) compiland = symt_new_compiland(module, sym.st_value, source_new(module, NULL, symname)); else compiland = NULL; continue; - case STT_NOTYPE: + case ELF_STT_NOTYPE: /* we are only interested in wine markers inserted by winebuild */ for (j = 0; thunks[j].symname; j++) { @@ -923,11 +954,11 @@ static int elf_new_wine_thunks(struct module* module, const struct hash_table* h */ switch (ste->sym.st_info & 0xf) { - case STT_FUNC: + case ELF_STT_FUNC: symt_new_function(module, ste->compiland, ste->ht_elt.name, addr, ste->sym.st_size, NULL); break; - case STT_OBJECT: + case ELF_STT_OBJECT: loc.kind = loc_absolute; loc.reg = 0; loc.offset = addr; @@ -1121,7 +1152,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, { struct image_section_map ism; - if (elf_find_section_type(fmap, ".dynamic", SHT_DYNAMIC, &ism)) + if (elf_find_section_type(fmap, ".dynamic", ELF_SHT_DYNAMIC, &ism)) { char* ptr = (char*)(ULONG_PTR)fmap->u.elf.sect[ism.sidx].shdr.sh_addr; ULONG_PTR len; @@ -1141,7 +1172,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, if (!ReadProcessMemory(pcs->handle, ptr, &dyn, sizeof(dyn), &len) || len != sizeof(dyn)) return ret; - if (dyn.d_tag == DT_DEBUG) + if (dyn.d_tag == ELF_DT_DEBUG) { elf_info->dbg_hdr_addr = dyn.d_val; if (load_offset == 0 && dyn_addr == 0) /* likely the case */ @@ -1167,7 +1198,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, if (!ReadProcessMemory(pcs->handle, ptr, &dyn, sizeof(dyn), &len) || len != sizeof(dyn)) return ret; - if (dyn.d_tag == DT_DEBUG) + if (dyn.d_tag == ELF_DT_DEBUG) { elf_info->dbg_hdr_addr = dyn.d_val; if (load_offset == 0 && dyn_addr == 0) /* likely the case */ @@ -1191,7 +1222,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, struct image_section_map ism; ULONG_PTR modbase = load_offset; - if (elf_find_section_type(fmap, ".dynamic", SHT_DYNAMIC, &ism)) + if (elf_find_section_type(fmap, ".dynamic", ELF_SHT_DYNAMIC, &ism)) { ULONG_PTR rva_dyn = elf_get_map_rva(&ism); diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 2a684464232..0d9e9b6d711 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: 6fde25300d6c93290887e47c3c4bfd55a948609b + wine: 56f2b950c3a090d1951edd687e1c6e9ed9388732
4 years, 3 months
1
0
0
0
[reactos] 141/179: [WINESYNC] dbghelp: Don't use ELF32_ST_BIND and ELF32_ST_TYPE macros.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d8cc719cb471a32751334…
commit d8cc719cb471a3275133403f566da79bfb825508 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:57:59 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:53 2020 +0200 [WINESYNC] dbghelp: Don't use ELF32_ST_BIND and ELF32_ST_TYPE macros. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 6fde25300d6c93290887e47c3c4bfd55a948609b by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/elf_module.c | 23 ++++++++++++++--------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 9449c9ab618..a6255e134cc 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -632,6 +632,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, for (i = 0; i < nsym; i++) { struct elf_sym sym; + unsigned int type; if (fmap->addr_size == 32) { @@ -647,14 +648,13 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, else sym = ((struct elf_sym *)symtab)[i]; + type = sym.st_info & 0xf; + /* Ignore certain types of entries which really aren't of that much * interest. */ - if ((ELF32_ST_TYPE(sym.st_info) != STT_NOTYPE && - ELF32_ST_TYPE(sym.st_info) != STT_FILE && - ELF32_ST_TYPE(sym.st_info) != STT_OBJECT && - ELF32_ST_TYPE(sym.st_info) != STT_FUNC) || - sym.st_shndx == SHN_UNDEF) + if ((type != STT_NOTYPE && type != STT_FILE && type != STT_OBJECT && type != STT_FUNC) + || !sym.st_shndx) { continue; } @@ -662,7 +662,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, symname = strp + sym.st_name; /* handle some specific symtab (that we'll throw away when done) */ - switch (ELF32_ST_TYPE(sym.st_info)) + switch (type) { case STT_FILE: if (symname) @@ -791,6 +791,11 @@ static const struct elf_sym *elf_lookup_symtab(const struct module* module, return &result->sym; } +static BOOL elf_is_local_symbol(unsigned int info) +{ + return !(info >> 4); +} + /****************************************************************** * elf_finish_stabs_info * @@ -857,7 +862,7 @@ static void elf_finish_stabs_info(struct module* module, const struct hash_table ((struct symt_function*)sym)->address, wine_dbgstr_longlong(elf_info->elf_addr + symp->st_value)); ((struct symt_data*)sym)->u.var.offset = elf_info->elf_addr + symp->st_value; - ((struct symt_data*)sym)->kind = (ELF32_ST_BIND(symp->st_info) == STB_LOCAL) ? + ((struct symt_data*)sym)->kind = elf_is_local_symbol(symp->st_info) ? DataIsFileStatic : DataIsGlobal; } else FIXME("Couldn't find %s!%s\n", @@ -916,7 +921,7 @@ static int elf_new_wine_thunks(struct module* module, const struct hash_table* h * used yet (ie we have no debug information on them) * That's the case, for example, of the .spec.c files */ - switch (ELF32_ST_TYPE(ste->sym.st_info)) + switch (ste->sym.st_info & 0xf) { case STT_FUNC: symt_new_function(module, ste->compiland, ste->ht_elt.name, @@ -927,7 +932,7 @@ static int elf_new_wine_thunks(struct module* module, const struct hash_table* h loc.reg = 0; loc.offset = addr; symt_new_global_variable(module, ste->compiland, ste->ht_elt.name, - ELF32_ST_BIND(ste->sym.st_info) == STB_LOCAL, + elf_is_local_symbol(ste->sym.st_info), loc, ste->sym.st_size, NULL); break; default: diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 9c8efd8d37a..2a684464232 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: 66ab2c503de6d39f1a0256d66511da05d326ac5e + wine: 6fde25300d6c93290887e47c3c4bfd55a948609b
4 years, 3 months
1
0
0
0
[reactos] 140/179: [WINESYNC] dbghelp: Inline ELF magic constants.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=345ffb9a3c7e5bd88763c…
commit 345ffb9a3c7e5bd88763c2eab5b1f381ccf73076 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:57:59 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:53 2020 +0200 [WINESYNC] dbghelp: Inline ELF magic constants. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 66ab2c503de6d39f1a0256d66511da05d326ac5e by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/elf_module.c | 5 ++--- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 4cbb09ff789..9449c9ab618 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -387,7 +387,6 @@ static BOOL elf_map_shdr(struct elf_map_file_data* emfd, struct image_file_map* */ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map* fmap) { - static const BYTE elf_signature[4] = { ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3 }; unsigned int i; size_t tmp, page_mask = sysinfo.dwPageSize - 1; WCHAR *dos_path; @@ -419,10 +418,10 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map* return FALSE; /* and check for an ELF header */ - if (memcmp(e_ident, elf_signature, sizeof(elf_signature))) + if (memcmp(e_ident, "\177ELF", 4)) return FALSE; - fmap->addr_size = e_ident[EI_CLASS] == ELFCLASS64 ? 64 : 32; + fmap->addr_size = e_ident[4] == 2 /* ELFCLASS64 */ ? 64 : 32; if (fmap->addr_size == 32) { diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 5e791152719..9c8efd8d37a 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: 7b12b1849c711476b64b3ed6bc60805ff8f2715f + wine: 66ab2c503de6d39f1a0256d66511da05d326ac5e
4 years, 3 months
1
0
0
0
[reactos] 139/179: [WINESYNC] dbghelp: Use local symbol table entry declaration.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e0f62624edf706ff4e75…
commit 9e0f62624edf706ff4e759d204497f807f6a1d99 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:57:59 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:53 2020 +0200 [WINESYNC] dbghelp: Use local symbol table entry declaration. Based on glibc. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 7b12b1849c711476b64b3ed6bc60805ff8f2715f by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/elf_module.c | 38 +++++++++++++++++++++++++++++--------- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 17f0ecb263b..4cbb09ff789 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -57,10 +57,30 @@ struct elf_info const WCHAR* module_name; /* OUT found module name (if ELF_INFO_NAME is set) */ }; +struct elf_sym32 +{ + UINT32 st_name; /* Symbol name (string tbl index) */ + UINT32 st_value; /* Symbol value */ + UINT32 st_size; /* Symbol size */ + UINT8 st_info; /* Symbol type and binding */ + UINT8 st_other; /* Symbol visibility */ + UINT16 st_shndx; /* Section index */ +}; + +struct elf_sym +{ + UINT32 st_name; /* Symbol name (string tbl index) */ + UINT8 st_info; /* Symbol type and binding */ + UINT8 st_other; /* Symbol visibility */ + UINT16 st_shndx; /* Section index */ + UINT64 st_value; /* Symbol value */ + UINT64 st_size; /* Symbol size */ +}; + struct symtab_elt { struct hash_table_elt ht_elt; - Elf64_Sym sym; + struct elf_sym sym; struct symt_compiland* compiland; unsigned used; }; @@ -605,18 +625,18 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, } nsym = image_get_map_size(&ism) / - (fmap->addr_size == 32 ? sizeof(Elf32_Sym) : sizeof(Elf64_Sym)); + (fmap->addr_size == 32 ? sizeof(struct elf_sym32) : sizeof(struct elf_sym)); for (j = 0; thunks[j].symname; j++) thunks[j].rva_start = thunks[j].rva_end = 0; for (i = 0; i < nsym; i++) { - Elf64_Sym sym; + struct elf_sym sym; if (fmap->addr_size == 32) { - Elf32_Sym *sym32 = &((Elf32_Sym *)symtab)[i]; + struct elf_sym32 *sym32 = &((struct elf_sym32 *)symtab)[i]; sym.st_name = sym32->st_name; sym.st_value = sym32->st_value; @@ -626,7 +646,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, sym.st_shndx = sym32->st_shndx; } else - sym = ((Elf64_Sym *)symtab)[i]; + sym = ((struct elf_sym *)symtab)[i]; /* Ignore certain types of entries which really aren't of that much * interest. @@ -709,9 +729,9 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, * * lookup a symbol by name in our internal hash table for the symtab */ -static const Elf64_Sym *elf_lookup_symtab(const struct module* module, - const struct hash_table* ht_symtab, - const char* name, const struct symt* compiland) +static const struct elf_sym *elf_lookup_symtab(const struct module* module, + const struct hash_table* ht_symtab, + const char* name, const struct symt* compiland) { struct symtab_elt* weak_result = NULL; /* without compiland name */ struct symtab_elt* result = NULL; @@ -783,7 +803,7 @@ static void elf_finish_stabs_info(struct module* module, const struct hash_table struct hash_table_iter hti; void* ptr; struct symt_ht* sym; - const Elf64_Sym* symp; + const struct elf_sym* symp; struct elf_module_info* elf_info = module->format_info[DFI_ELF]->u.elf_info; hash_table_iter_init(&module->ht_symbols, &hti, NULL); diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index be1fdfbacd3..5e791152719 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: 849cf6ed514aaa5071e61dc471dca6be1d58393f + wine: 7b12b1849c711476b64b3ed6bc60805ff8f2715f
4 years, 3 months
1
0
0
0
[reactos] 138/179: [WINESYNC] dbghelp: Use local dynamic section entry declaration.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=44ef7f5ff5dcb03d0df79…
commit 44ef7f5ff5dcb03d0df79d8b08cefae9f9976aed Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:57:58 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:53 2020 +0200 [WINESYNC] dbghelp: Use local dynamic section entry declaration. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 849cf6ed514aaa5071e61dc471dca6be1d58393f by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/elf_module.c | 16 ++++++++++++---- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 01ba4528e05..17f0ecb263b 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -1106,7 +1106,11 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, if (fmap->addr_size == 32) { - Elf32_Dyn dyn; + struct + { + INT32 d_tag; /* Dynamic entry type */ + UINT32 d_val; /* Integer or address value */ + } dyn; do { @@ -1115,7 +1119,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, return ret; if (dyn.d_tag == DT_DEBUG) { - elf_info->dbg_hdr_addr = dyn.d_un.d_ptr; + elf_info->dbg_hdr_addr = dyn.d_val; if (load_offset == 0 && dyn_addr == 0) /* likely the case */ /* Assume this module (the Wine loader) has been * loaded at its preferred address */ @@ -1128,7 +1132,11 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, } else { - Elf64_Dyn dyn; + struct + { + INT64 d_tag; /* Dynamic entry type */ + UINT64 d_val; /* Integer or address value */ + } dyn; do { @@ -1137,7 +1145,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename, return ret; if (dyn.d_tag == DT_DEBUG) { - elf_info->dbg_hdr_addr = dyn.d_un.d_ptr; + elf_info->dbg_hdr_addr = dyn.d_val; if (load_offset == 0 && dyn_addr == 0) /* likely the case */ /* Assume this module (the Wine loader) has been * loaded at its preferred address */ diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 6d35968ac5b..be1fdfbacd3 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: 186d610442e1db009e40945fc4725c43ea8721ab + wine: 849cf6ed514aaa5071e61dc471dca6be1d58393f
4 years, 3 months
1
0
0
0
[reactos] 137/179: [WINESYNC] dbghelp: Use local ELF program segment header declaration.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=582c24d09a67b959125df…
commit 582c24d09a67b959125df3f7a496d29ada6575c2 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:57:58 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:53 2020 +0200 [WINESYNC] dbghelp: Use local ELF program segment header declaration. Based on glibc. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 186d610442e1db009e40945fc4725c43ea8721ab by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/elf_module.c | 24 ++++++++++++++++++++++-- sdk/tools/winesync/dbghelp.cfg | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index 3a9af1d15d0..01ba4528e05 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -470,7 +470,17 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map* { if (fmap->addr_size == 32) { - Elf32_Phdr phdr; + struct + { + UINT32 p_type; /* Segment type */ + UINT32 p_offset; /* Segment file offset */ + UINT32 p_vaddr; /* Segment virtual address */ + UINT32 p_paddr; /* Segment physical address */ + UINT32 p_filesz; /* Segment size in file */ + UINT32 p_memsz; /* Segment size in memory */ + UINT32 p_flags; /* Segment flags */ + UINT32 p_align; /* Segment alignment */ + } phdr; if (elf_map_file_read(fmap, emfd, &phdr, sizeof(phdr), fmap->u.elf.elfhdr.e_phoff + i * sizeof(phdr)) && @@ -483,7 +493,17 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map* } else { - Elf64_Phdr phdr; + struct + { + UINT32 p_type; /* Segment type */ + UINT32 p_flags; /* Segment flags */ + UINT64 p_offset; /* Segment file offset */ + UINT64 p_vaddr; /* Segment virtual address */ + UINT64 p_paddr; /* Segment physical address */ + UINT64 p_filesz; /* Segment size in file */ + UINT64 p_memsz; /* Segment size in memory */ + UINT64 p_align; /* Segment alignment */ + } phdr; if (elf_map_file_read(fmap, emfd, &phdr, sizeof(phdr), fmap->u.elf.elfhdr.e_phoff + i * sizeof(phdr)) && diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 5791a929905..6d35968ac5b 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: a6f0fe8d1ca16243771784ec34c49453c96e6479 + wine: 186d610442e1db009e40945fc4725c43ea8721ab
4 years, 3 months
1
0
0
0
[reactos] 136/179: [WINESYNC] dbghelp: Use local elf_section_header declaration.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2a7f64af1fe12fc4521e8…
commit 2a7f64af1fe12fc4521e8c8191b3be9348ec78fd Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:56:31 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> 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 <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id a6f0fe8d1ca16243771784ec34c49453c96e6479 by Jacek Caban <jacek(a)codeweavers.com> --- 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
4 years, 3 months
1
0
0
0
[reactos] 135/179: [WINESYNC] dbghelp: Use local elf_header declaration.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6c0765a0ec259c74a23cd…
commit 6c0765a0ec259c74a23cd8d59b4d079b71c98443 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Fri Sep 11 18:54:57 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Wed Sep 16 10:35:52 2020 +0200 [WINESYNC] dbghelp: Use local elf_header declaration. Based on glibc. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 78845911da06fc75c6d74237f816a1547c24b20b by Jacek Caban <jacek(a)codeweavers.com> --- dll/win32/dbghelp/elf_module.c | 22 +++++++++++++++++++--- dll/win32/dbghelp/image_private.h | 20 +++++++++++++++++++- sdk/include/host/typedefs.h | 3 ++- sdk/tools/winesync/dbghelp.cfg | 2 +- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c index cca07ead31e..cb30eb23d4e 100644 --- a/dll/win32/dbghelp/elf_module.c +++ b/dll/win32/dbghelp/elf_module.c @@ -359,7 +359,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map* unsigned int i; size_t tmp, page_mask = sysinfo.dwPageSize - 1; WCHAR *dos_path; - unsigned char e_ident[EI_NIDENT]; + unsigned char e_ident[ARRAY_SIZE(fmap->u.elf.elfhdr.e_ident)]; elf_reset_file_map(fmap); @@ -394,12 +394,28 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map* if (fmap->addr_size == 32) { - Elf32_Ehdr elfhdr32; + struct + { + UINT8 e_ident[16]; /* Magic number and other info */ + UINT16 e_type; /* Object file type */ + UINT16 e_machine; /* Architecture */ + UINT32 e_version; /* Object file version */ + UINT32 e_entry; /* Entry point virtual address */ + UINT32 e_phoff; /* Program header table file offset */ + UINT32 e_shoff; /* Section header table file offset */ + UINT32 e_flags; /* Processor-specific flags */ + UINT16 e_ehsize; /* ELF header size in bytes */ + UINT16 e_phentsize; /* Program header table entry size */ + UINT16 e_phnum; /* Program header table entry count */ + UINT16 e_shentsize; /* Section header table entry size */ + UINT16 e_shnum; /* Section header table entry count */ + UINT16 e_shstrndx; /* Section header string table index */ + } elfhdr32; if (!elf_map_file_read(fmap, emfd, &elfhdr32, sizeof(elfhdr32), 0)) return FALSE; - memcpy(fmap->u.elf.elfhdr.e_ident, elfhdr32.e_ident, EI_NIDENT); + memcpy(fmap->u.elf.elfhdr.e_ident, elfhdr32.e_ident, sizeof(e_ident)); 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; diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h index 04885128217..64515ea3a31 100644 --- a/dll/win32/dbghelp/image_private.h +++ b/dll/win32/dbghelp/image_private.h @@ -50,6 +50,24 @@ #define IMAGE_NO_MAP ((void*)-1) +struct elf_header +{ + UINT8 e_ident[16]; /* Magic number and other info */ + UINT16 e_type; /* Object file type */ + UINT16 e_machine; /* Architecture */ + UINT32 e_version; /* Object file version */ + UINT64 e_entry; /* Entry point virtual address */ + UINT64 e_phoff; /* Program header table file offset */ + UINT64 e_shoff; /* Section header table file offset */ + UINT32 e_flags; /* Processor-specific flags */ + UINT16 e_ehsize; /* ELF header size in bytes */ + UINT16 e_phentsize; /* Program header table entry size */ + UINT16 e_phnum; /* Program header table entry count */ + UINT16 e_shentsize; /* Section header table entry size */ + UINT16 e_shnum; /* Section header table entry count */ + UINT16 e_shstrndx; /* Section header string table index */ +}; + /* structure holding information while handling an ELF image * allows one by one section mapping for memory savings */ @@ -68,8 +86,8 @@ struct image_file_map HANDLE handle; const char* shstrtab; char* target_copy; + struct elf_header elfhdr; #if defined(__ELF__) && !defined(DBGHELP_STATIC_LIB) - Elf64_Ehdr elfhdr; struct { Elf64_Shdr shdr; diff --git a/sdk/include/host/typedefs.h b/sdk/include/host/typedefs.h index df451c3344f..3a31aab7a93 100644 --- a/sdk/include/host/typedefs.h +++ b/sdk/include/host/typedefs.h @@ -2,7 +2,7 @@ * PROJECT: ReactOS Host Headers * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) * PURPOSE: Type definitions and useful macros for host tools - * COPYRIGHT: Copyright 2007 Herv� Poussineau (hpoussin(a)reactos.org) + * COPYRIGHT: Copyright 2007 Hervé Poussineau (hpoussin(a)reactos.org) * Copyright 2007 Colin Finck (colin(a)reactos.org) */ @@ -51,6 +51,7 @@ typedef void VOID, *PVOID, *LPVOID; typedef char CHAR, CCHAR, *PCHAR, *PSTR, *LPSTR; typedef const char *PCSTR, *LPCSTR; typedef unsigned char UCHAR, *PUCHAR, BYTE, *LPBYTE, BOOLEAN, *PBOOLEAN; +typedef uint8_t UINT8; typedef int16_t SHORT, *PSHORT; typedef uint16_t USHORT, *PUSHORT, WORD, *PWORD, *LPWORD, WCHAR, *PWCHAR, *PWSTR, *LPWSTR, UINT16; typedef const uint16_t *PCWSTR, *LPCWSTR; diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg index 2c4fb3b3dfd..f435483c7d9 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: 11ea231501f4f2a54433031ada21052d81641fee + wine: 78845911da06fc75c6d74237f816a1547c24b20b
4 years, 3 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
39
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Results per page:
10
25
50
100
200