summaryrefslogtreecommitdiff
path: root/src/format/elf/symbols.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-12-01 23:13:37 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-12-01 23:13:37 (GMT)
commitc6409e2c6a390a7cca40da8572c93a5268e90a27 (patch)
treea2163e55f17d2b6299e59a7539d01b8ae0020380 /src/format/elf/symbols.c
parentfc363c31cc0a24e026bac74b5f62f33f44bf0143 (diff)
Improved the Itanium demangling.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@139 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/elf/symbols.c')
-rw-r--r--src/format/elf/symbols.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/format/elf/symbols.c b/src/format/elf/symbols.c
index 94f10e3..3928c27 100644
--- a/src/format/elf/symbols.c
+++ b/src/format/elf/symbols.c
@@ -31,6 +31,7 @@
#include "elf-int.h"
#include "helper_x86.h"
#include "section.h"
+#include "../mangling/demangler.h"
#include "../../panels/log.h"
@@ -217,9 +218,28 @@ static bool load_elf_internal_symbols(GElfFormat *format)
/* Routine */
- routine = g_binary_routine_new();
+ printf("routine :: %s\n", name);
+ fflush(NULL);
+
+ if (1/*strcmp(name, "_Z41__static_initialization_and_destruction_0ii") == 0*/)
+ {
+
+ routine = try_to_demangle_routine(get_demangler_by_type(DGT_ITANIUM), name);
+
+ if (routine == NULL)
+ {
+ routine = g_binary_routine_new();
+ g_binary_routine_set_name(routine, strdup(name));
+ printf("failed\n");
+ }
+ else printf("success\n");
+
+ printf(" -->> '%s'\n", g_binary_routine_get_name(routine));
+
+ //exit(0);
+
+ }
- g_binary_routine_set_name(routine, strdup(name));
g_binary_routine_set_address(routine, ELF_SYM(format, sym, st_value));
g_binary_routine_set_size(routine, ELF_SYM(format, sym, st_size));