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/symbols.c | |
parent | 1996274a43883aa58e8c565f7698bc7c338a9ce0 (diff) |
Merged routines into symbols.
Diffstat (limited to 'src/format/elf/symbols.c')
-rw-r--r-- | src/format/elf/symbols.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/format/elf/symbols.c b/src/format/elf/symbols.c index 8451911..62fae58 100644 --- a/src/format/elf/symbols.c +++ b/src/format/elf/symbols.c @@ -207,27 +207,19 @@ static void register_elf_entry_point(GElfFormat *format, virt_t vaddr, phys_t le /* Comptabilisation en tant que symbole */ if (g_binary_format_find_symbol_at(G_BIN_FORMAT(format), &addr, &symbol)) - { g_object_unref(G_OBJECT(routine)); - routine = g_binary_symbol_get_routine(symbol); - g_object_ref(G_OBJECT(routine)); - - _g_binary_symbol_attach_routine(symbol, routine, STP_ENTRY_POINT); - - g_object_unref(G_OBJECT(symbol)); - - } else { base = G_BIN_FORMAT(format); init_mrange(&range, &addr, len); - g_binary_routine_set_range(routine, &range); + symbol = G_BIN_SYMBOL(routine); + + g_binary_symbol_set_range(symbol, &range); + g_binary_symbol_set_target_type(symbol, STP_ENTRY_POINT); - symbol = g_binary_symbol_new(STP_ENTRY_POINT); - g_binary_symbol_attach_routine(symbol, routine); g_binary_format_add_symbol(base, symbol); /* Comptabilisation pour le désassemblage brut */ @@ -652,13 +644,9 @@ static bool do_elf_internal_symbol_loading(GElfLoading *loading, GElfFormat *for /* Routine */ routine = try_to_demangle_routine(name); + symbol = G_BIN_SYMBOL(routine); - g_binary_routine_set_range(routine, &range); - - /* Symbole uniquement */ - - symbol = g_binary_symbol_new(STP_ROUTINE); - g_binary_symbol_attach_routine(symbol, routine); + g_binary_symbol_set_range(symbol, &range); /* Comptabilisation pour le désassemblage brut */ |