ElfFuncDescTable::ElfFuncDescTable(FILE* file, Elf_Shdr shdr, int index) :
_section(file, shdr), _file(file), _index(index) {
assert(file, "null file handle"); // The actual function address (i.e. function entry point) is always the // first value in the function descriptor (on IA64 and PPC64 they look as follows): // PPC64: [function entry point, TOC pointer, environment pointer] // IA64 : [function entry point, GP (global pointer) value] // Unfortunately 'shdr.sh_entsize' doesn't always seem to contain this size (it's zero on PPC64) so we can't assert // assert(IA64_ONLY(2) PPC64_ONLY(3) * sizeof(address) == shdr.sh_entsize, "Size mismatch for '.opd' section entries");
_status = _section.status();
}
ElfFuncDescTable::~ElfFuncDescTable() {
}
address ElfFuncDescTable::lookup(Elf_Word index) {
if (NullDecoder::is_error(_status)) { return NULL;
}
address* func_descs = cached_func_descs(); const Elf_Shdr* shdr = _section.section_header();
if (!(shdr->sh_size > 0 && shdr->sh_addr <= index && index <= shdr->sh_addr + shdr->sh_size)) { // don't put the whole decoder in error mode if we just tried a wrong index return NULL;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.