summaryrefslogtreecommitdiff
path: root/plugins/elf/helper_arm.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/elf/helper_arm.c')
-rw-r--r--plugins/elf/helper_arm.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/plugins/elf/helper_arm.c b/plugins/elf/helper_arm.c
index 737e4ac..a037469 100644
--- a/plugins/elf/helper_arm.c
+++ b/plugins/elf/helper_arm.c
@@ -94,9 +94,7 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx,
off_t index; /* Indice de la portion visée */
elf_sym sym; /* Définition complète */
const char *name; /* Nom du symbole trouvé */
-
-
-
+ char *plt_name; /* Adaptation de l'étiquette */
virt_t virt; /* Adresse en mémoire virtuelle*/
virt_t final_virt; /* Adresse virtuelle retenue */
bool status; /* Bilan d'une opération */
@@ -105,13 +103,8 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx,
GBinSymbol *symbol; /* Nouveau symbole construit */
mrange_t range; /* Couverture mémoire associée */
-
-
-
result = true;
-
-
get_elf_section_content(format, relxxx, &rel_start, &rel_size, NULL);
base = G_BIN_FORMAT(format);
@@ -127,25 +120,25 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx,
continue;
name = get_elf_symbol_name(format, dynsym, dynstr, index);
+
if (name == NULL)
- {
- /* FIXME */
name = "unknown";
- }
+
+ asprintf(&plt_name, "%s@plt", name);
switch (ELF_REL_TYPE(format, reloc))
{
case R_ARM_JUMP_SLOT:
virt = ELF_SYM(format, sym, st_value);
- if (virt == 0) continue;
+ if (virt == 0) goto lears_next;
final_virt = virt & ~0x1;
status = g_exe_format_translate_address_into_vmpa(G_EXE_FORMAT(format), final_virt, &addr);
- if (!status) continue;
+ if (!status) goto lears_next;
- routine = try_to_demangle_routine(name);
+ routine = try_to_demangle_routine(plt_name);
symbol = G_BIN_SYMBOL(routine);
init_mrange(&range, &addr, 0);
@@ -166,6 +159,10 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx,
if (symbol != NULL)
g_binary_format_add_symbol(base, symbol);
+ lears_next:
+
+ free(plt_name);
+
}
return result;