Check the machine type of an ELF file when loading.

This ensures that we reject wrong target ELF files,
and should result in a recompile for the right
target.

Change-Id: I898dddc4f2bb9b1607a7436083d0ba7619b6007b
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index f665f5c..c6e448e 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -743,19 +743,7 @@
   InstructionSetFeatures instruction_set_features =
       ParseFeatureList(Runtime::GetDefaultInstructionSetFeatures());
 
-#if defined(__arm__)
-  InstructionSet instruction_set = kThumb2;
-#elif defined(__aarch64__)
-  InstructionSet instruction_set = kArm64;
-#elif defined(__i386__)
-  InstructionSet instruction_set = kX86;
-#elif defined(__x86_64__)
-  InstructionSet instruction_set = kX86_64;
-#elif defined(__mips__)
-  InstructionSet instruction_set = kMips;
-#else
-  InstructionSet instruction_set = kNone;
-#endif
+  InstructionSet instruction_set = kRuntimeISA;
 
   // Profile file to use
   std::string profile_file;