https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d8cc719cb471a327513340...
commit d8cc719cb471a3275133403f566da79bfb825508 Author: winesync ros-dev@reactos.org AuthorDate: Fri Sep 11 18:57:59 2020 +0200 Commit: Jérôme Gardou jerome.gardou@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@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
wine commit id 6fde25300d6c93290887e47c3c4bfd55a948609b by Jacek Caban jacek@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