[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>
This commit is contained in:
winesync 2020-09-11 18:57:59 +02:00 committed by Jérôme Gardou
parent 345ffb9a3c
commit d8cc719cb4
2 changed files with 15 additions and 10 deletions

View file

@ -632,6 +632,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool,
for (i = 0; i < nsym; i++) for (i = 0; i < nsym; i++)
{ {
struct elf_sym sym; struct elf_sym sym;
unsigned int type;
if (fmap->addr_size == 32) if (fmap->addr_size == 32)
{ {
@ -647,14 +648,13 @@ static void elf_hash_symtab(struct module* module, struct pool* pool,
else else
sym = ((struct elf_sym *)symtab)[i]; sym = ((struct elf_sym *)symtab)[i];
type = sym.st_info & 0xf;
/* Ignore certain types of entries which really aren't of that much /* Ignore certain types of entries which really aren't of that much
* interest. * interest.
*/ */
if ((ELF32_ST_TYPE(sym.st_info) != STT_NOTYPE && if ((type != STT_NOTYPE && type != STT_FILE && type != STT_OBJECT && type != STT_FUNC)
ELF32_ST_TYPE(sym.st_info) != STT_FILE && || !sym.st_shndx)
ELF32_ST_TYPE(sym.st_info) != STT_OBJECT &&
ELF32_ST_TYPE(sym.st_info) != STT_FUNC) ||
sym.st_shndx == SHN_UNDEF)
{ {
continue; continue;
} }
@ -662,7 +662,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool,
symname = strp + sym.st_name; symname = strp + sym.st_name;
/* handle some specific symtab (that we'll throw away when done) */ /* handle some specific symtab (that we'll throw away when done) */
switch (ELF32_ST_TYPE(sym.st_info)) switch (type)
{ {
case STT_FILE: case STT_FILE:
if (symname) if (symname)
@ -791,6 +791,11 @@ static const struct elf_sym *elf_lookup_symtab(const struct module* module,
return &result->sym; return &result->sym;
} }
static BOOL elf_is_local_symbol(unsigned int info)
{
return !(info >> 4);
}
/****************************************************************** /******************************************************************
* elf_finish_stabs_info * 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, ((struct symt_function*)sym)->address,
wine_dbgstr_longlong(elf_info->elf_addr + symp->st_value)); 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)->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; DataIsFileStatic : DataIsGlobal;
} else } else
FIXME("Couldn't find %s!%s\n", 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) * used yet (ie we have no debug information on them)
* That's the case, for example, of the .spec.c files * 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: case STT_FUNC:
symt_new_function(module, ste->compiland, ste->ht_elt.name, 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.reg = 0;
loc.offset = addr; loc.offset = addr;
symt_new_global_variable(module, ste->compiland, ste->ht_elt.name, 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); loc, ste->sym.st_size, NULL);
break; break;
default: default:

View file

@ -4,4 +4,4 @@ files:
include/dbghelp.h: sdk/include/psdk/dbghelp.h include/dbghelp.h: sdk/include/psdk/dbghelp.h
include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
tags: tags:
wine: 66ab2c503de6d39f1a0256d66511da05d326ac5e wine: 6fde25300d6c93290887e47c3c4bfd55a948609b