Skip to content

Commit

Permalink
ELF: skip visited segments in compute_symbols_from_segment()
Browse files Browse the repository at this point in the history
  • Loading branch information
pelijah committed Mar 31, 2024
1 parent 9a27c4f commit 110c2db
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions librz/bin/format/elf/elf_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,18 +253,17 @@ static void elf_symbol_fini(void *e, RZ_UNUSED void *user) {
}

static bool compute_symbols_from_segment(ELFOBJ *bin, RzVector /*<RzBinElfSymbol>*/ *result, struct symbols_segment *segment, RzBinElfSymbolFilter filter, HtUU *set) {
ut64 offset = segment->offset + segment->entry_size;
if (has_already_been_processed(bin, segment->offset, set)) {
return true;
}

for (size_t i = 1; i < segment->number; i++) {
if (has_already_been_processed(bin, offset, set)) {
offset += segment->entry_size;
continue;
}
if (!ht_uu_insert(set, segment->offset, 1ULL)) {
return false;
}

if (!ht_uu_insert(set, offset, offset)) {
return false;
}
ut64 offset = segment->offset + segment->entry_size;

for (size_t i = 1; i < segment->number; i++) {
Elf_(Sym) entry;
if (!get_symbol_entry(bin, offset, &entry)) {
return false;
Expand Down

0 comments on commit 110c2db

Please sign in to comment.