Commit 7b12b184 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

dbghelp: Use local symbol table entry declaration.

Based on glibc. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 849cf6ed
...@@ -57,10 +57,30 @@ struct elf_info ...@@ -57,10 +57,30 @@ struct elf_info
const WCHAR* module_name; /* OUT found module name (if ELF_INFO_NAME is set) */ 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 symtab_elt
{ {
struct hash_table_elt ht_elt; struct hash_table_elt ht_elt;
Elf64_Sym sym; struct elf_sym sym;
struct symt_compiland* compiland; struct symt_compiland* compiland;
unsigned used; unsigned used;
}; };
...@@ -605,18 +625,18 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, ...@@ -605,18 +625,18 @@ static void elf_hash_symtab(struct module* module, struct pool* pool,
} }
nsym = image_get_map_size(&ism) / 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++) for (j = 0; thunks[j].symname; j++)
thunks[j].rva_start = thunks[j].rva_end = 0; thunks[j].rva_start = thunks[j].rva_end = 0;
for (i = 0; i < nsym; i++) for (i = 0; i < nsym; i++)
{ {
Elf64_Sym sym; struct elf_sym sym;
if (fmap->addr_size == 32) 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_name = sym32->st_name;
sym.st_value = sym32->st_value; sym.st_value = sym32->st_value;
...@@ -626,7 +646,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, ...@@ -626,7 +646,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool,
sym.st_shndx = sym32->st_shndx; sym.st_shndx = sym32->st_shndx;
} }
else else
sym = ((Elf64_Sym *)symtab)[i]; sym = ((struct elf_sym *)symtab)[i];
/* 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.
...@@ -709,9 +729,9 @@ static void elf_hash_symtab(struct module* module, struct pool* pool, ...@@ -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 * lookup a symbol by name in our internal hash table for the symtab
*/ */
static const Elf64_Sym *elf_lookup_symtab(const struct module* module, static const struct elf_sym *elf_lookup_symtab(const struct module* module,
const struct hash_table* ht_symtab, const struct hash_table* ht_symtab,
const char* name, const struct symt* compiland) const char* name, const struct symt* compiland)
{ {
struct symtab_elt* weak_result = NULL; /* without compiland name */ struct symtab_elt* weak_result = NULL; /* without compiland name */
struct symtab_elt* result = NULL; struct symtab_elt* result = NULL;
...@@ -783,7 +803,7 @@ static void elf_finish_stabs_info(struct module* module, const struct hash_table ...@@ -783,7 +803,7 @@ static void elf_finish_stabs_info(struct module* module, const struct hash_table
struct hash_table_iter hti; struct hash_table_iter hti;
void* ptr; void* ptr;
struct symt_ht* sym; 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; struct elf_module_info* elf_info = module->format_info[DFI_ELF]->u.elf_info;
hash_table_iter_init(&module->ht_symbols, &hti, NULL); hash_table_iter_init(&module->ht_symbols, &hti, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment