Skip to content

Commit f56f582

Browse files
Luc Tielentrufae
Luc Tielen
authored andcommitted
Iterate over vector i.s.o. list in elf entries ##bin
1 parent b870b2e commit f56f582

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libr/bin/p/bin_elf.inc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ static RList* entries(RBinFile *bf) {
253253
}
254254

255255
if (bf->o->sections) {
256-
RListIter *iter;
256+
// XXX store / cache sections by name in hashmap
257+
const RVector *sections = Elf_(load_sections) (bf, bf->o->bin_obj);
257258
RBinSection *section;
258-
// XXX this is slow
259-
r_list_foreach_prev (bf->o->sections, iter, section) {
259+
r_vector_foreach_prev (sections, section) {
260260
if (!strcmp (section->name, "ehdr")) {
261261
ptr->hvaddr = section->vaddr + ptr->hpaddr;
262262
break;

0 commit comments

Comments
 (0)