summaryrefslogtreecommitdiffstats
path: root/patchoat
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-01-13 16:41:53 -0800
committerAndreas Gampe <agampe@google.com>2015-01-13 20:19:56 -0800
commitc5a3ea7522b59c18daa4325d69703a6f7f743378 (patch)
tree22aced955bae73c2f032e7cd0fc970218a908419 /patchoat
parentd277efe59cc922f6070056dc130e29281cc4955a (diff)
downloadart-c5a3ea7522b59c18daa4325d69703a6f7f743378.zip
art-c5a3ea7522b59c18daa4325d69703a6f7f743378.tar.gz
art-c5a3ea7522b59c18daa4325d69703a6f7f743378.tar.bz2
ART: Introduce Mips32 R6
Add an instruction-set feature for Mips R6. Currently restricted to the interpreter. Change-Id: Ic6d888e135bc87340229a0543dd94d0c1e863edd
Diffstat (limited to 'patchoat')
-rw-r--r--patchoat/patchoat.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc
index b6ec223..28f9668 100644
--- a/patchoat/patchoat.cc
+++ b/patchoat/patchoat.cc
@@ -48,7 +48,7 @@
namespace art {
-static InstructionSet ElfISAToInstructionSet(Elf32_Word isa) {
+static InstructionSet ElfISAToInstructionSet(Elf32_Word isa, Elf32_Word e_flags) {
switch (isa) {
case EM_ARM:
return kArm;
@@ -59,7 +59,12 @@ static InstructionSet ElfISAToInstructionSet(Elf32_Word isa) {
case EM_X86_64:
return kX86_64;
case EM_MIPS:
- return kMips;
+ if (((e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R2) ||
+ ((e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R6)) {
+ return kMips;
+ } else {
+ return kNone;
+ }
default:
return kNone;
}
@@ -212,7 +217,7 @@ bool PatchOat::Patch(File* input_oat, const std::string& image_location, off_t d
LOG(ERROR) << "unable to read elf header";
return false;
}
- isa = ElfISAToInstructionSet(elf_hdr.e_machine);
+ isa = ElfISAToInstructionSet(elf_hdr.e_machine, elf_hdr.e_flags);
}
const char* isa_name = GetInstructionSetString(isa);
std::string image_filename;