/* * Read all the special sections and create a list of special_alt structs which * describe all the alternate instructions which can be patched in or * redirected to at runtime.
*/ int special_get_alts(struct elf *elf, struct list_head *alts)
{ conststruct special_entry *entry; struct section *sec; unsignedint nr_entries; struct special_alt *alt; int idx, ret;
INIT_LIST_HEAD(alts);
for (entry = entries; entry->sec; entry++) {
sec = find_section_by_name(elf, entry->sec); if (!sec) continue;
if (sec->sh.sh_size % entry->size != 0) {
ERROR("%s size not a multiple of %d", sec->name, entry->size); return -1;
}
nr_entries = sec->sh.sh_size / entry->size;
for (idx = 0; idx < nr_entries; idx++) {
alt = malloc(sizeof(*alt)); if (!alt) {
ERROR_GLIBC("malloc failed"); return -1;
}
memset(alt, 0, sizeof(*alt));
ret = get_alt_entry(elf, entry, sec, idx, alt); if (ret > 0) continue; if (ret < 0) return ret;
list_add_tail(&alt->list, alts);
}
}
return 0;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
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.