summaryrefslogtreecommitdiff
path: root/src/format/elf
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-02-09 20:15:52 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-02-09 20:15:52 (GMT)
commit8d326041a0379b87e54be44506d544367567e89b (patch)
treea3c3555c27c30858155fbee4df0ca236f33774f8 /src/format/elf
parentb70f428256963385a140e9eb503624106df5aa9b (diff)
Registered all the supported processors in the system code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@467 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/elf')
-rw-r--r--src/format/elf/elf.c14
-rw-r--r--src/format/elf/helper_arm.c2
-rw-r--r--src/format/elf/helper_x86.c2
-rw-r--r--src/format/elf/symbols.c6
4 files changed, 12 insertions, 12 deletions
diff --git a/src/format/elf/elf.c b/src/format/elf/elf.c
index b659dd7..cc84335 100644
--- a/src/format/elf/elf.c
+++ b/src/format/elf/elf.c
@@ -57,7 +57,7 @@ static void g_elf_format_class_init(GElfFormatClass *);
static void g_elf_format_init(GElfFormat *);
/* Indique le type d'architecture visée par le format. */
-static FormatTargetMachine g_elf_format_get_target_machine(const GElfFormat *);
+static const char *g_elf_format_get_target_machine(const GElfFormat *);
/* Etend la définition des portions au sein d'un binaire. */
static void g_elf_format_refine_portions(const GElfFormat *, GBinPortion *);
@@ -239,27 +239,27 @@ GBinFormat *g_elf_format_new(const bin_t *content, off_t length)
* *
******************************************************************************/
-static FormatTargetMachine g_elf_format_get_target_machine(const GElfFormat *format)
+static const char *g_elf_format_get_target_machine(const GElfFormat *format)
{
- FormatTargetMachine result; /* Identifiant à retourner */
+ const char *result; /* Identifiant à retourner */
switch (ELF_HDR(format, format->header, e_machine))
{
case EM_386:
- result = FTM_386;
+ result = "i386";
break;
case EM_MIPS:
- result = FTM_MIPS;
+ result = "mips";
break;
case EM_ARM:
- result = FTM_ARM;
+ result = "armv7";
break;
case EM_NONE:
default:
- result = FTM_NONE;
+ result = NULL;
break;
}
diff --git a/src/format/elf/helper_arm.c b/src/format/elf/helper_arm.c
index d5e8af8..7282d23 100644
--- a/src/format/elf/helper_arm.c
+++ b/src/format/elf/helper_arm.c
@@ -362,7 +362,7 @@ GArchInstruction **decode_elf_relocations(GElfFormat *format, const elf_shdr *pl
get_elf_section_content(format, plt, &plt_start, &plt_size, &plt_address);
- proc = get_arch_processor_for_type(APT_386);
+ proc = NULL;//get_arch_processor_for_type(APT_386);
for (pos = 0; pos < plt_size; )
{
diff --git a/src/format/elf/helper_x86.c b/src/format/elf/helper_x86.c
index 708a7e1..742d1c3 100644
--- a/src/format/elf/helper_x86.c
+++ b/src/format/elf/helper_x86.c
@@ -216,7 +216,7 @@ GArchInstruction **decode_elf_relocations(GElfFormat *format, const elf_shdr *pl
get_elf_section_content(format, plt, &plt_start, &plt_size, &plt_address);
- proc = get_arch_processor_for_type(APT_386);
+ proc = NULL;//get_arch_processor_for_type(APT_386);
for (pos = 0; pos < plt_size; )
{
diff --git a/src/format/elf/symbols.c b/src/format/elf/symbols.c
index 2d8057e..31fbabd 100644
--- a/src/format/elf/symbols.c
+++ b/src/format/elf/symbols.c
@@ -1852,13 +1852,13 @@ static bool load_elf_external_symbols(GElfFormat *format, const elf_shdr *sectio
result = find_elf_section_by_index(format, ELF_SHDR(format, dynsym, sh_link), &dynstr);
if (result)
- switch (g_exe_format_get_target_machine(G_EXE_FORMAT(format)))
+ switch (ELF_HDR(format, format->header, e_machine))
{
- case FTM_ARM:
+ case EM_ARM:
result = load_elf_arm_relocated_symbols(format, &relxxx, &dynsym, &dynstr);
break;
- case FTM_386:
+ case EM_386:
result = load_elf_x86_relocated_symbols(format, &relxxx, &dynsym, &dynstr);
break;