/* * This gets called before relocation loop in generic loader * Make a note of the section index of unwinding section
*/ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstr, struct module *mod)
{ #ifdef CONFIG_ARC_DW2_UNWIND
mod->arch.unw_sec_idx = 0;
mod->arch.unw_info = NULL; #endif
mod->arch.secstr = secstr; return 0;
}
/* Loop thru entries in relocation section */ for (i = 0; i < n; i++) { constchar *s;
/* This is where to make the change */
location = tgt_addr + rel_entry[i].r_offset;
/* This is the symbol it is referring to. Note that all
undefined symbols have been resolved. */
sym_entry = sym_sec + ELF32_R_SYM(rel_entry[i].r_info);
/* This assumes modules are built with -mlong-calls * so any branches/jumps are absolute 32 bit jmps * global data access again is abs 32 bit. * Both of these are handled by same relocation type
*/
relo_type = ELF32_R_TYPE(rel_entry[i].r_info);
if (likely(R_ARC_32_ME == relo_type)) /* ME ( S + A ) */
arc_write_me((unsignedshort *)location, relocation); elseif (R_ARC_32 == relo_type) /* ( S + A ) */
*((Elf32_Addr *) location) = relocation; elseif (R_ARC_32_PCREL == relo_type) /* ( S + A ) - PDATA ) */
*((Elf32_Addr *) location) = relocation - location; else goto relo_err;
/* Just before lift off: After sections have been relocated, we add the * dwarf section to unwinder table pool * This couldn't be done in module_frob_arch_sections() because * relocations had not been applied by then
*/ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod)
{ #ifdef CONFIG_ARC_DW2_UNWIND void *unw; int unwsec = mod->arch.unw_sec_idx;
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.