update_engine: Use constants from elf.h.
This patch changes GetFileFormatELF() to use the constants from elf.h
and includes the mips architecture.
BUG=chromium:401873
TEST=FEATURES=test emerge-link update_engine
Change-Id: I4d2924f121cd56dc80b8099b46f4456ebb3dfefc
Reviewed-on: https://chromium-review.googlesource.com/211662
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/utils_unittest.cc b/utils_unittest.cc
index aa1f919..53e4428 100644
--- a/utils_unittest.cc
+++ b/utils_unittest.cc
@@ -11,8 +11,8 @@
#include <string>
#include <vector>
-#include <base/files/file_path.h>
#include <base/file_util.h>
+#include <base/files/file_path.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <gtest/gtest.h>
@@ -380,6 +380,14 @@
0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00,
0x90, 0x83, 0x04, 0x08, 0x34, 0x00, 0x00, 0x00});
+ // ELF 32-bit LSB executable, MIPS
+ GetFileFormatTester(
+ "ELF 32-bit little-endian mips",
+ vector<uint8_t>{0x7f, 0x45, 0x4c, 0x46, 0x01, 0x01, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0xc0, 0x12, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00});
+
// ELF 32-bit LSB executable, ARM
GetFileFormatTester(
"ELF 32-bit little-endian arm",