diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-05-16 21:56:55 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-05-16 21:56:55 (GMT) |
commit | 4691a434a34a19317156a761967f719e408b73bb (patch) | |
tree | 1daaf5be5d4a9f52d492380c2862580129d2ad12 /src/format/elf/helper_arm.c | |
parent | 1996274a43883aa58e8c565f7698bc7c338a9ce0 (diff) |
Merged routines into symbols.
Diffstat (limited to 'src/format/elf/helper_arm.c')
-rw-r--r-- | src/format/elf/helper_arm.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/format/elf/helper_arm.c b/src/format/elf/helper_arm.c index a08c473..734a2bb 100644 --- a/src/format/elf/helper_arm.c +++ b/src/format/elf/helper_arm.c @@ -55,6 +55,7 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx, bool result; /* Bilan à retourner */ phys_t rel_start; /* Début de la zone à traiter */ phys_t rel_size; /* Taille de cette même zone */ + GBinFormat *base; /* Autre version du format */ phys_t iter; /* Boucle de parcours */ elf_rel reloc; /* Infos de relocalisation */ off_t index; /* Indice de la portion visée */ @@ -67,9 +68,9 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx, virt_t final_virt; /* Adresse virtuelle retenue */ bool status; /* Bilan d'une opération */ vmpa2t addr; /* Localisation d'une routine */ - mrange_t range; /* Couverture mémoire associée */ GBinRoutine *routine; /* Nouvelle routine trouvée */ GBinSymbol *symbol; /* Nouveau symbole construit */ + mrange_t range; /* Couverture mémoire associée */ @@ -80,6 +81,7 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx, get_elf_section_content(format, relxxx, &rel_start, &rel_size, NULL); + base = G_BIN_FORMAT(format); for (iter = rel_start; iter < (rel_start + rel_size); ) { @@ -110,17 +112,14 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx, status = g_exe_format_translate_address_into_vmpa(G_EXE_FORMAT(format), final_virt, &addr); if (!status) continue; - init_mrange(&range, &addr, 0); - routine = try_to_demangle_routine(name); + symbol = G_BIN_SYMBOL(routine); - g_binary_routine_set_range(routine, &range); - - symbol = g_binary_symbol_new(STP_ROUTINE); - g_binary_symbol_attach_routine(symbol, routine); + init_mrange(&range, &addr, 0); + g_binary_symbol_set_range(symbol, &range); /* Comptabilisation pour le désassemblage brut */ - g_binary_format_register_code_point(G_BIN_FORMAT(format), virt, false); + g_binary_format_register_code_point(base, virt, false); break; @@ -132,7 +131,7 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx, } if (symbol != NULL) - g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol); + g_binary_format_add_symbol(base, symbol); } |