Пример #1
0
bool checked(const ELFObjectFile<T> &obj, SectionRef sec_ref) {
    typedef typename ELFObjectFile<T>::Elf_Shdr Elf_Shdr;

    auto &elf = *obj.getELFFile();
    const Elf_Shdr *RelSec = obj.getSection(sec_ref.getRawDataRefImpl());
    auto symsec = elf.getSection(RelSec->sh_link);
    if (!symsec) return false;
    uint32_t sec_typ = (*symsec)->sh_type;
    return
        (sec_typ == ELF::SHT_SYMTAB || sec_typ == ELF::SHT_DYNSYM);
}
Пример #2
0
uint64_t section_offset(const ELFObjectFile<T> &obj, section_iterator it) {
    if (it == obj.section_end()) return 0; // check for special elf sections
    auto sec_elf = obj.getSection(it->getRawDataRefImpl());
    return sec_elf->sh_offset;
}