summaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-06-27 23:27:38 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-06-27 23:27:38 (GMT)
commitf38beea1951f9c323af3d05a3c4d2cf35f407245 (patch)
tree763a3ffc38b22135a7dccdbc521c8b21c5f37df7 /src/format
parenta3b128d4f448fa1eee12074a9bf0256b06e222e8 (diff)
Defined the minimal instruction size for a given architecture.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@171 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format')
-rw-r--r--src/format/elf/elf.c8
-rw-r--r--src/format/elf/elf_def.h1
-rw-r--r--src/format/executable.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/format/elf/elf.c b/src/format/elf/elf.c
index ccd00ae..3ed3dda 100644
--- a/src/format/elf/elf.c
+++ b/src/format/elf/elf.c
@@ -245,12 +245,16 @@ static FormatTargetMachine g_elf_format_get_target_machine(const GElfFormat *for
switch (ELF_HDR(format, format->header, e_machine))
{
+ case EM_386:
+ result = FTM_386;
+ break;
+
case EM_MIPS:
result = FTM_MIPS;
break;
- case EM_386:
- result = FTM_386;
+ case EM_ARM:
+ result = FTM_ARM;
break;
case EM_NONE:
diff --git a/src/format/elf/elf_def.h b/src/format/elf/elf_def.h
index f125106..916e81d 100644
--- a/src/format/elf/elf_def.h
+++ b/src/format/elf/elf_def.h
@@ -130,6 +130,7 @@ typedef union _elf_header
#define EM_386 3 /* Intel 80386 */
#define EM_MIPS 8 /* MIPS R3000 big-endian */
#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
+#define EM_ARM 40 /* ARM */
diff --git a/src/format/executable.h b/src/format/executable.h
index c90ccfe..a122977 100644
--- a/src/format/executable.h
+++ b/src/format/executable.h
@@ -37,6 +37,7 @@ typedef enum _FormatTargetMachine
{
FTM_NONE, /* Aucune archi. (reconnue) */
+ FTM_ARM, /* ARM vX */
FTM_DALVIK, /* Dalvik Virtual Machine */
FTM_JVM, /* Java Virtual Machine */
FTM_MIPS, /* Mips 32 ou 64 bits */