diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-06-01 17:49:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-06-01 17:49:32 (GMT) |
commit | f6252e57c770fea10439659f35a69a783ff849d3 (patch) | |
tree | efc64ca7703648e439483ee6f4c14db855d7f952 /src/format/elf/symbol.c | |
parent | 1b8152d6f95b03f81aa6a4043c23a45a9f74c418 (diff) |
Provided found MIPS routines.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@69 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/elf/symbol.c')
-rw-r--r-- | src/format/elf/symbol.c | 65 |
1 files changed, 63 insertions, 2 deletions
diff --git a/src/format/elf/symbol.c b/src/format/elf/symbol.c index fbb6fd8..eaf11a4 100644 --- a/src/format/elf/symbol.c +++ b/src/format/elf/symbol.c @@ -94,6 +94,10 @@ bool load_elf_symbols(elf_format *format) off_t str_size; /* Taille de section */ off_t rel_start; /* Début de section */ off_t rel_size; /* Taille de section */ + + + bool test; /* Bilan d'une recherche */ + off_t dyn_start; /* Début de section */ off_t dyn_size; /* Taille de section */ @@ -133,7 +137,56 @@ bool load_elf_symbols(elf_format *format) } - /* Relocalisations dynamiques */ + /* Liaison dynamique (si elle existe) */ + + test = find_elf_section_by_name(format, ".dynsym", §ion); + + if (!test) + { + test = find_elf_section_by_type(format, SHT_HASH, §ions, &count); + + if (test) + test = find_elf_section_by_index(format, ELF_SHDR(format, §ions[0], sh_link), §ion); + + } + + if (test) + { + get_elf_section_content(format, §ion, &dyn_start, &dyn_size, NULL); + + result &= find_elf_section_by_index(format, ELF_SHDR(format, §ion, sh_link), §ion); + + } + + if (result) + { + get_elf_section_content(format, §ion, &str_start, &str_size, NULL); + + switch (get_elf_target_machine(format)) + { + case FTM_MIPS: + result = g_elf_format_find_mips_dynamic_symbols(format, dyn_start, dyn_size, str_start, str_size); + break; + + default: + break; + + } + + } + + + + + + + + + + + + +#if 0 find_elf_section_by_type(format, SHT_REL, §ions, &count); @@ -171,6 +224,14 @@ bool load_elf_symbols(elf_format *format) /* Récupération (seconde partie) */ + + /* switch ... */ + + g_elf_format_translate_mips_external_calls(format); + exit(0); + + + if (result) { #if 0 @@ -182,7 +243,7 @@ bool load_elf_symbols(elf_format *format) #endif } - +#endif return result; |