diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-01-29 22:49:43 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-01-29 22:49:43 (GMT) |
commit | 896b31fbbef2fba442566a422fa4d409771b61dd (patch) | |
tree | b75725f043d54e5a454216a11d89018956ee9c26 /plugins/elf/symbols.c | |
parent | 6c51b9eed427fd55ce1457834853386cc8d543cd (diff) |
Introduced specific operations for ELF architectures.
Diffstat (limited to 'plugins/elf/symbols.c')
-rw-r--r-- | plugins/elf/symbols.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/plugins/elf/symbols.c b/plugins/elf/symbols.c index 4854d7b..dbf3305 100644 --- a/plugins/elf/symbols.c +++ b/plugins/elf/symbols.c @@ -42,7 +42,6 @@ #include "dynamic.h" #include "elf-int.h" -#include "helper_arm.h" #include "loading.h" #include "program.h" #include "section.h" @@ -189,10 +188,7 @@ static void register_elf_entry_point(GElfFormat *format, virt_t vaddr, phys_t le /* Localisation complète du symbole */ - if (ELF_HDR(format, format->header, e_machine) == EM_ARM) - final_vaddr = vaddr & ~0x1; - else - final_vaddr = vaddr; + final_vaddr = format->ops.fix_virt(vaddr); status = g_exe_format_translate_address_into_vmpa(G_EXE_FORMAT(format), final_vaddr, &addr); if (!status) return; @@ -514,8 +510,7 @@ static bool do_elf_symbol_loading(GElfLoading *loading, GElfFormat *format, bool /* Ajustement de la position */ - if (ELF_HDR(format, format->header, e_machine) == EM_ARM) - virt &= ~0x1; + virt = format->ops.fix_virt(virt); /* Constitution d'une routine */ @@ -1205,11 +1200,7 @@ static bool do_elf_relocation_renaming(GElfLoading *loading, GElfFormat *format, /* Détermination de la relocalisation associée */ - if (ELF_HDR(format, format->header, e_machine) == EM_ARM) - result = retrieve_arm_linkage_offset(format, range, &offset); - else - result = false; - + result = format->ops.get_linkage_offset(format, range, &offset); if (!result) goto derr_exit; result = g_elf_loading_search_for_relocation(loading, &offset, &reloc); |