diff --git a/src/relf/relf.c b/src/relf/relf.c index 4e8ca66..97dc8d1 100644 --- a/src/relf/relf.c +++ b/src/relf/relf.c @@ -234,6 +234,24 @@ relf_value_t relf_open(relf_t* relf, const char* path) TRACE_SECTION(section); } } + + // find section we're gonna use later + const relf_section_t* strtab = NULL, *symtab = NULL; + for (unsigned i = 0; i < relf->section_num; i++) + { + const relf_section_t* section = &relf->sections[i]; + switch (section->type) + { + case SHT_STRTAB: + // we need symbol string table + if (i != e_shstrndx) + strtab = section; + break; + case SHT_SYMTAB: + symtab = section; + break; + } + } return RELF_ERROR(RELF_OK); } diff --git a/src/relf/relf.h b/src/relf/relf.h index 4cdfebe..ce81dde 100644 --- a/src/relf/relf.h +++ b/src/relf/relf.h @@ -75,11 +75,6 @@ typedef struct { uint64_t entsize; } relf_section_t; -typedef struct { - const char** strings; - unsigned string_num; -} relf_string_table_t; - // relf instance typedef struct { void* image;