diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-03-18 23:18:26 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-03-18 23:18:26 (GMT) |
commit | 4cef477cbdfd61a28ed6531d1e91d5a330a67704 (patch) | |
tree | 1b4708f624e0f3bdb26403ab06ac9689cf4cf583 /src/format/format.c | |
parent | 5c1636199a06965c549f748014d582dcb85ba7df (diff) |
Computed limits for all routines according to existing symbols.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@491 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/format.c')
-rw-r--r-- | src/format/format.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/format/format.c b/src/format/format.c index 2808b67..2093469 100644 --- a/src/format/format.c +++ b/src/format/format.c @@ -192,11 +192,28 @@ void g_binary_format_add_symbol(GBinFormat *format, GBinSymbol *symbol) format->symbols[format->symbols_count - 1] = symbol; - qsort(format->symbols, format->symbols_count, sizeof(GBinSymbol *), (__compar_fn_t)g_binary_symbol_cmp); + switch (g_binary_symbol_get_target_type(symbol)) + { + case STP_ROUTINE: + case STP_ENTRY_POINT: + + format->routines = (GBinRoutine **)realloc(format->routines, + ++format->routines_count * sizeof(GBinRoutine *)); + + format->routines[format->routines_count - 1] = g_binary_symbol_get_routine(symbol); + + qsort(format->routines, format->routines_count, + sizeof(GBinRoutine *), (__compar_fn_t)g_binary_routine_compare); + break; + + default: + break; + + } } |