diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-05-23 01:12:31 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-05-23 01:12:31 +0200 |
commit | bfef6b4ddb83eec0cb3d6ce0f0fbf85efbca8557 (patch) | |
tree | 58097a5df9df80f60ce3d9efbe6c394169564cfe /ddb | |
parent | 1db202eb8406785500f1bc3ceef7868566e416a1 (diff) | |
download | gnumach-bfef6b4ddb83eec0cb3d6ce0f0fbf85efbca8557.tar.gz gnumach-bfef6b4ddb83eec0cb3d6ce0f0fbf85efbca8557.tar.bz2 gnumach-bfef6b4ddb83eec0cb3d6ce0f0fbf85efbca8557.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 547453b3..7b7eed73 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 */ } } |