diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-03-19 02:19:20 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-03-19 02:20:11 +0100 |
commit | a8a52cafb5621b475737ffdc81f63703d5b37904 (patch) | |
tree | beb5229bea824c3dc48634f4170cd3d56181cde8 /ddb | |
parent | 48bec088b6a4a4674acc5b1ea919c47a5180da98 (diff) | |
download | gnumach-a8a52cafb5621b475737ffdc81f63703d5b37904.tar.gz gnumach-a8a52cafb5621b475737ffdc81f63703d5b37904.tar.bz2 gnumach-a8a52cafb5621b475737ffdc81f63703d5b37904.zip |
Fix getting ELF symbol bind and type
ddb/db_elf.c (elf_db_search_symbol): Use ELF32_ST_BIND and ELF32_ST_TYPE to
access symbol bind and type.
Diffstat (limited to 'ddb')
-rw-r--r-- | ddb/db_elf.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ddb/db_elf.c b/ddb/db_elf.c index 10e71621..f654ad7f 100644 --- a/ddb/db_elf.c +++ b/ddb/db_elf.c @@ -165,23 +165,23 @@ elf_db_search_symbol (db_symtab_t *stab, if (s->st_name == 0) continue; - if (strategy == DB_STGY_XTRN && (s->st_info & STB_GLOBAL) == 0) + if (strategy == DB_STGY_XTRN && (ELF32_ST_BIND(s->st_info) != STB_GLOBAL)) continue; if (off >= s->st_value) { - if (s->st_info == STT_FUNC) + if (ELF32_ST_TYPE(s->st_info) == STT_FUNC) continue; if (off - s->st_value < diff) { diff = off - s->st_value; symp = s; - if (diff == 0 && (s->st_info & STB_GLOBAL)) + if (diff == 0 && (ELF32_ST_BIND(s->st_info) == STB_GLOBAL)) break; } else if (off - s->st_value == diff) { if (symp == NULL) symp = s; - else if ((symp->st_info & STB_GLOBAL) == 0 - && (s->st_info & STB_GLOBAL) != 0) + else if ((ELF32_ST_BIND(symp->st_info) != STB_GLOBAL) + && (ELF32_ST_BIND(s->st_info) == STB_GLOBAL)) symp = s; /* pick the external symbol */ } } |