From 50dae3067dec0250e9264595997b3aaa67ddd055 Mon Sep 17 00:00:00 2001 From: jet Date: Fri, 30 Oct 2009 15:04:15 -0600 Subject: [PATCH] modified binaryToObject to support ARM --- src/binaryToObject/elf.cpp | 3 +++ src/binaryToObject/main.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/binaryToObject/elf.cpp b/src/binaryToObject/elf.cpp index 81d90616eb..8a6c2417d1 100644 --- a/src/binaryToObject/elf.cpp +++ b/src/binaryToObject/elf.cpp @@ -42,6 +42,7 @@ #define EM_386 3 #define EM_X86_64 62 +#define EM_ARM 40 #define SHT_PROGBITS 1 #define SHT_SYMTAB 2 @@ -352,6 +353,8 @@ MAKE_NAME(writeElf, BITS_PER_WORD, Object) machine = EM_X86_64; } else if (strcmp(architecture, "i386") == 0) { machine = EM_386; + } else if (strcmp(architecture, "arm") == 0) { + machine = EM_ARM; } else { fprintf(stderr, "unsupported architecture: %s\n", architecture); return false; diff --git a/src/binaryToObject/main.cpp b/src/binaryToObject/main.cpp index 0200dd4123..a6fcbd6cce 100644 --- a/src/binaryToObject/main.cpp +++ b/src/binaryToObject/main.cpp @@ -69,7 +69,8 @@ writeObject(uint8_t* data, unsigned size, FILE* out, const char* startName, success = writeElf64Object (data, size, out, startName, endName, architecture, alignment, writable, executable); - } else if (strcmp("i386", architecture) == 0) { + } else if (strcmp("i386", architecture) == 0 || + strcmp("arm", architecture) == 0) { found = true; success = writeElf32Object (data, size, out, startName, endName, architecture, alignment,