summaryrefslogtreecommitdiff
path: root/src/format/elf/helper_arm.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-12-16 19:45:47 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-12-16 19:45:47 (GMT)
commite4b56188b664e6b986733d456e6a0ea9b2da6d53 (patch)
tree5ee91a7b9f09a3d7550fbafde83c042f078689d3 /src/format/elf/helper_arm.c
parent7c40b70d6c1e1e13dadf876c8dda60b525616d47 (diff)
Dealt with empty ranges in the early states of disassembled symbols.
Diffstat (limited to 'src/format/elf/helper_arm.c')
-rw-r--r--src/format/elf/helper_arm.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/format/elf/helper_arm.c b/src/format/elf/helper_arm.c
index f47df5d..f966296 100644
--- a/src/format/elf/helper_arm.c
+++ b/src/format/elf/helper_arm.c
@@ -118,30 +118,22 @@ bool load_elf_arm_relocated_symbols(GElfFormat *format, const elf_shdr *relxxx,
symbol = g_binary_symbol_new(STP_ROUTINE);
g_binary_symbol_attach_routine(symbol, routine);
- g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol);
/* Comptabilisation pour le désassemblage brut */
g_binary_format_register_code_point(G_BIN_FORMAT(format), virt, false);
-
- /*
- printf("got a jump ! >> %d - %s\n", index, name);
- printf(" -->> val = 0x%08lx\n", ELF_SYM(format, sym, st_value));
- printf(" -->> 0x%08lx =>> 0x%08lx\n", (unsigned int)ELF_REL(format, reloc, r_offset),
- ((unsigned int)ELF_SHDR(format, (*relxxx), sh_addr) + ELF_REL(format, reloc, r_offset)));
- */
-
- //symbol = g_binary_symbol_new(STP_FUNCTION));
- //g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol);
-
break;
default:
printf("Relocation not supported (%lld) !\n", ELF_REL_TYPE(format, reloc));
+ symbol = NULL;
break;
}
+ if (symbol != NULL)
+ _g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol, false);
+
}
return result;