aboutsummaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-03-24 21:31:36 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-03-24 21:31:36 +0000
commitfb911942f1434f3d1750f83f25f5e42c80e60638 (patch)
tree1678c4a4f0182e4029a86d135aa4a1b7d09e3c41 /unittests
downloadsrc-fb911942f1434f3d1750f83f25f5e42c80e60638.tar.gz
src-fb911942f1434f3d1750f83f25f5e42c80e60638.zip
Vendor import of lld trunk r233088:vendor/lld/lld-trunk-r233088
Notes
Notes: svn path=/vendor/lld/dist/; revision=280461 svn path=/vendor/lld/lld-trunk-r233088/; revision=280462; tag=vendor/lld/lld-trunk-r233088
Diffstat (limited to 'unittests')
-rw-r--r--unittests/CMakeLists.txt15
-rw-r--r--unittests/CoreTests/CMakeLists.txt4
-rw-r--r--unittests/CoreTests/Makefile14
-rw-r--r--unittests/CoreTests/ParallelTest.cpp31
-rw-r--r--unittests/CoreTests/RangeTest.cpp240
-rw-r--r--unittests/DriverTests/CMakeLists.txt14
-rw-r--r--unittests/DriverTests/DarwinLdDriverTest.cpp240
-rw-r--r--unittests/DriverTests/DriverTest.h61
-rw-r--r--unittests/DriverTests/GnuLdDriverTest.cpp284
-rw-r--r--unittests/DriverTests/Makefile20
-rw-r--r--unittests/DriverTests/UniversalDriverTest.cpp33
-rw-r--r--unittests/DriverTests/WinLinkDriverTest.cpp728
-rw-r--r--unittests/DriverTests/WinLinkModuleDefTest.cpp155
-rw-r--r--unittests/MachOTests/CMakeLists.txt13
-rw-r--r--unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp748
-rw-r--r--unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp693
-rw-r--r--unittests/MachOTests/MachONormalizedFileToAtomsTests.cpp94
-rw-r--r--unittests/MachOTests/MachONormalizedFileYAMLTests.cpp766
-rw-r--r--unittests/MachOTests/empty_obj_x86_armv7.txt1272
-rw-r--r--unittests/Makefile31
20 files changed, 5456 insertions, 0 deletions
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
new file mode 100644
index 000000000000..bb651b5cfe62
--- /dev/null
+++ b/unittests/CMakeLists.txt
@@ -0,0 +1,15 @@
+add_custom_target(LLDUnitTests)
+set_target_properties(LLDUnitTests PROPERTIES FOLDER "lld tests")
+
+# add_lld_unittest(test_dirname file1.cpp file2.cpp)
+#
+# Will compile the list of files together and link against lld
+# Produces a binary named 'basename(test_dirname)'.
+function(add_lld_unittest test_dirname)
+ add_unittest(LLDUnitTests ${test_dirname} ${ARGN})
+ target_link_libraries(${test_dirname} ${LLVM_COMMON_LIBS})
+endfunction()
+
+add_subdirectory(CoreTests)
+add_subdirectory(DriverTests)
+add_subdirectory(MachOTests)
diff --git a/unittests/CoreTests/CMakeLists.txt b/unittests/CoreTests/CMakeLists.txt
new file mode 100644
index 000000000000..aa85617916b4
--- /dev/null
+++ b/unittests/CoreTests/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_lld_unittest(CoreTests
+ ParallelTest.cpp
+ RangeTest.cpp
+ )
diff --git a/unittests/CoreTests/Makefile b/unittests/CoreTests/Makefile
new file mode 100644
index 000000000000..366df01a08cc
--- /dev/null
+++ b/unittests/CoreTests/Makefile
@@ -0,0 +1,14 @@
+##===- unittests/CoreTests/Makefile ----------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLD_LEVEL = ../..
+TESTNAME = CoreTest
+LLVMLIBS = gtest.a LLVMOption.a LLVMSupport.a
+
+include $(LLD_LEVEL)/unittests/Makefile
diff --git a/unittests/CoreTests/ParallelTest.cpp b/unittests/CoreTests/ParallelTest.cpp
new file mode 100644
index 000000000000..c0282437e2e1
--- /dev/null
+++ b/unittests/CoreTests/ParallelTest.cpp
@@ -0,0 +1,31 @@
+//===- lld/unittest/ParallelTest.cpp --------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief Parallel.h unit tests.
+///
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "lld/Core/Parallel.h"
+#include <array>
+#include <random>
+
+uint32_t array[1024 * 1024];
+
+TEST(Parallel, sort) {
+ std::mt19937 randEngine;
+ std::uniform_int_distribution<uint32_t> dist;
+
+ for (auto &i : array)
+ i = dist(randEngine);
+
+ lld::parallel_sort(std::begin(array), std::end(array));
+ ASSERT_TRUE(std::is_sorted(std::begin(array), std::end(array)));
+}
diff --git a/unittests/CoreTests/RangeTest.cpp b/unittests/CoreTests/RangeTest.cpp
new file mode 100644
index 000000000000..2b2fcd5f7875
--- /dev/null
+++ b/unittests/CoreTests/RangeTest.cpp
@@ -0,0 +1,240 @@
+//===- lld/unittest/RangeTest.cpp -----------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief range.h unit tests.
+///
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "lld/Core/range.h"
+#include <array>
+#include <assert.h>
+#include <deque>
+#include <forward_list>
+#include <iterator>
+#include <list>
+#include <numeric>
+#include <sstream>
+#include <vector>
+
+template <typename T, typename U> struct AssertTypesSame;
+template <typename T> struct AssertTypesSame<T, T> {};
+#define ASSERT_TYPES_SAME(T, U) AssertTypesSame<T, U>()
+
+struct no_begin {};
+struct member_begin {
+ int *begin();
+};
+struct free_begin {};
+int *begin(free_begin);
+
+template <typename T>
+auto type_of_forward(T &&t) -> decltype(std::forward<T>(t)) {
+ return std::forward<T>(t);
+}
+
+template <typename To> To implicit_cast(To val) { return val; }
+
+void test_traits() {
+ using namespace lld::detail;
+ ASSERT_TYPES_SAME(begin_result<no_begin>::type, undefined);
+ // This causes clang to segfault.
+#if 0
+ ASSERT_TYPES_SAME(
+ begin_result<decltype(type_of_forward(member_begin()))>::type, int *);
+#endif
+ ASSERT_TYPES_SAME(begin_result<free_begin>::type, int *);
+}
+
+TEST(Range, constructors) {
+ std::vector<int> v(5);
+ std::iota(v.begin(), v.end(), 0);
+ lld::range<std::vector<int>::iterator> r = v;
+ EXPECT_EQ(v.begin(), r.begin());
+ EXPECT_EQ(v.end(), r.end());
+
+ int arr[] = { 1, 2, 3, 4, 5 };
+ std::begin(arr);
+ lld::range<int *> r2 = arr;
+ EXPECT_EQ(5, r2.back());
+}
+
+TEST(Range, conversion_to_pointer_range) {
+ std::vector<int> v(5);
+ std::iota(v.begin(), v.end(), 0);
+ lld::range<int *> r = v;
+ EXPECT_EQ(&*v.begin(), r.begin());
+ EXPECT_EQ(2, r[2]);
+}
+
+template <typename Iter> void takes_range(lld::range<Iter> r) {
+ int expected = 0;
+ for (int val : r) {
+ EXPECT_EQ(expected++, val);
+ }
+}
+
+void takes_ptr_range(lld::range<const int *> r) {
+ int expected = 0;
+ for (int val : r) {
+ EXPECT_EQ(expected++, val);
+ }
+}
+
+TEST(Range, passing) {
+ using lld::make_range;
+ using lld::make_ptr_range;
+ std::list<int> l(5);
+ std::iota(l.begin(), l.end(), 0);
+ takes_range(make_range(l));
+ takes_range(make_range(implicit_cast<const std::list<int> &>(l)));
+ std::deque<int> d(5);
+ std::iota(d.begin(), d.end(), 0);
+ takes_range(make_range(d));
+ takes_range(make_range(implicit_cast<const std::deque<int> &>(d)));
+ std::vector<int> v(5);
+ std::iota(v.begin(), v.end(), 0);
+ takes_range(make_range(v));
+ takes_range(make_range(implicit_cast<const std::vector<int> &>(v)));
+ static_assert(
+ std::is_same<decltype(make_ptr_range(v)), lld::range<int *>>::value,
+ "make_ptr_range should return a range of pointers");
+ takes_range(make_ptr_range(v));
+ takes_range(make_ptr_range(implicit_cast<const std::vector<int> &>(v)));
+ int arr[] = { 0, 1, 2, 3, 4 };
+ takes_range(make_range(arr));
+ const int carr[] = { 0, 1, 2, 3, 4 };
+ takes_range(make_range(carr));
+
+ takes_ptr_range(v);
+ takes_ptr_range(implicit_cast<const std::vector<int> &>(v));
+ takes_ptr_range(arr);
+ takes_ptr_range(carr);
+}
+
+TEST(Range, access) {
+ std::array<int, 5> a = { { 1, 2, 3, 4, 5 } };
+ lld::range<decltype(a.begin())> r = a;
+ EXPECT_EQ(4, r[3]);
+ EXPECT_EQ(4, r[-2]);
+}
+
+template <bool b> struct CompileAssert;
+template <> struct CompileAssert<true> {};
+
+#if __has_feature(cxx_constexpr)
+constexpr int arr[] = { 1, 2, 3, 4, 5 };
+TEST(Range, constexpr) {
+ constexpr lld::range<const int *> r(arr, arr + 5);
+ CompileAssert<r.front() == 1>();
+ CompileAssert<r.size() == 5>();
+ CompileAssert<r[4] == 5>();
+}
+#endif
+
+template <typename Container> void test_slice() {
+ Container cont(10);
+ std::iota(cont.begin(), cont.end(), 0);
+ lld::range<decltype(cont.begin())> r = cont;
+
+ // One argument.
+ EXPECT_EQ(10, r.slice(0).size());
+ EXPECT_EQ(8, r.slice(2).size());
+ EXPECT_EQ(2, r.slice(2).front());
+ EXPECT_EQ(1, r.slice(-1).size());
+ EXPECT_EQ(9, r.slice(-1).front());
+
+ // Two positive arguments.
+ EXPECT_TRUE(r.slice(5, 2).empty());
+ EXPECT_EQ(next(cont.begin(), 5), r.slice(5, 2).begin());
+ EXPECT_EQ(1, r.slice(1, 2).size());
+ EXPECT_EQ(1, r.slice(1, 2).front());
+
+ // Two negative arguments.
+ EXPECT_TRUE(r.slice(-2, -5).empty());
+ EXPECT_EQ(next(cont.begin(), 8), r.slice(-2, -5).begin());
+ EXPECT_EQ(1, r.slice(-2, -1).size());
+ EXPECT_EQ(8, r.slice(-2, -1).front());
+
+ // Positive start, negative stop.
+ EXPECT_EQ(1, r.slice(6, -3).size());
+ EXPECT_EQ(6, r.slice(6, -3).front());
+ EXPECT_TRUE(r.slice(6, -5).empty());
+ EXPECT_EQ(next(cont.begin(), 6), r.slice(6, -5).begin());
+
+ // Negative start, positive stop.
+ EXPECT_TRUE(r.slice(-3, 6).empty());
+ EXPECT_EQ(next(cont.begin(), 7), r.slice(-3, 6).begin());
+ EXPECT_EQ(1, r.slice(-5, 6).size());
+ EXPECT_EQ(5, r.slice(-5, 6).front());
+}
+
+TEST(Range, slice) {
+ // -fsanitize=undefined complains about this, but only if optimizations are
+ // enabled.
+#if 0
+ test_slice<std::forward_list<int>>();
+#endif
+ test_slice<std::list<int>>();
+// This doesn't build with libstdc++ 4.7
+#if 0
+ test_slice<std::deque<int>>();
+#endif
+}
+
+// This test is flaky and I've yet to pin down why. Changing between
+// EXPECT_EQ(1, input.front()) and EXPECT_TRUE(input.front() == 1) makes it work
+// with VS 2012 in Debug mode. Clang on Linux seems to fail with -03 and -02 -g
+// -fsanitize=undefined.
+#if 0
+TEST(Range, istream_range) {
+ std::istringstream stream("1 2 3 4 5");
+ // MSVC interprets input as a function declaration if you don't declare start
+ // and instead directly pass std::istream_iterator<int>(stream).
+ auto start = std::istream_iterator<int>(stream);
+ lld::range<std::istream_iterator<int>> input(
+ start, std::istream_iterator<int>());
+ EXPECT_TRUE(input.front() == 1);
+ input.pop_front();
+ EXPECT_TRUE(input.front() == 2);
+ input.pop_front(2);
+ EXPECT_TRUE(input.front() == 4);
+ input.pop_front_upto(7);
+ EXPECT_TRUE(input.empty());
+}
+#endif
+
+//! [algorithm using range]
+template <typename T> void partial_sum(T &container) {
+ using lld::make_range;
+ auto range = make_range(container);
+ typename T::value_type sum = 0;
+ // One would actually use a range-based for loop
+ // in this case, but you get the idea:
+ for (; !range.empty(); range.pop_front()) {
+ sum += range.front();
+ range.front() = sum;
+ }
+}
+
+TEST(Range, user1) {
+ std::vector<int> v(5, 2);
+ partial_sum(v);
+ EXPECT_EQ(8, v[3]);
+}
+//! [algorithm using range]
+
+//! [algorithm using ptr_range]
+void my_write(int fd, lld::range<const char *> buffer) {}
+
+TEST(Range, user2) {
+ std::string s("Hello world");
+ my_write(1, s);
+}
diff --git a/unittests/DriverTests/CMakeLists.txt b/unittests/DriverTests/CMakeLists.txt
new file mode 100644
index 000000000000..59d56d459582
--- /dev/null
+++ b/unittests/DriverTests/CMakeLists.txt
@@ -0,0 +1,14 @@
+add_lld_unittest(DriverTests
+ UniversalDriverTest.cpp
+ GnuLdDriverTest.cpp
+ DarwinLdDriverTest.cpp
+ WinLinkDriverTest.cpp
+ WinLinkModuleDefTest.cpp
+ )
+
+target_link_libraries(DriverTests
+ lldDriver
+ lldCore
+ lldPECOFF
+ lldMachO
+ )
diff --git a/unittests/DriverTests/DarwinLdDriverTest.cpp b/unittests/DriverTests/DarwinLdDriverTest.cpp
new file mode 100644
index 000000000000..1c77a05f5856
--- /dev/null
+++ b/unittests/DriverTests/DarwinLdDriverTest.cpp
@@ -0,0 +1,240 @@
+//===- lld/unittest/DarwinLdDriverTest.cpp --------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief Darwin's ld driver tests.
+///
+//===----------------------------------------------------------------------===//
+
+#include "DriverTest.h"
+#include "lld/ReaderWriter/MachOLinkingContext.h"
+#include "llvm/Support/MachO.h"
+
+using namespace llvm;
+using namespace lld;
+
+namespace {
+class DarwinLdParserTest
+ : public ParserTest<DarwinLdDriver, MachOLinkingContext> {
+protected:
+ const LinkingContext *linkingContext() override { return &_ctx; }
+};
+}
+
+TEST_F(DarwinLdParserTest, Basic) {
+ EXPECT_TRUE(parse("ld", "foo.o", "bar.o", "-arch", "i386", nullptr));
+ EXPECT_FALSE(_ctx.allowRemainingUndefines());
+ EXPECT_FALSE(_ctx.deadStrip());
+ EXPECT_EQ(2, inputFileCount());
+ EXPECT_EQ("foo.o", inputFile(0));
+ EXPECT_EQ("bar.o", inputFile(1));
+}
+
+TEST_F(DarwinLdParserTest, Output) {
+ EXPECT_TRUE(parse("ld", "-o", "my.out", "foo.o", "-arch", "i386", nullptr));
+ EXPECT_EQ("my.out", _ctx.outputPath());
+}
+
+TEST_F(DarwinLdParserTest, Dylib) {
+ EXPECT_TRUE(parse("ld", "-dylib", "foo.o", "-arch", "i386", nullptr));
+ EXPECT_EQ(llvm::MachO::MH_DYLIB, _ctx.outputMachOType());
+}
+
+TEST_F(DarwinLdParserTest, Relocatable) {
+ EXPECT_TRUE(parse("ld", "-r", "foo.o", "-arch", "i386", nullptr));
+ EXPECT_EQ(llvm::MachO::MH_OBJECT, _ctx.outputMachOType());
+}
+
+TEST_F(DarwinLdParserTest, Bundle) {
+ EXPECT_TRUE(parse("ld", "-bundle", "foo.o", "-arch", "i386", nullptr));
+ EXPECT_EQ(llvm::MachO::MH_BUNDLE, _ctx.outputMachOType());
+}
+
+TEST_F(DarwinLdParserTest, Preload) {
+ EXPECT_TRUE(parse("ld", "-preload", "foo.o", "-arch", "i386", nullptr));
+ EXPECT_EQ(llvm::MachO::MH_PRELOAD, _ctx.outputMachOType());
+}
+
+TEST_F(DarwinLdParserTest, Static) {
+ EXPECT_TRUE(parse("ld", "-static", "foo.o", "-arch", "i386", nullptr));
+ EXPECT_EQ(llvm::MachO::MH_EXECUTE, _ctx.outputMachOType());
+}
+
+TEST_F(DarwinLdParserTest, Entry) {
+ EXPECT_TRUE(parse("ld", "-e", "entryFunc", "foo.o", "-arch", "i386",nullptr));
+ EXPECT_EQ("entryFunc", _ctx.entrySymbolName());
+}
+
+TEST_F(DarwinLdParserTest, DeadStrip) {
+ EXPECT_TRUE(parse("ld", "-arch", "x86_64", "-dead_strip", "foo.o", nullptr));
+ EXPECT_TRUE(_ctx.deadStrip());
+}
+
+TEST_F(DarwinLdParserTest, DeadStripRootsExe) {
+ EXPECT_TRUE(parse("ld", "-arch", "x86_64", "-dead_strip", "foo.o", nullptr));
+ EXPECT_FALSE(_ctx.globalsAreDeadStripRoots());
+}
+
+TEST_F(DarwinLdParserTest, DeadStripRootsDylib) {
+ EXPECT_TRUE(parse("ld", "-arch", "x86_64", "-dylib", "-dead_strip", "foo.o",
+ nullptr));
+ EXPECT_TRUE(_ctx.globalsAreDeadStripRoots());
+}
+
+TEST_F(DarwinLdParserTest, Arch) {
+ EXPECT_TRUE(parse("ld", "-arch", "x86_64", "foo.o", nullptr));
+ EXPECT_EQ(MachOLinkingContext::arch_x86_64, _ctx.arch());
+ EXPECT_EQ((uint32_t)llvm::MachO::CPU_TYPE_X86_64, _ctx.getCPUType());
+ EXPECT_EQ(llvm::MachO::CPU_SUBTYPE_X86_64_ALL, _ctx.getCPUSubType());
+}
+
+TEST_F(DarwinLdParserTest, Arch_x86) {
+ EXPECT_TRUE(parse("ld", "-arch", "i386", "foo.o", nullptr));
+ EXPECT_EQ(MachOLinkingContext::arch_x86, _ctx.arch());
+ EXPECT_EQ((uint32_t)llvm::MachO::CPU_TYPE_I386, _ctx.getCPUType());
+ EXPECT_EQ(llvm::MachO::CPU_SUBTYPE_X86_ALL, _ctx.getCPUSubType());
+}
+
+TEST_F(DarwinLdParserTest, Arch_armv6) {
+ EXPECT_TRUE(parse("ld", "-arch", "armv6", "foo.o", nullptr));
+ EXPECT_EQ(MachOLinkingContext::arch_armv6, _ctx.arch());
+ EXPECT_EQ((uint32_t)llvm::MachO::CPU_TYPE_ARM, _ctx.getCPUType());
+ EXPECT_EQ(llvm::MachO::CPU_SUBTYPE_ARM_V6, _ctx.getCPUSubType());
+}
+
+TEST_F(DarwinLdParserTest, Arch_armv7) {
+ EXPECT_TRUE(parse("ld", "-arch", "armv7", "foo.o", nullptr));
+ EXPECT_EQ(MachOLinkingContext::arch_armv7, _ctx.arch());
+ EXPECT_EQ((uint32_t)llvm::MachO::CPU_TYPE_ARM, _ctx.getCPUType());
+ EXPECT_EQ(llvm::MachO::CPU_SUBTYPE_ARM_V7, _ctx.getCPUSubType());
+}
+
+TEST_F(DarwinLdParserTest, Arch_armv7s) {
+ EXPECT_TRUE(parse("ld", "-arch", "armv7s", "foo.o", nullptr));
+ EXPECT_EQ(MachOLinkingContext::arch_armv7s, _ctx.arch());
+ EXPECT_EQ((uint32_t)llvm::MachO::CPU_TYPE_ARM, _ctx.getCPUType());
+ EXPECT_EQ(llvm::MachO::CPU_SUBTYPE_ARM_V7S, _ctx.getCPUSubType());
+}
+
+TEST_F(DarwinLdParserTest, MinMacOSX10_7) {
+ EXPECT_TRUE(parse("ld", "-macosx_version_min", "10.7", "foo.o",
+ "-arch", "x86_64", nullptr));
+ EXPECT_EQ(MachOLinkingContext::OS::macOSX, _ctx.os());
+ EXPECT_TRUE(_ctx.minOS("10.7", ""));
+ EXPECT_FALSE(_ctx.minOS("10.8", ""));
+}
+
+TEST_F(DarwinLdParserTest, MinMacOSX10_8) {
+ EXPECT_TRUE(parse("ld", "-macosx_version_min", "10.8.3", "foo.o",
+ "-arch", "x86_64", nullptr));
+ EXPECT_EQ(MachOLinkingContext::OS::macOSX, _ctx.os());
+ EXPECT_TRUE(_ctx.minOS("10.7", ""));
+ EXPECT_TRUE(_ctx.minOS("10.8", ""));
+}
+
+TEST_F(DarwinLdParserTest, iOS5) {
+ EXPECT_TRUE(parse("ld", "-ios_version_min", "5.0", "foo.o",
+ "-arch", "armv7", nullptr));
+ EXPECT_EQ(MachOLinkingContext::OS::iOS, _ctx.os());
+ EXPECT_TRUE(_ctx.minOS("", "5.0"));
+ EXPECT_FALSE(_ctx.minOS("", "6.0"));
+}
+
+TEST_F(DarwinLdParserTest, iOS6) {
+ EXPECT_TRUE(parse("ld", "-ios_version_min", "6.0", "foo.o", "-arch", "armv7",
+ nullptr));
+ EXPECT_EQ(MachOLinkingContext::OS::iOS, _ctx.os());
+ EXPECT_TRUE(_ctx.minOS("", "5.0"));
+ EXPECT_TRUE(_ctx.minOS("", "6.0"));
+}
+
+TEST_F(DarwinLdParserTest, iOS_Simulator5) {
+ EXPECT_TRUE(parse("ld", "-ios_simulator_version_min", "5.0", "a.o",
+ "-arch", "i386", nullptr));
+ EXPECT_EQ(MachOLinkingContext::OS::iOS_simulator, _ctx.os());
+ EXPECT_TRUE(_ctx.minOS("", "5.0"));
+ EXPECT_FALSE(_ctx.minOS("", "6.0"));
+}
+
+TEST_F(DarwinLdParserTest, iOS_Simulator6) {
+ EXPECT_TRUE(parse("ld", "-ios_simulator_version_min", "6.0", "a.o",
+ "-arch", "i386", nullptr));
+ EXPECT_EQ(MachOLinkingContext::OS::iOS_simulator, _ctx.os());
+ EXPECT_TRUE(_ctx.minOS("", "5.0"));
+ EXPECT_TRUE(_ctx.minOS("", "6.0"));
+}
+
+TEST_F(DarwinLdParserTest, compatibilityVersion) {
+ EXPECT_TRUE(
+ parse("ld", "-dylib", "-compatibility_version", "1.2.3", "a.o",
+ "-arch", "i386",nullptr));
+ EXPECT_EQ(_ctx.compatibilityVersion(), 0x10203U);
+}
+
+TEST_F(DarwinLdParserTest, compatibilityVersionInvalidType) {
+ EXPECT_FALSE(parse("ld", "-bundle", "-compatibility_version", "1.2.3", "a.o",
+ "-arch", "i386",nullptr));
+}
+
+TEST_F(DarwinLdParserTest, compatibilityVersionInvalidValue) {
+ EXPECT_FALSE(parse("ld", "-bundle", "-compatibility_version", "1,2,3", "a.o",
+ "-arch", "i386", nullptr));
+}
+
+TEST_F(DarwinLdParserTest, currentVersion) {
+ EXPECT_TRUE(
+ parse("ld", "-dylib", "-current_version", "1.2.3", "a.o", "-arch", "i386",
+ nullptr));
+ EXPECT_EQ(_ctx.currentVersion(), 0x10203U);
+}
+
+TEST_F(DarwinLdParserTest, currentVersionInvalidType) {
+ EXPECT_FALSE(
+ parse("ld", "-bundle", "-current_version", "1.2.3", "a.o",
+ "-arch", "i386", nullptr));
+}
+
+TEST_F(DarwinLdParserTest, currentVersionInvalidValue) {
+ EXPECT_FALSE(
+ parse("ld", "-bundle", "-current_version", "1,2,3", "a.o",
+ "-arch", "i386", nullptr));
+}
+
+TEST_F(DarwinLdParserTest, bundleLoader) {
+ EXPECT_TRUE(
+ parse("ld", "-bundle", "-bundle_loader", "/bin/ls", "a.o",
+ "-arch", "i386", nullptr));
+ EXPECT_EQ(_ctx.bundleLoader(), "/bin/ls");
+}
+
+TEST_F(DarwinLdParserTest, bundleLoaderInvalidType) {
+ EXPECT_FALSE(parse("ld", "-bundle_loader", "/bin/ls", "a.o", "-arch", "i386",
+ nullptr));
+}
+
+TEST_F(DarwinLdParserTest, deadStrippableDylib) {
+ EXPECT_TRUE(
+ parse("ld", "-dylib", "-mark_dead_strippable_dylib", "a.o",
+ "-arch", "i386", nullptr));
+ EXPECT_EQ(true, _ctx.deadStrippableDylib());
+}
+
+TEST_F(DarwinLdParserTest, deadStrippableDylibInvalidType) {
+ EXPECT_FALSE(parse("ld", "-mark_dead_strippable_dylib", "a.o",
+ "-arch", "i386", nullptr));
+}
+
+TEST_F(DarwinLdParserTest, llvmOptions) {
+ EXPECT_TRUE(parse("ld", "-mllvm", "-debug-only", "-mllvm", "foo", "a.o",
+ "-arch", "i386", nullptr));
+ const std::vector<const char *> &options = _ctx.llvmOptions();
+ EXPECT_EQ(options.size(), 2UL);
+ EXPECT_EQ(strcmp(options[0],"-debug-only"), 0);
+ EXPECT_EQ(strcmp(options[1],"foo"), 0);
+}
diff --git a/unittests/DriverTests/DriverTest.h b/unittests/DriverTests/DriverTest.h
new file mode 100644
index 000000000000..2349132ee2ce
--- /dev/null
+++ b/unittests/DriverTests/DriverTest.h
@@ -0,0 +1,61 @@
+//===- lld/unittest/DriverTest.h ------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lld/Driver/Driver.h"
+#include "llvm/Support/raw_ostream.h"
+#include "gtest/gtest.h"
+#include <stdarg.h>
+
+namespace {
+
+using namespace llvm;
+using namespace lld;
+
+template<typename D, typename T>
+class ParserTest : public testing::Test {
+protected:
+
+ virtual const LinkingContext *linkingContext() = 0;
+
+ std::string &errorMessage() { return _errorMessage; }
+
+ // Convenience method for getting number of input files.
+ int inputFileCount() {
+ return linkingContext()->getNodes().size();
+ }
+
+ // Convenience method for getting i'th input files name.
+ std::string inputFile(int index) {
+ Node &node = *linkingContext()->getNodes()[index];
+ if (node.kind() == Node::Kind::File)
+ return cast<FileNode>(&node)->getFile()->path();
+ llvm_unreachable("not handling other types of input files");
+ }
+
+ // For unit tests to call driver with various command lines.
+ bool parse(const char *args, ...) {
+ // Construct command line options from varargs.
+ std::vector<const char *> vec;
+ vec.push_back(args);
+ va_list ap;
+ va_start(ap, args);
+ while (const char *arg = va_arg(ap, const char *))
+ vec.push_back(arg);
+ va_end(ap);
+
+ // Call the parser.
+ raw_string_ostream os(_errorMessage);
+ return D::parse(vec.size(), &vec[0], _ctx, os);
+ }
+
+ T _ctx;
+ std::string _errorMessage;
+};
+
+}
diff --git a/unittests/DriverTests/GnuLdDriverTest.cpp b/unittests/DriverTests/GnuLdDriverTest.cpp
new file mode 100644
index 000000000000..92eb920f0180
--- /dev/null
+++ b/unittests/DriverTests/GnuLdDriverTest.cpp
@@ -0,0 +1,284 @@
+//===- lld/unittest/GnuLdDriverTest.cpp -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief GNU ld driver tests.
+///
+//===----------------------------------------------------------------------===//
+
+#include "DriverTest.h"
+#include "lld/ReaderWriter/ELFLinkingContext.h"
+#include "llvm/Support/MemoryBuffer.h"
+
+using namespace llvm;
+using namespace lld;
+
+namespace {
+
+class GnuLdParserTest
+ : public ParserTest<GnuLdDriver, std::unique_ptr<ELFLinkingContext>> {
+protected:
+ const LinkingContext *linkingContext() override { return _ctx.get(); }
+};
+
+class LinkerScriptTest : public testing::Test {
+protected:
+ void SetUp() override {
+ llvm::Triple triple(llvm::sys::getDefaultTargetTriple());
+ _ctx = std::move(GnuLdDriver::createELFLinkingContext(triple));
+ }
+
+ void parse(StringRef script, bool nostdlib = false) {
+ std::unique_ptr<MemoryBuffer> mb = MemoryBuffer::getMemBuffer(
+ script, "foo.so");
+ std::string s;
+ raw_string_ostream out(s);
+ std::error_code ec =
+ GnuLdDriver::evalLinkerScript(*_ctx, std::move(mb), out, nostdlib);
+ EXPECT_FALSE(ec);
+ };
+
+ std::unique_ptr<ELFLinkingContext> _ctx;
+};
+
+} // anonymous namespace
+
+TEST_F(GnuLdParserTest, Empty) {
+ EXPECT_FALSE(parse("ld", nullptr));
+ EXPECT_EQ(linkingContext(), nullptr);
+ EXPECT_EQ("No input files\n", errorMessage());
+}
+
+// -o
+
+TEST_F(GnuLdParserTest, Output) {
+ EXPECT_TRUE(parse("ld", "a.o", "-o", "foo", nullptr));
+ EXPECT_EQ("foo", _ctx->outputPath());
+}
+
+TEST_F(GnuLdParserTest, OutputDefault) {
+ EXPECT_TRUE(parse("ld", "abc.o", nullptr));
+ EXPECT_EQ("a.out", _ctx->outputPath());
+}
+
+// --noinhibit-exec
+
+TEST_F(GnuLdParserTest, NoinhibitExec) {
+ EXPECT_TRUE(parse("ld", "a.o", "--noinhibit-exec", nullptr));
+ EXPECT_TRUE(_ctx->allowRemainingUndefines());
+}
+
+// --entry
+
+TEST_F(GnuLdParserTest, Entry) {
+ EXPECT_TRUE(parse("ld", "a.o", "--entry", "foo", nullptr));
+ EXPECT_EQ("foo", _ctx->entrySymbolName());
+}
+
+TEST_F(GnuLdParserTest, EntryShort) {
+ EXPECT_TRUE(parse("ld", "a.o", "-e", "foo", nullptr));
+ EXPECT_EQ("foo", _ctx->entrySymbolName());
+}
+
+TEST_F(GnuLdParserTest, EntryJoined) {
+ EXPECT_TRUE(parse("ld", "a.o", "--entry=foo", nullptr));
+ EXPECT_EQ("foo", _ctx->entrySymbolName());
+}
+
+// --export-dynamic
+
+TEST_F(GnuLdParserTest, ExportDynamic) {
+ EXPECT_TRUE(parse("ld", "a.o", "--export-dynamic", nullptr));
+ EXPECT_TRUE(_ctx->shouldExportDynamic());
+}
+
+TEST_F(GnuLdParserTest, NoExportDynamic) {
+ EXPECT_TRUE(parse("ld", "a.o", "--no-export-dynamic", nullptr));
+ EXPECT_FALSE(_ctx->shouldExportDynamic());
+}
+
+// --init
+
+TEST_F(GnuLdParserTest, Init) {
+ EXPECT_TRUE(parse("ld", "a.o", "-init", "foo", "-init", "bar", nullptr));
+ EXPECT_EQ("bar", _ctx->initFunction());
+}
+
+TEST_F(GnuLdParserTest, InitJoined) {
+ EXPECT_TRUE(parse("ld", "a.o", "-init=foo", nullptr));
+ EXPECT_EQ("foo", _ctx->initFunction());
+}
+
+// --soname
+
+TEST_F(GnuLdParserTest, SOName) {
+ EXPECT_TRUE(parse("ld", "a.o", "--soname=foo", nullptr));
+ EXPECT_EQ("foo", _ctx->sharedObjectName());
+}
+
+TEST_F(GnuLdParserTest, SONameSingleDash) {
+ EXPECT_TRUE(parse("ld", "a.o", "-soname=foo", nullptr));
+ EXPECT_EQ("foo", _ctx->sharedObjectName());
+}
+
+TEST_F(GnuLdParserTest, SONameH) {
+ EXPECT_TRUE(parse("ld", "a.o", "-h", "foo", nullptr));
+ EXPECT_EQ("foo", _ctx->sharedObjectName());
+}
+
+// -rpath
+
+TEST_F(GnuLdParserTest, Rpath) {
+ EXPECT_TRUE(parse("ld", "a.o", "-rpath", "foo:bar", nullptr));
+ EXPECT_EQ(2, _ctx->getRpathList().size());
+ EXPECT_EQ("foo", _ctx->getRpathList()[0]);
+ EXPECT_EQ("bar", _ctx->getRpathList()[1]);
+}
+
+TEST_F(GnuLdParserTest, RpathEq) {
+ EXPECT_TRUE(parse("ld", "a.o", "-rpath=foo", nullptr));
+ EXPECT_EQ(1, _ctx->getRpathList().size());
+ EXPECT_EQ("foo", _ctx->getRpathList()[0]);
+}
+
+// --defsym
+
+TEST_F(GnuLdParserTest, DefsymDecimal) {
+ EXPECT_TRUE(parse("ld", "a.o", "--defsym=sym=1000", nullptr));
+ assert(_ctx.get());
+ auto map = _ctx->getAbsoluteSymbols();
+ EXPECT_EQ((size_t)1, map.size());
+ EXPECT_EQ((uint64_t)1000, map["sym"]);
+}
+
+TEST_F(GnuLdParserTest, DefsymHexadecimal) {
+ EXPECT_TRUE(parse("ld", "a.o", "--defsym=sym=0x1000", nullptr));
+ auto map = _ctx->getAbsoluteSymbols();
+ EXPECT_EQ((size_t)1, map.size());
+ EXPECT_EQ((uint64_t)0x1000, map["sym"]);
+}
+
+TEST_F(GnuLdParserTest, DefsymAlias) {
+ EXPECT_TRUE(parse("ld", "a.o", "--defsym=sym=abc", nullptr));
+ auto map = _ctx->getAliases();
+ EXPECT_EQ((size_t)1, map.size());
+ EXPECT_EQ("abc", map["sym"]);
+}
+
+TEST_F(GnuLdParserTest, DefsymOctal) {
+ EXPECT_TRUE(parse("ld", "a.o", "--defsym=sym=0777", nullptr));
+ auto map = _ctx->getAbsoluteSymbols();
+ EXPECT_EQ((size_t)1, map.size());
+ EXPECT_EQ((uint64_t)0777, map["sym"]);
+}
+
+TEST_F(GnuLdParserTest, DefsymMisssingSymbol) {
+ EXPECT_FALSE(parse("ld", "a.o", "--defsym==0", nullptr));
+}
+
+TEST_F(GnuLdParserTest, DefsymMisssingValue) {
+ EXPECT_FALSE(parse("ld", "a.o", "--defsym=sym=", nullptr));
+}
+
+// --as-needed
+
+TEST_F(GnuLdParserTest, AsNeeded) {
+ EXPECT_TRUE(parse("ld", "a.o", "--as-needed", "b.o", "c.o",
+ "--no-as-needed", "d.o", nullptr));
+ std::vector<std::unique_ptr<Node>> &nodes = _ctx->getNodes();
+ EXPECT_EQ((size_t)4, nodes.size());
+ EXPECT_FALSE(cast<FileNode>(nodes[0].get())->asNeeded());
+ EXPECT_TRUE(cast<FileNode>(nodes[1].get())->asNeeded());
+ EXPECT_TRUE(cast<FileNode>(nodes[2].get())->asNeeded());
+ EXPECT_FALSE(cast<FileNode>(nodes[3].get())->asNeeded());
+}
+
+// Linker script
+
+TEST_F(LinkerScriptTest, Input) {
+ parse("INPUT(/x /y)");
+ std::vector<std::unique_ptr<Node>> &nodes = _ctx->getNodes();
+ EXPECT_EQ((size_t)2, nodes.size());
+ EXPECT_EQ("/x", cast<FileNode>(nodes[0].get())->getFile()->path());
+ EXPECT_EQ("/y", cast<FileNode>(nodes[1].get())->getFile()->path());
+}
+
+TEST_F(LinkerScriptTest, Group) {
+ parse("GROUP(/x /y)");
+ std::vector<std::unique_ptr<Node>> &nodes = _ctx->getNodes();
+ EXPECT_EQ((size_t)3, nodes.size());
+ EXPECT_EQ("/x", cast<FileNode>(nodes[0].get())->getFile()->path());
+ EXPECT_EQ("/y", cast<FileNode>(nodes[1].get())->getFile()->path());
+ EXPECT_EQ(2, cast<GroupEnd>(nodes[2].get())->getSize());
+}
+
+TEST_F(LinkerScriptTest, SearchDir) {
+ parse("SEARCH_DIR(\"/foo/bar\")");
+ std::vector<StringRef> paths = _ctx->getSearchPaths();
+ EXPECT_EQ((size_t)1, paths.size());
+ EXPECT_EQ("/foo/bar", paths[0]);
+}
+
+TEST_F(LinkerScriptTest, Entry) {
+ parse("ENTRY(blah)");
+ EXPECT_EQ("blah", _ctx->entrySymbolName());
+}
+
+TEST_F(LinkerScriptTest, Output) {
+ parse("OUTPUT(\"/path/to/output\")");
+ EXPECT_EQ("/path/to/output", _ctx->outputPath());
+}
+
+// Test that search paths are ignored when nostdlib is set.
+TEST_F(LinkerScriptTest, IgnoreSearchDirNoStdLib) {
+ parse("SEARCH_DIR(\"/foo/bar\")", true /*nostdlib*/);
+ std::vector<StringRef> paths = _ctx->getSearchPaths();
+ EXPECT_EQ((size_t)0, paths.size());
+}
+
+TEST_F(LinkerScriptTest, ExprEval) {
+ parse("SECTIONS { symbol = 0x4000 + 0x40; \n"
+ ". = (symbol >= 0x4040)? (0x5001 * 2 & 0xFFF0) << 1 : 0}");
+
+ EXPECT_EQ((size_t)1, _ctx->linkerScriptSema().getLinkerScripts().size());
+
+ script::LinkerScript *ls =
+ _ctx->linkerScriptSema().getLinkerScripts()[0]->get();
+ EXPECT_EQ((size_t)1, ls->_commands.size());
+
+ auto *secs = dyn_cast<const script::Sections>(*ls->_commands.begin());
+ EXPECT_TRUE(secs != nullptr);
+ EXPECT_EQ(2, secs->end() - secs->begin());
+
+ auto command = secs->begin();
+ auto *sa1 = dyn_cast<const script::SymbolAssignment>(*command);
+ EXPECT_TRUE(sa1 != nullptr);
+ EXPECT_EQ(script::SymbolAssignment::Simple, sa1->assignmentKind());
+ EXPECT_EQ(script::SymbolAssignment::Default, sa1->assignmentVisibility());
+
+ ++command;
+ auto *sa2 = dyn_cast<const script::SymbolAssignment>(*command);
+ EXPECT_TRUE(sa2 != nullptr);
+ EXPECT_EQ(script::SymbolAssignment::Simple, sa2->assignmentKind());
+ EXPECT_EQ(script::SymbolAssignment::Default, sa2->assignmentVisibility());
+
+ script::Expression::SymbolTableTy mySymbolTable;
+ auto ans = sa1->expr()->evalExpr(mySymbolTable);
+ EXPECT_FALSE(ans.getError());
+ int64_t result = *ans;
+ EXPECT_EQ(0x4040, result);
+ mySymbolTable[sa1->symbol()] = result;
+
+ auto ans2 = sa2->expr()->evalExpr(mySymbolTable);
+ EXPECT_FALSE(ans2.getError());
+ result = *ans2;
+ EXPECT_EQ(0x14000, result);
+ EXPECT_EQ(0, sa2->symbol().compare(StringRef(".")));
+}
+
diff --git a/unittests/DriverTests/Makefile b/unittests/DriverTests/Makefile
new file mode 100644
index 000000000000..ae97fb01adbf
--- /dev/null
+++ b/unittests/DriverTests/Makefile
@@ -0,0 +1,20 @@
+##===---- unittests/DriverTests/Makefile ----------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===-------------------------------------------------------------------===##
+
+LLD_LEVEL = ../..
+TESTNAME = DriverTests
+USEDLIBS = lldDriver.a lldConfig.a \
+ lldELF.a lldMachO.a lldPECOFF.a \
+ lldCore.a lldNative.a lldReaderWriter.a \
+ lldHexagonELFTarget.a lldMipsELFTarget.a \
+ lldX86ELFTarget.a lldExampleSubTarget.a lldX86_64ELFTarget.a \
+ lldYAML.a lldAArch64ELFTarget.a lldARMELFTarget.a \
+ LLVMObject.a LLVMMCParser.a LLVMMC.a LLVMBitReader.a \
+ LLVMCore.a LLVMOption.a LLVMSupport.a
+include $(LLD_LEVEL)/unittests/Makefile
diff --git a/unittests/DriverTests/UniversalDriverTest.cpp b/unittests/DriverTests/UniversalDriverTest.cpp
new file mode 100644
index 000000000000..8e90ca4d5867
--- /dev/null
+++ b/unittests/DriverTests/UniversalDriverTest.cpp
@@ -0,0 +1,33 @@
+//===- lld/unittest/UniversalDriverTest.cpp -------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief Universal driver tests that depend on the value of argv[0].
+///
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "lld/Driver/Driver.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm;
+using namespace lld;
+
+TEST(UniversalDriver, flavor) {
+ const char *args[] = { "gnu-ld" };
+
+ std::string diags;
+ raw_string_ostream os(diags);
+ UniversalDriver::link(array_lengthof(args), args, os);
+ EXPECT_EQ(os.str().find("failed to determine driver flavor"),
+ std::string::npos);
+ EXPECT_NE(os.str().find("No input files"),
+ std::string::npos);
+}
diff --git a/unittests/DriverTests/WinLinkDriverTest.cpp b/unittests/DriverTests/WinLinkDriverTest.cpp
new file mode 100644
index 000000000000..c2bc455aa81f
--- /dev/null
+++ b/unittests/DriverTests/WinLinkDriverTest.cpp
@@ -0,0 +1,728 @@
+//===- lld/unittest/WinLinkDriverTest.cpp ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief Windows link.exe driver tests.
+///
+//===----------------------------------------------------------------------===//
+
+#include "DriverTest.h"
+#include "lld/ReaderWriter/PECOFFLinkingContext.h"
+#include "llvm/ADT/Optional.h"
+#include "llvm/Support/COFF.h"
+#include <set>
+#include <vector>
+
+using namespace llvm;
+using namespace lld;
+
+namespace {
+class WinLinkParserTest
+ : public ParserTest<WinLinkDriver, PECOFFLinkingContext> {
+protected:
+ const LinkingContext *linkingContext() override { return &_ctx; }
+};
+}
+
+TEST_F(WinLinkParserTest, Basic) {
+ EXPECT_TRUE(parse("link.exe", "/subsystem:console", "/out:a.exe",
+ "-entry:start", "a.obj", "b.obj", "c.obj", nullptr));
+ EXPECT_EQ(llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_CUI, _ctx.getSubsystem());
+ EXPECT_EQ(llvm::COFF::IMAGE_FILE_MACHINE_I386, _ctx.getMachineType());
+ EXPECT_EQ("a.exe", _ctx.outputPath());
+ EXPECT_EQ("start", _ctx.getEntrySymbolName());
+ EXPECT_EQ(4, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+ EXPECT_EQ("b.obj", inputFile(1));
+ EXPECT_EQ("c.obj", inputFile(2));
+ EXPECT_TRUE(_ctx.getInputSearchPaths().empty());
+
+ // Unspecified flags will have default values.
+ EXPECT_FALSE(_ctx.isDll());
+ EXPECT_EQ(6, _ctx.getMinOSVersion().majorVersion);
+ EXPECT_EQ(0, _ctx.getMinOSVersion().minorVersion);
+ EXPECT_EQ(0x400000U, _ctx.getBaseAddress());
+ EXPECT_EQ(1024 * 1024U, _ctx.getStackReserve());
+ EXPECT_EQ(4096U, _ctx.getStackCommit());
+ EXPECT_EQ(4096U, _ctx.getSectionDefaultAlignment());
+ EXPECT_FALSE(_ctx.allowRemainingUndefines());
+ EXPECT_TRUE(_ctx.isNxCompat());
+ EXPECT_FALSE(_ctx.getLargeAddressAware());
+ EXPECT_TRUE(_ctx.getAllowBind());
+ EXPECT_TRUE(_ctx.getAllowIsolation());
+ EXPECT_FALSE(_ctx.getSwapRunFromCD());
+ EXPECT_FALSE(_ctx.getSwapRunFromNet());
+ EXPECT_TRUE(_ctx.getBaseRelocationEnabled());
+ EXPECT_TRUE(_ctx.isTerminalServerAware());
+ EXPECT_TRUE(_ctx.getDynamicBaseEnabled());
+ EXPECT_TRUE(_ctx.getCreateManifest());
+ EXPECT_EQ("", _ctx.getManifestDependency());
+ EXPECT_FALSE(_ctx.getEmbedManifest());
+ EXPECT_EQ(1, _ctx.getManifestId());
+ EXPECT_TRUE(_ctx.getManifestUAC());
+ EXPECT_EQ("'asInvoker'", _ctx.getManifestLevel());
+ EXPECT_EQ("'false'", _ctx.getManifestUiAccess());
+ EXPECT_TRUE(_ctx.deadStrip());
+ EXPECT_FALSE(_ctx.logInputFiles());
+}
+
+TEST_F(WinLinkParserTest, StartsWithHyphen) {
+ EXPECT_TRUE(
+ parse("link.exe", "-subsystem:console", "-out:a.exe", "a.obj", nullptr));
+ EXPECT_EQ(llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_CUI, _ctx.getSubsystem());
+ EXPECT_EQ("a.exe", _ctx.outputPath());
+ EXPECT_EQ(2, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+}
+
+TEST_F(WinLinkParserTest, UppercaseOption) {
+ EXPECT_TRUE(
+ parse("link.exe", "/SUBSYSTEM:CONSOLE", "/OUT:a.exe", "a.obj", nullptr));
+ EXPECT_EQ(llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_CUI, _ctx.getSubsystem());
+ EXPECT_EQ("a.exe", _ctx.outputPath());
+ EXPECT_EQ(2, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+}
+
+TEST_F(WinLinkParserTest, Mllvm) {
+ EXPECT_TRUE(parse("link.exe", "/mllvm:-debug", "a.obj", nullptr));
+ const std::vector<const char *> &options = _ctx.llvmOptions();
+ EXPECT_EQ(1U, options.size());
+ EXPECT_STREQ("-debug", options[0]);
+}
+
+TEST_F(WinLinkParserTest, NoInputFiles) {
+ EXPECT_FALSE(parse("link.exe", nullptr));
+ EXPECT_EQ("No input files\n", errorMessage());
+}
+
+//
+// Tests for implicit file extension interpolation.
+//
+
+TEST_F(WinLinkParserTest, NoFileExtension) {
+ EXPECT_TRUE(parse("link.exe", "foo", "bar", nullptr));
+ EXPECT_EQ("foo.exe", _ctx.outputPath());
+ EXPECT_EQ(3, inputFileCount());
+ EXPECT_EQ("foo.obj", inputFile(0));
+ EXPECT_EQ("bar.obj", inputFile(1));
+}
+
+TEST_F(WinLinkParserTest, NonStandardFileExtension) {
+ EXPECT_TRUE(parse("link.exe", "foo.o", nullptr));
+ EXPECT_EQ("foo.exe", _ctx.outputPath());
+ EXPECT_EQ(2, inputFileCount());
+ EXPECT_EQ("foo.o", inputFile(0));
+}
+
+TEST_F(WinLinkParserTest, Libpath) {
+ EXPECT_TRUE(
+ parse("link.exe", "/libpath:dir1", "/libpath:dir2", "a.obj", nullptr));
+ const std::vector<StringRef> &paths = _ctx.getInputSearchPaths();
+ EXPECT_EQ(2U, paths.size());
+ EXPECT_EQ("dir1", paths[0]);
+ EXPECT_EQ("dir2", paths[1]);
+}
+
+//
+// Tests for input file order
+//
+
+TEST_F(WinLinkParserTest, InputOrder) {
+ EXPECT_TRUE(parse("link.exe", "a.lib", "b.obj", "c.obj", "a.lib", "d.obj",
+ nullptr));
+ EXPECT_EQ(5, inputFileCount());
+ EXPECT_EQ("b.obj", inputFile(0));
+ EXPECT_EQ("c.obj", inputFile(1));
+ EXPECT_EQ("d.obj", inputFile(2));
+ EXPECT_EQ("a.lib", inputFile(3));
+}
+
+//
+// Tests for command line options that take values.
+//
+
+TEST_F(WinLinkParserTest, AlternateName) {
+ EXPECT_TRUE(parse("link.exe", "/alternatename:sym1=sym",
+ "/alternatename:sym2=sym", "a.out", nullptr));
+ const std::set<std::string> &aliases = _ctx.getAlternateNames("sym");
+ EXPECT_EQ(2U, aliases.size());
+ auto it = aliases.begin();
+ EXPECT_EQ("sym1", *it++);
+ EXPECT_EQ("sym2", *it++);
+}
+
+TEST_F(WinLinkParserTest, Export) {
+ EXPECT_TRUE(parse("link.exe", "/export:foo", "a.out", nullptr));
+ const std::vector<PECOFFLinkingContext::ExportDesc> &exports =
+ _ctx.getDllExports();
+ EXPECT_EQ(1U, exports.size());
+ EXPECT_EQ("_foo", exports[0].name);
+ EXPECT_EQ(-1, exports[0].ordinal);
+ EXPECT_FALSE(exports[0].noname);
+ EXPECT_FALSE(exports[0].isData);
+}
+
+TEST_F(WinLinkParserTest, ExportWithOptions) {
+ EXPECT_TRUE(parse("link.exe", "/export:foo,@8,noname,data",
+ "/export:bar,@10,data", "a.out", nullptr));
+ const std::vector<PECOFFLinkingContext::ExportDesc> &exports =
+ _ctx.getDllExports();
+ EXPECT_EQ(2U, exports.size());
+ EXPECT_EQ("_foo", exports[0].name);
+ EXPECT_EQ(8, exports[0].ordinal);
+ EXPECT_TRUE(exports[0].noname);
+ EXPECT_TRUE(exports[0].isData);
+ EXPECT_EQ("_bar", exports[1].name);
+ EXPECT_EQ(10, exports[1].ordinal);
+ EXPECT_FALSE(exports[1].noname);
+ EXPECT_TRUE(exports[1].isData);
+}
+
+TEST_F(WinLinkParserTest, ExportDuplicateExports) {
+ EXPECT_TRUE(
+ parse("link.exe", "/export:foo", "/export:foo,@2", "a.out", nullptr));
+ const std::vector<PECOFFLinkingContext::ExportDesc> &exports =
+ _ctx.getDllExports();
+ EXPECT_EQ(1U, exports.size());
+ EXPECT_EQ("_foo", exports[0].name);
+ EXPECT_EQ(-1, exports[0].ordinal);
+}
+
+TEST_F(WinLinkParserTest, ExportDuplicateOrdinals) {
+ EXPECT_FALSE(
+ parse("link.exe", "/export:foo,@1", "/export:bar,@1", "a.out", nullptr));
+}
+
+TEST_F(WinLinkParserTest, ExportInvalid1) {
+ EXPECT_FALSE(parse("link.exe", "/export:foo,@0", "a.out", nullptr));
+}
+
+TEST_F(WinLinkParserTest, ExportInvalid2) {
+ EXPECT_FALSE(parse("link.exe", "/export:foo,@65536", "a.out", nullptr));
+}
+
+TEST_F(WinLinkParserTest, MachineX86) {
+ EXPECT_TRUE(parse("link.exe", "/machine:x86", "a.obj", nullptr));
+ EXPECT_EQ(llvm::COFF::IMAGE_FILE_MACHINE_I386, _ctx.getMachineType());
+}
+
+TEST_F(WinLinkParserTest, MachineX64) {
+ EXPECT_TRUE(parse("link.exe", "/machine:x64", "a.obj", nullptr));
+ EXPECT_EQ(llvm::COFF::IMAGE_FILE_MACHINE_AMD64, _ctx.getMachineType());
+}
+
+TEST_F(WinLinkParserTest, MachineArm) {
+ EXPECT_TRUE(parse("link.exe", "/machine:arm", "a.obj", nullptr));
+ EXPECT_EQ(llvm::COFF::IMAGE_FILE_MACHINE_ARMNT, _ctx.getMachineType());
+}
+
+TEST_F(WinLinkParserTest, MachineUnknown) {
+ EXPECT_FALSE(parse("link.exe", "/machine:nosucharch", "a.obj", nullptr));
+ EXPECT_EQ("error: unknown machine type: nosucharch\n", errorMessage());
+}
+
+TEST_F(WinLinkParserTest, MajorImageVersion) {
+ EXPECT_TRUE(parse("link.exe", "/version:7", "foo.o", nullptr));
+ EXPECT_EQ(7, _ctx.getImageVersion().majorVersion);
+ EXPECT_EQ(0, _ctx.getImageVersion().minorVersion);
+}
+
+TEST_F(WinLinkParserTest, MajorMinorImageVersion) {
+ EXPECT_TRUE(parse("link.exe", "/version:72.35", "foo.o", nullptr));
+ EXPECT_EQ(72, _ctx.getImageVersion().majorVersion);
+ EXPECT_EQ(35, _ctx.getImageVersion().minorVersion);
+}
+
+TEST_F(WinLinkParserTest, MinMajorOSVersion) {
+ EXPECT_TRUE(parse("link.exe", "/subsystem:windows,3", "foo.o", nullptr));
+ EXPECT_EQ(llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_GUI, _ctx.getSubsystem());
+ EXPECT_EQ(3, _ctx.getMinOSVersion().majorVersion);
+ EXPECT_EQ(0, _ctx.getMinOSVersion().minorVersion);
+}
+
+TEST_F(WinLinkParserTest, MinMajorMinorOSVersion) {
+ EXPECT_TRUE(parse("link.exe", "/subsystem:windows,3.1", "foo.o", nullptr));
+ EXPECT_EQ(llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_GUI, _ctx.getSubsystem());
+ EXPECT_EQ(3, _ctx.getMinOSVersion().majorVersion);
+ EXPECT_EQ(1, _ctx.getMinOSVersion().minorVersion);
+}
+
+TEST_F(WinLinkParserTest, Base) {
+ EXPECT_TRUE(parse("link.exe", "/base:8388608", "a.obj", nullptr));
+ EXPECT_EQ(0x800000U, _ctx.getBaseAddress());
+}
+
+TEST_F(WinLinkParserTest, InvalidBase) {
+ EXPECT_FALSE(parse("link.exe", "/base:1234", "a.obj", nullptr));
+ EXPECT_TRUE(StringRef(errorMessage())
+ .startswith("Base address have to be multiple of 64K"));
+}
+
+TEST_F(WinLinkParserTest, StackReserve) {
+ EXPECT_TRUE(parse("link.exe", "/stack:8192", "a.obj", nullptr));
+ EXPECT_EQ(8192U, _ctx.getStackReserve());
+ EXPECT_EQ(4096U, _ctx.getStackCommit());
+}
+
+TEST_F(WinLinkParserTest, StackReserveAndCommit) {
+ EXPECT_TRUE(parse("link.exe", "/stack:16384,8192", "a.obj", nullptr));
+ EXPECT_EQ(16384U, _ctx.getStackReserve());
+ EXPECT_EQ(8192U, _ctx.getStackCommit());
+}
+
+TEST_F(WinLinkParserTest, InvalidStackSize) {
+ EXPECT_FALSE(parse("link.exe", "/stack:8192,16384", "a.obj", nullptr));
+ EXPECT_TRUE(StringRef(errorMessage()).startswith("Invalid stack size"));
+}
+
+TEST_F(WinLinkParserTest, HeapReserve) {
+ EXPECT_TRUE(parse("link.exe", "/heap:8192", "a.obj", nullptr));
+ EXPECT_EQ(8192U, _ctx.getHeapReserve());
+ EXPECT_EQ(4096U, _ctx.getHeapCommit());
+}
+
+TEST_F(WinLinkParserTest, HeapReserveAndCommit) {
+ EXPECT_TRUE(parse("link.exe", "/heap:16384,8192", "a.obj", nullptr));
+ EXPECT_EQ(16384U, _ctx.getHeapReserve());
+ EXPECT_EQ(8192U, _ctx.getHeapCommit());
+}
+
+TEST_F(WinLinkParserTest, InvalidHeapSize) {
+ EXPECT_FALSE(parse("link.exe", "/heap:8192,16384", "a.obj", nullptr));
+ EXPECT_TRUE(StringRef(errorMessage()).startswith("Invalid heap size"));
+}
+
+TEST_F(WinLinkParserTest, SectionAlignment) {
+ EXPECT_TRUE(parse("link.exe", "/align:8192", "a.obj", nullptr));
+ EXPECT_EQ(8192U, _ctx.getSectionDefaultAlignment());
+}
+
+TEST_F(WinLinkParserTest, InvalidAlignment) {
+ EXPECT_FALSE(parse("link.exe", "/align:1000", "a.obj", nullptr));
+ EXPECT_EQ("Section alignment must be a power of 2, but got 1000\n",
+ errorMessage());
+}
+
+TEST_F(WinLinkParserTest, Include) {
+ EXPECT_TRUE(parse("link.exe", "/include:foo", "a.out", nullptr));
+ auto symbols = _ctx.initialUndefinedSymbols();
+ EXPECT_FALSE(symbols.empty());
+ EXPECT_EQ("foo", symbols[0]);
+}
+
+TEST_F(WinLinkParserTest, Merge) {
+ EXPECT_TRUE(parse("link.exe", "/merge:.foo=.bar", "/merge:.bar=.baz",
+ "a.out", nullptr));
+ EXPECT_EQ(".baz", _ctx.getOutputSectionName(".foo"));
+ EXPECT_EQ(".baz", _ctx.getOutputSectionName(".bar"));
+ EXPECT_EQ(".abc", _ctx.getOutputSectionName(".abc"));
+}
+
+TEST_F(WinLinkParserTest, Merge_Circular) {
+ EXPECT_FALSE(parse("link.exe", "/merge:.foo=.bar", "/merge:.bar=.foo",
+ "a.out", nullptr));
+}
+
+TEST_F(WinLinkParserTest, Implib) {
+ EXPECT_TRUE(parse("link.exe", "/implib:foo.dll.lib", "a.out", nullptr));
+ EXPECT_EQ("foo.dll.lib", _ctx.getOutputImportLibraryPath());
+}
+
+TEST_F(WinLinkParserTest, ImplibDefault) {
+ EXPECT_TRUE(parse("link.exe", "/out:foobar.dll", "a.out", nullptr));
+ EXPECT_EQ("foobar.lib", _ctx.getOutputImportLibraryPath());
+}
+
+//
+// Tests for /section
+//
+
+namespace {
+const uint32_t discardable = llvm::COFF::IMAGE_SCN_MEM_DISCARDABLE;
+const uint32_t not_cached = llvm::COFF::IMAGE_SCN_MEM_NOT_CACHED;
+const uint32_t not_paged = llvm::COFF::IMAGE_SCN_MEM_NOT_PAGED;
+const uint32_t shared = llvm::COFF::IMAGE_SCN_MEM_SHARED;
+const uint32_t execute = llvm::COFF::IMAGE_SCN_MEM_EXECUTE;
+const uint32_t read = llvm::COFF::IMAGE_SCN_MEM_READ;
+const uint32_t write = llvm::COFF::IMAGE_SCN_MEM_WRITE;
+
+#define TEST_SECTION(testname, arg, expect) \
+ TEST_F(WinLinkParserTest, testname) { \
+ EXPECT_TRUE(parse("link.exe", "/section:.text," arg, "a.obj", nullptr)); \
+ EXPECT_EQ(expect, _ctx.getSectionAttributes(".text", execute | read)); \
+ }
+
+TEST_SECTION(SectionD, "d", execute | read | discardable)
+TEST_SECTION(SectionE, "e", execute)
+TEST_SECTION(SectionK, "k", execute | read | not_cached)
+TEST_SECTION(SectionP, "p", execute | read | not_paged)
+TEST_SECTION(SectionR, "r", read)
+TEST_SECTION(SectionS, "s", execute | read | shared)
+TEST_SECTION(SectionW, "w", write)
+
+#undef TEST_SECTION
+
+TEST_F(WinLinkParserTest, Section) {
+ EXPECT_TRUE(parse("link.exe", "/section:.text,dekprsw",
+ "/section:.text,!dekprsw", "a.obj", nullptr));
+ EXPECT_EQ(0U, _ctx.getSectionAttributes(".text", execute | read));
+}
+
+TEST_F(WinLinkParserTest, SectionNegate) {
+ EXPECT_TRUE(parse("link.exe", "/section:.text,!e", "a.obj", nullptr));
+ EXPECT_EQ(read, _ctx.getSectionAttributes(".text", execute | read));
+}
+
+TEST_F(WinLinkParserTest, SectionMultiple) {
+ EXPECT_TRUE(parse("link.exe", "/section:.foo,e", "/section:.foo,rw",
+ "/section:.foo,!d", "a.obj", nullptr));
+ uint32_t flags = execute | read | not_paged | discardable;
+ uint32_t expected = execute | read | write | not_paged;
+ EXPECT_EQ(expected, _ctx.getSectionAttributes(".foo", flags));
+}
+
+} // end anonymous namespace
+
+//
+// Tests for /defaultlib and /nodefaultlib.
+//
+
+TEST_F(WinLinkParserTest, DefaultLib) {
+ EXPECT_TRUE(parse("link.exe", "/defaultlib:user32.lib",
+ "/defaultlib:kernel32", "a.obj", nullptr));
+ EXPECT_EQ(4, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+ EXPECT_EQ("user32.lib", inputFile(1));
+ EXPECT_EQ("kernel32.lib", inputFile(2));
+}
+
+TEST_F(WinLinkParserTest, DefaultLibDuplicates) {
+ EXPECT_TRUE(parse("link.exe", "/defaultlib:user32.lib",
+ "/defaultlib:user32.lib", "a.obj", nullptr));
+ EXPECT_EQ(3, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+ EXPECT_EQ("user32.lib", inputFile(1));
+}
+
+TEST_F(WinLinkParserTest, NoDefaultLib) {
+ EXPECT_TRUE(parse("link.exe", "/defaultlib:user32.lib",
+ "/defaultlib:kernel32", "/nodefaultlib:user32.lib", "a.obj",
+ nullptr));
+ EXPECT_EQ(3, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+ EXPECT_EQ("kernel32.lib", inputFile(1));
+}
+
+TEST_F(WinLinkParserTest, NoDefaultLibCase) {
+ EXPECT_TRUE(parse("link.exe", "/defaultlib:user32",
+ "/defaultlib:kernel32", "/nodefaultlib:USER32.LIB", "a.obj",
+ nullptr));
+ EXPECT_EQ(3, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+ EXPECT_EQ("kernel32.lib", inputFile(1));
+}
+
+TEST_F(WinLinkParserTest, NoDefaultLibAll) {
+ EXPECT_TRUE(parse("link.exe", "/defaultlib:user32.lib",
+ "/defaultlib:kernel32", "/nodefaultlib", "a.obj", nullptr));
+ EXPECT_EQ(2, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+}
+
+TEST_F(WinLinkParserTest, DisallowLib) {
+ EXPECT_TRUE(parse("link.exe", "/defaultlib:user32.lib",
+ "/defaultlib:kernel32", "/disallowlib:user32.lib", "a.obj",
+ nullptr));
+ EXPECT_EQ(3, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+ EXPECT_EQ("kernel32.lib", inputFile(1));
+}
+
+//
+// Tests for DLL.
+//
+
+TEST_F(WinLinkParserTest, NoEntry) {
+ EXPECT_TRUE(parse("link.exe", "/noentry", "/dll", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.isDll());
+ EXPECT_EQ(0x10000000U, _ctx.getBaseAddress());
+ EXPECT_EQ("", _ctx.entrySymbolName());
+}
+
+TEST_F(WinLinkParserTest, NoEntryError) {
+ // /noentry without /dll is an error.
+ EXPECT_FALSE(parse("link.exe", "/noentry", "a.obj", nullptr));
+ EXPECT_EQ("/noentry must be specified with /dll\n", errorMessage());
+}
+
+//
+// Tests for DELAYLOAD.
+//
+
+TEST_F(WinLinkParserTest, DelayLoad) {
+ EXPECT_TRUE(parse("link.exe", "/delayload:abc.dll", "/delayload:def.dll",
+ "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.isDelayLoadDLL("abc.dll"));
+ EXPECT_TRUE(_ctx.isDelayLoadDLL("DEF.DLL"));
+ EXPECT_FALSE(_ctx.isDelayLoadDLL("xyz.dll"));
+}
+
+//
+// Tests for SEH.
+//
+
+TEST_F(WinLinkParserTest, SafeSEH) {
+ EXPECT_TRUE(parse("link.exe", "/safeseh", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.requireSEH());
+ EXPECT_FALSE(_ctx.noSEH());
+}
+
+TEST_F(WinLinkParserTest, NoSafeSEH) {
+ EXPECT_TRUE(parse("link.exe", "/safeseh:no", "a.obj", nullptr));
+ EXPECT_FALSE(_ctx.requireSEH());
+ EXPECT_TRUE(_ctx.noSEH());
+}
+
+//
+// Tests for boolean flags.
+//
+
+TEST_F(WinLinkParserTest, Force) {
+ EXPECT_TRUE(parse("link.exe", "/force", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.allowRemainingUndefines());
+}
+
+TEST_F(WinLinkParserTest, ForceUnresolved) {
+ EXPECT_TRUE(parse("link.exe", "/force:unresolved", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.allowRemainingUndefines());
+}
+
+TEST_F(WinLinkParserTest, NoNxCompat) {
+ EXPECT_TRUE(parse("link.exe", "/nxcompat:no", "a.obj", nullptr));
+ EXPECT_FALSE(_ctx.isNxCompat());
+}
+
+TEST_F(WinLinkParserTest, LargeAddressAware) {
+ EXPECT_TRUE(parse("link.exe", "/largeaddressaware", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.getLargeAddressAware());
+}
+
+TEST_F(WinLinkParserTest, NoLargeAddressAware) {
+ EXPECT_TRUE(parse("link.exe", "/largeaddressaware:no", "a.obj", nullptr));
+ EXPECT_FALSE(_ctx.getLargeAddressAware());
+}
+
+TEST_F(WinLinkParserTest, AllowBind) {
+ EXPECT_TRUE(parse("link.exe", "/allowbind", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.getAllowBind());
+}
+
+TEST_F(WinLinkParserTest, NoAllowBind) {
+ EXPECT_TRUE(parse("link.exe", "/allowbind:no", "a.obj", nullptr));
+ EXPECT_FALSE(_ctx.getAllowBind());
+}
+
+TEST_F(WinLinkParserTest, AllowIsolation) {
+ EXPECT_TRUE(parse("link.exe", "/allowisolation", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.getAllowIsolation());
+}
+
+TEST_F(WinLinkParserTest, NoAllowIsolation) {
+ EXPECT_TRUE(parse("link.exe", "/allowisolation:no", "a.obj", nullptr));
+ EXPECT_FALSE(_ctx.getAllowIsolation());
+}
+
+TEST_F(WinLinkParserTest, SwapRunFromCD) {
+ EXPECT_TRUE(parse("link.exe", "/swaprun:cd", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.getSwapRunFromCD());
+}
+
+TEST_F(WinLinkParserTest, SwapRunFromNet) {
+ EXPECT_TRUE(parse("link.exe", "/swaprun:net", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.getSwapRunFromNet());
+}
+
+TEST_F(WinLinkParserTest, Debug) {
+ EXPECT_TRUE(parse("link.exe", "/debug", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.deadStrip());
+ EXPECT_TRUE(_ctx.getDebug());
+ EXPECT_EQ("a.pdb", _ctx.getPDBFilePath());
+}
+
+TEST_F(WinLinkParserTest, PDB) {
+ EXPECT_TRUE(parse("link.exe", "/debug", "/pdb:foo.pdb", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.getDebug());
+ EXPECT_EQ("foo.pdb", _ctx.getPDBFilePath());
+}
+
+TEST_F(WinLinkParserTest, Fixed) {
+ EXPECT_TRUE(parse("link.exe", "/fixed", "a.out", nullptr));
+ EXPECT_FALSE(_ctx.getBaseRelocationEnabled());
+ EXPECT_FALSE(_ctx.getDynamicBaseEnabled());
+}
+
+TEST_F(WinLinkParserTest, NoFixed) {
+ EXPECT_TRUE(parse("link.exe", "/fixed:no", "a.out", nullptr));
+ EXPECT_TRUE(_ctx.getBaseRelocationEnabled());
+}
+
+TEST_F(WinLinkParserTest, TerminalServerAware) {
+ EXPECT_TRUE(parse("link.exe", "/tsaware", "a.out", nullptr));
+ EXPECT_TRUE(_ctx.isTerminalServerAware());
+}
+
+TEST_F(WinLinkParserTest, NoTerminalServerAware) {
+ EXPECT_TRUE(parse("link.exe", "/tsaware:no", "a.out", nullptr));
+ EXPECT_FALSE(_ctx.isTerminalServerAware());
+}
+
+TEST_F(WinLinkParserTest, DynamicBase) {
+ EXPECT_TRUE(parse("link.exe", "/dynamicbase", "a.out", nullptr));
+ EXPECT_TRUE(_ctx.getDynamicBaseEnabled());
+}
+
+TEST_F(WinLinkParserTest, NoDynamicBase) {
+ EXPECT_TRUE(parse("link.exe", "/dynamicbase:no", "a.out", nullptr));
+ EXPECT_FALSE(_ctx.getDynamicBaseEnabled());
+}
+
+//
+// Test for /failifmismatch
+//
+
+TEST_F(WinLinkParserTest, FailIfMismatch_Match) {
+ EXPECT_TRUE(parse("link.exe", "/failifmismatch:foo=bar",
+ "/failifmismatch:foo=bar", "/failifmismatch:abc=def",
+ "a.out", nullptr));
+}
+
+TEST_F(WinLinkParserTest, FailIfMismatch_Mismatch) {
+ EXPECT_FALSE(parse("link.exe", "/failifmismatch:foo=bar",
+ "/failifmismatch:foo=baz", "a.out", nullptr));
+}
+
+//
+// Tests for /manifest, /manifestuac, /manifestfile, and /manifestdependency.
+//
+TEST_F(WinLinkParserTest, Manifest_Default) {
+ EXPECT_TRUE(parse("link.exe", "/manifest", "a.out", nullptr));
+ EXPECT_TRUE(_ctx.getCreateManifest());
+ EXPECT_FALSE(_ctx.getEmbedManifest());
+ EXPECT_EQ(1, _ctx.getManifestId());
+ EXPECT_EQ("'asInvoker'", _ctx.getManifestLevel());
+ EXPECT_EQ("'false'", _ctx.getManifestUiAccess());
+}
+
+TEST_F(WinLinkParserTest, Manifest_No) {
+ EXPECT_TRUE(parse("link.exe", "/manifest:no", "a.out", nullptr));
+ EXPECT_FALSE(_ctx.getCreateManifest());
+}
+
+TEST_F(WinLinkParserTest, Manifestuac_no) {
+ EXPECT_TRUE(parse("link.exe", "/manifestuac:NO", "a.out", nullptr));
+ EXPECT_FALSE(_ctx.getManifestUAC());
+}
+
+TEST_F(WinLinkParserTest, Manifestuac_Level) {
+ EXPECT_TRUE(parse("link.exe", "/manifestuac:level='requireAdministrator'",
+ "a.out", nullptr));
+ EXPECT_EQ("'requireAdministrator'", _ctx.getManifestLevel());
+ EXPECT_EQ("'false'", _ctx.getManifestUiAccess());
+}
+
+TEST_F(WinLinkParserTest, Manifestuac_UiAccess) {
+ EXPECT_TRUE(parse("link.exe", "/manifestuac:uiAccess='true'", "a.out", nullptr));
+ EXPECT_EQ("'asInvoker'", _ctx.getManifestLevel());
+ EXPECT_EQ("'true'", _ctx.getManifestUiAccess());
+}
+
+TEST_F(WinLinkParserTest, Manifestuac_LevelAndUiAccess) {
+ EXPECT_TRUE(parse("link.exe",
+ "/manifestuac:level='requireAdministrator' uiAccess='true'",
+ "a.out", nullptr));
+ EXPECT_EQ("'requireAdministrator'", _ctx.getManifestLevel());
+ EXPECT_EQ("'true'", _ctx.getManifestUiAccess());
+}
+
+TEST_F(WinLinkParserTest, Manifestfile) {
+ EXPECT_TRUE(parse("link.exe", "/manifestfile:bar.manifest",
+ "a.out", nullptr));
+ EXPECT_EQ("bar.manifest", _ctx.getManifestOutputPath());
+}
+
+TEST_F(WinLinkParserTest, Manifestdependency) {
+ EXPECT_TRUE(parse("link.exe", "/manifestdependency:foo bar", "a.out",
+ nullptr));
+ EXPECT_EQ("foo bar", _ctx.getManifestDependency());
+}
+
+//
+// Test for /OPT
+//
+
+TEST_F(WinLinkParserTest, OptNoRef) {
+ EXPECT_TRUE(parse("link.exe", "/opt:noref", "a.obj", nullptr));
+ EXPECT_FALSE(_ctx.deadStrip());
+}
+
+TEST_F(WinLinkParserTest, OptIgnore) {
+ EXPECT_TRUE(parse("link.exe", "/opt:ref", "/opt:icf", "/opt:noicf",
+ "/opt:icf=foo", "/opt:lbr", "/opt:nolbr", "a.obj",
+ nullptr));
+}
+
+TEST_F(WinLinkParserTest, OptUnknown) {
+ EXPECT_FALSE(parse("link.exe", "/opt:foo", "a.obj", nullptr));
+}
+
+//
+// Test for /PROFILE
+//
+
+TEST_F(WinLinkParserTest, Profile) {
+ EXPECT_TRUE(parse("link.exe", "/profile", "a.obj", nullptr));
+ EXPECT_TRUE(_ctx.deadStrip());
+ EXPECT_TRUE(_ctx.getBaseRelocationEnabled());
+ EXPECT_TRUE(_ctx.getDynamicBaseEnabled());
+}
+
+//
+// Test for command line flags that are ignored.
+//
+
+TEST_F(WinLinkParserTest, Ignore) {
+ // There are some no-op command line options that are recognized for
+ // compatibility with link.exe.
+ EXPECT_TRUE(parse("link.exe", "/nologo", "/errorreport:prompt",
+ "/incremental", "/incremental:no", "/delay:unload",
+ "/disallowlib:foo", "/pdbaltpath:bar",
+ "/wx", "/wx:no", "/tlbid:1", "/tlbout:foo", "/idlout:foo",
+ "/ignore:4000", "/ignoreidl", "/implib:foo", "/safeseh",
+ "/safeseh:no", "/functionpadmin", "/maxilksize:1024",
+ "a.obj", nullptr));
+ EXPECT_EQ("", errorMessage());
+ EXPECT_EQ(2, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+}
+
+//
+// Test for "--"
+//
+
+TEST_F(WinLinkParserTest, DashDash) {
+ EXPECT_TRUE(parse("link.exe", "/subsystem:console", "/out:a.exe", "a.obj",
+ "--", "b.obj", "-c.obj", nullptr));
+ EXPECT_EQ(llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_CUI, _ctx.getSubsystem());
+ EXPECT_EQ("a.exe", _ctx.outputPath());
+ EXPECT_EQ(4, inputFileCount());
+ EXPECT_EQ("a.obj", inputFile(0));
+ EXPECT_EQ("b.obj", inputFile(1));
+ EXPECT_EQ("-c.obj", inputFile(2));
+}
diff --git a/unittests/DriverTests/WinLinkModuleDefTest.cpp b/unittests/DriverTests/WinLinkModuleDefTest.cpp
new file mode 100644
index 000000000000..6762fd4b2ea6
--- /dev/null
+++ b/unittests/DriverTests/WinLinkModuleDefTest.cpp
@@ -0,0 +1,155 @@
+//===- lld/unittest/WinLinkModuleDefTest.cpp ------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "lld/Driver/WinLinkModuleDef.h"
+#include "llvm/Support/MemoryBuffer.h"
+#include <memory>
+
+using namespace llvm;
+using namespace lld;
+
+class ParserTest : public testing::Test {
+protected:
+ std::vector<moduledef::Directive *> _dirs;
+
+ void parse(const char *contents) {
+ auto membuf =
+ std::unique_ptr<MemoryBuffer>(MemoryBuffer::getMemBuffer(contents));
+ moduledef::Lexer lexer(std::move(membuf));
+ moduledef::Parser parser(lexer, _alloc);
+ EXPECT_TRUE(parser.parse(_dirs));
+ EXPECT_TRUE(!_dirs.empty());
+ }
+
+ void verifyExportDesc(const PECOFFLinkingContext::ExportDesc &exp,
+ StringRef sym, int ordinal, bool noname, bool isData) {
+ EXPECT_EQ(sym, exp.name);
+ EXPECT_EQ(ordinal, exp.ordinal);
+ EXPECT_EQ(noname, exp.noname);
+ EXPECT_EQ(isData, exp.isData);
+ }
+
+private:
+ llvm::BumpPtrAllocator _alloc;
+};
+
+TEST_F(ParserTest, Exports) {
+ parse("EXPORTS\n"
+ " sym1\n"
+ " sym2 @5\n"
+ " sym3 @8 NONAME\n"
+ " sym4 DATA\n"
+ " sym5 @10 NONAME DATA\n");
+ EXPECT_EQ(1U, _dirs.size());
+ const std::vector<PECOFFLinkingContext::ExportDesc> &exports =
+ cast<moduledef::Exports>(_dirs[0])->getExports();
+ EXPECT_EQ(5U, exports.size());
+ verifyExportDesc(exports[0], "sym1", -1, false, false);
+ verifyExportDesc(exports[1], "sym2", 5, false, false);
+ verifyExportDesc(exports[2], "sym3", 8, true, false);
+ verifyExportDesc(exports[3], "sym4", -1, false, true);
+ verifyExportDesc(exports[4], "sym5", 10, true, true);
+}
+
+TEST_F(ParserTest, Heapsize) {
+ parse("HEAPSIZE 65536");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *heapsize = cast<moduledef::Heapsize>(_dirs[0]);
+ EXPECT_EQ(65536U, heapsize->getReserve());
+ EXPECT_EQ(0U, heapsize->getCommit());
+}
+
+TEST_F(ParserTest, HeapsizeWithCommit) {
+ parse("HEAPSIZE 65536, 8192");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *heapsize = cast<moduledef::Heapsize>(_dirs[0]);
+ EXPECT_EQ(65536U, heapsize->getReserve());
+ EXPECT_EQ(8192U, heapsize->getCommit());
+}
+
+TEST_F(ParserTest, StacksizeBasic) {
+ parse("STACKSIZE 65536");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *stacksize = cast<moduledef::Stacksize>(_dirs[0]);
+ EXPECT_EQ(65536U, stacksize->getReserve());
+ EXPECT_EQ(0U, stacksize->getCommit());
+}
+
+TEST_F(ParserTest, StacksizeWithCommit) {
+ parse("STACKSIZE 65536, 8192");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *stacksize = cast<moduledef::Stacksize>(_dirs[0]);
+ EXPECT_EQ(65536U, stacksize->getReserve());
+ EXPECT_EQ(8192U, stacksize->getCommit());
+}
+
+TEST_F(ParserTest, Library) {
+ parse("LIBRARY foo.dll");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *lib = cast<moduledef::Library>(_dirs[0]);
+ EXPECT_EQ("foo.dll", lib->getName());
+}
+
+TEST_F(ParserTest, NameBasic) {
+ parse("NAME foo.exe");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *name = cast<moduledef::Name>(_dirs[0]);
+ EXPECT_EQ("foo.exe", name->getOutputPath());
+ EXPECT_EQ(0U, name->getBaseAddress());
+}
+
+TEST_F(ParserTest, NameWithBase) {
+ parse("NAME foo.exe BASE=4096");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *name = cast<moduledef::Name>(_dirs[0]);
+ EXPECT_EQ("foo.exe", name->getOutputPath());
+ EXPECT_EQ(4096U, name->getBaseAddress());
+}
+
+TEST_F(ParserTest, NameLongFileName) {
+ parse("NAME \"a long file name.exe\"");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *name = cast<moduledef::Name>(_dirs[0]);
+ EXPECT_EQ("a long file name.exe", name->getOutputPath());
+ EXPECT_EQ(0U, name->getBaseAddress());
+}
+
+TEST_F(ParserTest, VersionMajor) {
+ parse("VERSION 12");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *ver = cast<moduledef::Version>(_dirs[0]);
+ EXPECT_EQ(12, ver->getMajorVersion());
+ EXPECT_EQ(0, ver->getMinorVersion());
+}
+
+TEST_F(ParserTest, VersionMajorMinor) {
+ parse("VERSION 12.34");
+ EXPECT_EQ(1U, _dirs.size());
+ auto *ver = cast<moduledef::Version>(_dirs[0]);
+ EXPECT_EQ(12, ver->getMajorVersion());
+ EXPECT_EQ(34, ver->getMinorVersion());
+}
+
+TEST_F(ParserTest, Multiple) {
+ parse("LIBRARY foo\n"
+ "EXPORTS sym\n"
+ "VERSION 12");
+ EXPECT_EQ(3U, _dirs.size());
+ auto *lib = cast<moduledef::Library>(_dirs[0]);
+ EXPECT_EQ("foo.dll", lib->getName());
+
+ const std::vector<PECOFFLinkingContext::ExportDesc> &exports =
+ cast<moduledef::Exports>(_dirs[1])->getExports();
+ EXPECT_EQ(1U, exports.size());
+ verifyExportDesc(exports[0], "sym", -1, false, false);
+
+ auto *ver = cast<moduledef::Version>(_dirs[2]);
+ EXPECT_EQ(12, ver->getMajorVersion());
+}
diff --git a/unittests/MachOTests/CMakeLists.txt b/unittests/MachOTests/CMakeLists.txt
new file mode 100644
index 000000000000..1a683484b5f9
--- /dev/null
+++ b/unittests/MachOTests/CMakeLists.txt
@@ -0,0 +1,13 @@
+
+add_lld_unittest(lldMachOTests
+ MachONormalizedFileBinaryReaderTests.cpp
+ MachONormalizedFileBinaryWriterTests.cpp
+ MachONormalizedFileToAtomsTests.cpp
+ MachONormalizedFileYAMLTests.cpp
+ )
+
+target_link_libraries(lldMachOTests
+ lldDriver
+ lldMachO
+ lldYAML
+ )
diff --git a/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp b/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
new file mode 100644
index 000000000000..22ed3f15b3e6
--- /dev/null
+++ b/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
@@ -0,0 +1,748 @@
+//===- lld/unittest/MachOTests/MachONormalizedFileBinaryReaderTests.cpp ---===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "../../lib/ReaderWriter/MachO/MachONormalizedFile.h"
+#include "llvm/Support/MachO.h"
+#include <assert.h>
+#include <vector>
+
+using llvm::StringRef;
+using llvm::MemoryBuffer;
+using llvm::ErrorOr;
+
+using namespace lld::mach_o::normalized;
+using namespace llvm::MachO;
+
+static std::unique_ptr<NormalizedFile>
+fromBinary(const uint8_t bytes[], unsigned length, StringRef archStr) {
+ StringRef sr((const char*)bytes, length);
+ std::unique_ptr<MemoryBuffer> mb(MemoryBuffer::getMemBuffer(sr, "", false));
+ ErrorOr<std::unique_ptr<NormalizedFile>> r =
+ lld::mach_o::normalized::readBinary(
+ mb, lld::MachOLinkingContext::archFromName(archStr));
+ EXPECT_FALSE(!r);
+ return std::move(*r);
+}
+
+// The Mach-O object reader uses functions such as read32 or read64
+// which don't allow unaligned access. Our in-memory object file
+// needs to be aligned to a larger boundary than uint8_t's.
+#if _MSC_VER
+#define FILEBYTES __declspec(align(64)) const uint8_t fileBytes[]
+#else
+#define FILEBYTES const uint8_t fileBytes[] __attribute__((aligned(64)))
+#endif
+
+TEST(BinaryReaderTest, empty_obj_x86_64) {
+ FILEBYTES = {
+ 0xcf, 0xfa, 0xed, 0xfe, 0x07, 0x00, 0x00, 0x01,
+ 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00,
+ 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x19, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5f, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5f, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ std::unique_ptr<NormalizedFile> f =
+ fromBinary(fileBytes, sizeof(fileBytes), "x86_64");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
+ EXPECT_EQ((int)(f->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+
+TEST(BinaryReaderTest, empty_obj_x86) {
+ FILEBYTES = {
+ 0xce, 0xfa, 0xed, 0xfe, 0x07, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00,
+ 0x00, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5f, 0x5f, 0x74, 0x65,
+ 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5f, 0x5f, 0x54, 0x45,
+ 0x58, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ std::unique_ptr<NormalizedFile> f =
+ fromBinary(fileBytes, sizeof(fileBytes), "i386");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86);
+ EXPECT_EQ((int)(f->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+
+TEST(BinaryReaderTest, empty_obj_ppc) {
+ FILEBYTES = {
+ 0xfe, 0xed, 0xfa, 0xce, 0x00, 0x00, 0x00, 0x12,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7c,
+ 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
+ 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x5f, 0x5f, 0x74, 0x65,
+ 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5f, 0x5f, 0x54, 0x45,
+ 0x58, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ std::unique_ptr<NormalizedFile> f =
+ fromBinary(fileBytes, sizeof(fileBytes), "ppc");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_ppc);
+ EXPECT_EQ((int)(f->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+
+TEST(BinaryReaderTest, empty_obj_armv7) {
+ FILEBYTES = {
+ 0xce, 0xfa, 0xed, 0xfe, 0x0c, 0x00, 0x00, 0x00,
+ 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00,
+ 0x00, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5f, 0x5f, 0x74, 0x65,
+ 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5f, 0x5f, 0x54, 0x45,
+ 0x58, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ std::unique_ptr<NormalizedFile> f =
+ fromBinary(fileBytes, sizeof(fileBytes), "armv7");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7);
+ EXPECT_EQ((int)(f->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+TEST(BinaryReaderTest, empty_obj_x86_64_arm7) {
+ FILEBYTES = {
+#include "empty_obj_x86_armv7.txt"
+ };
+ std::unique_ptr<NormalizedFile> f =
+ fromBinary(fileBytes, sizeof(fileBytes), "x86_64");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
+ EXPECT_EQ((int)(f->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+
+ std::unique_ptr<NormalizedFile> f2 =
+ fromBinary(fileBytes, sizeof(fileBytes), "armv7");
+ EXPECT_EQ(f2->arch, lld::MachOLinkingContext::arch_armv7);
+ EXPECT_EQ((int)(f2->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f2->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f2->localSymbols.empty());
+ EXPECT_TRUE(f2->globalSymbols.empty());
+ EXPECT_TRUE(f2->undefinedSymbols.empty());
+}
+
+TEST(BinaryReaderTest, hello_obj_x86_64) {
+ FILEBYTES = {
+ 0xCF, 0xFA, 0xED, 0xFE, 0x07, 0x00, 0x00, 0x01,
+ 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00,
+ 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x19, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x70, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x74, 0x65, 0x78, 0x74, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x70, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0xA4, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x63, 0x73, 0x74, 0x72, 0x69, 0x6E,
+ 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x9D, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
+ 0xB4, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0xE4, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
+ 0x0B, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x55, 0x48, 0x89, 0xE5, 0x48, 0x83, 0xEC, 0x10,
+ 0x48, 0x8D, 0x3D, 0x00, 0x00, 0x00, 0x00, 0xC7,
+ 0x45, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xB0, 0x00,
+ 0xE8, 0x00, 0x00, 0x00, 0x00, 0xB9, 0x00, 0x00,
+ 0x00, 0x00, 0x89, 0x45, 0xF8, 0x89, 0xC8, 0x48,
+ 0x83, 0xC4, 0x10, 0x5D, 0xC3, 0x68, 0x65, 0x6C,
+ 0x6C, 0x6F, 0x0A, 0x00, 0x19, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x2D, 0x0B, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1D, 0x0F, 0x00, 0x00, 0x00,
+ 0x0E, 0x02, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x6D, 0x61,
+ 0x69, 0x6E, 0x00, 0x5F, 0x70, 0x72, 0x69, 0x6E,
+ 0x74, 0x66, 0x00, 0x4C, 0x5F, 0x2E, 0x73, 0x74,
+ 0x72, 0x00, 0x00, 0x00 };
+ std::unique_ptr<NormalizedFile> f =
+ fromBinary(fileBytes, sizeof(fileBytes), "x86_64");
+
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
+ EXPECT_EQ((int)(f->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_EQ(f->sections.size(), 2UL);
+ const Section& text = f->sections[0];
+ EXPECT_TRUE(text.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(text.sectionName.equals("__text"));
+ EXPECT_EQ(text.type, S_REGULAR);
+ EXPECT_EQ(text.attributes,SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(text.alignment, 4U);
+ EXPECT_EQ(text.address, Hex64(0x0));
+ EXPECT_EQ(text.content.size(), 45UL);
+ EXPECT_EQ((int)(text.content[0]), 0x55);
+ EXPECT_EQ((int)(text.content[1]), 0x48);
+ EXPECT_TRUE(text.indirectSymbols.empty());
+ EXPECT_EQ(text.relocations.size(), 2UL);
+ const Relocation& call = text.relocations[0];
+ EXPECT_EQ(call.offset, Hex32(0x19));
+ EXPECT_EQ(call.type, X86_64_RELOC_BRANCH);
+ EXPECT_EQ(call.length, 2);
+ EXPECT_EQ(call.isExtern, true);
+ EXPECT_EQ(call.symbol, 2U);
+ const Relocation& str = text.relocations[1];
+ EXPECT_EQ(str.offset, Hex32(0xB));
+ EXPECT_EQ(str.type, X86_64_RELOC_SIGNED);
+ EXPECT_EQ(str.length, 2);
+ EXPECT_EQ(str.isExtern, true);
+ EXPECT_EQ(str.symbol, 0U);
+
+ const Section& cstring = f->sections[1];
+ EXPECT_TRUE(cstring.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(cstring.sectionName.equals("__cstring"));
+ EXPECT_EQ(cstring.type, S_CSTRING_LITERALS);
+ EXPECT_EQ(cstring.attributes, SectionAttr(0));
+ EXPECT_EQ(cstring.alignment, 0U);
+ EXPECT_EQ(cstring.address, Hex64(0x02D));
+ EXPECT_EQ(cstring.content.size(), 7UL);
+ EXPECT_EQ((int)(cstring.content[0]), 0x68);
+ EXPECT_EQ((int)(cstring.content[1]), 0x65);
+ EXPECT_EQ((int)(cstring.content[2]), 0x6c);
+ EXPECT_TRUE(cstring.indirectSymbols.empty());
+ EXPECT_TRUE(cstring.relocations.empty());
+
+ EXPECT_EQ(f->localSymbols.size(), 1UL);
+ const Symbol& strLabel = f->localSymbols[0];
+ EXPECT_EQ(strLabel.type, N_SECT);
+ EXPECT_EQ(strLabel.sect, 2);
+ EXPECT_EQ(strLabel.value, Hex64(0x2D));
+ EXPECT_EQ(f->globalSymbols.size(), 1UL);
+ const Symbol& mainLabel = f->globalSymbols[0];
+ EXPECT_TRUE(mainLabel.name.equals("_main"));
+ EXPECT_EQ(mainLabel.type, N_SECT);
+ EXPECT_EQ(mainLabel.sect, 1);
+ EXPECT_EQ(mainLabel.scope, SymbolScope(N_EXT));
+ EXPECT_EQ(mainLabel.value, Hex64(0x0));
+ EXPECT_EQ(f->undefinedSymbols.size(), 1UL);
+ const Symbol& printfLabel = f->undefinedSymbols[0];
+ EXPECT_TRUE(printfLabel.name.equals("_printf"));
+ EXPECT_EQ(printfLabel.type, N_UNDF);
+ EXPECT_EQ(printfLabel.scope, SymbolScope(N_EXT));
+}
+
+
+TEST(BinaryReaderTest, hello_obj_x86) {
+ FILEBYTES = {
+ 0xCE, 0xFA, 0xED, 0xFE, 0x07, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00,
+ 0x00, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x37, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00,
+ 0x37, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5F, 0x5F, 0x74, 0x65,
+ 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5F, 0x5F, 0x54, 0x45,
+ 0x58, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x7C, 0x01, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x63, 0x73, 0x74, 0x72, 0x69, 0x6E,
+ 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0xAC, 0x01, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
+ 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x55, 0x89, 0xE5, 0x83,
+ 0xEC, 0x18, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x58,
+ 0x8D, 0x80, 0x25, 0x00, 0x00, 0x00, 0xC7, 0x45,
+ 0xFC, 0x00, 0x00, 0x00, 0x00, 0x89, 0x04, 0x24,
+ 0xE8, 0xDF, 0xFF, 0xFF, 0xFF, 0xB9, 0x00, 0x00,
+ 0x00, 0x00, 0x89, 0x45, 0xF8, 0x89, 0xC8, 0x83,
+ 0xC4, 0x18, 0x5D, 0xC3, 0x68, 0x65, 0x6C, 0x6C,
+ 0x6F, 0x0A, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x0D, 0x0E, 0x00, 0x00, 0xA4,
+ 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1,
+ 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x6D, 0x61,
+ 0x69, 0x6E, 0x00, 0x5F, 0x70, 0x72, 0x69, 0x6E,
+ 0x74, 0x66, 0x00, 0x00
+ };
+ std::unique_ptr<NormalizedFile> f =
+ fromBinary(fileBytes, sizeof(fileBytes), "i386");
+
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86);
+ EXPECT_EQ((int)(f->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_EQ(f->sections.size(), 2UL);
+ const Section& text = f->sections[0];
+ EXPECT_TRUE(text.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(text.sectionName.equals("__text"));
+ EXPECT_EQ(text.type, S_REGULAR);
+ EXPECT_EQ(text.attributes,SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(text.alignment, 4U);
+ EXPECT_EQ(text.address, Hex64(0x0));
+ EXPECT_EQ(text.content.size(), 48UL);
+ EXPECT_EQ((int)(text.content[0]), 0x55);
+ EXPECT_EQ((int)(text.content[1]), 0x89);
+ EXPECT_TRUE(text.indirectSymbols.empty());
+ EXPECT_EQ(text.relocations.size(), 3UL);
+ const Relocation& call = text.relocations[0];
+ EXPECT_EQ(call.offset, Hex32(0x1D));
+ EXPECT_EQ(call.scattered, false);
+ EXPECT_EQ(call.type, GENERIC_RELOC_VANILLA);
+ EXPECT_EQ(call.pcRel, true);
+ EXPECT_EQ(call.length, 2);
+ EXPECT_EQ(call.isExtern, true);
+ EXPECT_EQ(call.symbol, 1U);
+ const Relocation& sectDiff = text.relocations[1];
+ EXPECT_EQ(sectDiff.offset, Hex32(0xE));
+ EXPECT_EQ(sectDiff.scattered, true);
+ EXPECT_EQ(sectDiff.type, GENERIC_RELOC_LOCAL_SECTDIFF);
+ EXPECT_EQ(sectDiff.pcRel, false);
+ EXPECT_EQ(sectDiff.length, 2);
+ EXPECT_EQ(sectDiff.value, 0x30U);
+ const Relocation& pair = text.relocations[2];
+ EXPECT_EQ(pair.offset, Hex32(0x0));
+ EXPECT_EQ(pair.scattered, true);
+ EXPECT_EQ(pair.type, GENERIC_RELOC_PAIR);
+ EXPECT_EQ(pair.pcRel, false);
+ EXPECT_EQ(pair.length, 2);
+ EXPECT_EQ(pair.value, 0x0BU);
+
+ const Section& cstring = f->sections[1];
+ EXPECT_TRUE(cstring.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(cstring.sectionName.equals("__cstring"));
+ EXPECT_EQ(cstring.type, S_CSTRING_LITERALS);
+ EXPECT_EQ(cstring.attributes, SectionAttr(0));
+ EXPECT_EQ(cstring.alignment, 0U);
+ EXPECT_EQ(cstring.address, Hex64(0x030));
+ EXPECT_EQ(cstring.content.size(), 7UL);
+ EXPECT_EQ((int)(cstring.content[0]), 0x68);
+ EXPECT_EQ((int)(cstring.content[1]), 0x65);
+ EXPECT_EQ((int)(cstring.content[2]), 0x6c);
+ EXPECT_TRUE(cstring.indirectSymbols.empty());
+ EXPECT_TRUE(cstring.relocations.empty());
+
+ EXPECT_EQ(f->localSymbols.size(), 0UL);
+ EXPECT_EQ(f->globalSymbols.size(), 1UL);
+ const Symbol& mainLabel = f->globalSymbols[0];
+ EXPECT_TRUE(mainLabel.name.equals("_main"));
+ EXPECT_EQ(mainLabel.type, N_SECT);
+ EXPECT_EQ(mainLabel.sect, 1);
+ EXPECT_EQ(mainLabel.scope, SymbolScope(N_EXT));
+ EXPECT_EQ(mainLabel.value, Hex64(0x0));
+ EXPECT_EQ(f->undefinedSymbols.size(), 1UL);
+ const Symbol& printfLabel = f->undefinedSymbols[0];
+ EXPECT_TRUE(printfLabel.name.equals("_printf"));
+ EXPECT_EQ(printfLabel.type, N_UNDF);
+ EXPECT_EQ(printfLabel.scope, SymbolScope(N_EXT));
+}
+
+
+TEST(BinaryReaderTest, hello_obj_armv7) {
+ FILEBYTES = {
+ 0xCE, 0xFA, 0xED, 0xFE, 0x0C, 0x00, 0x00, 0x00,
+ 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00,
+ 0x00, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x31, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00,
+ 0x31, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5F, 0x5F, 0x74, 0x65,
+ 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5F, 0x5F, 0x54, 0x45,
+ 0x58, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x2A, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00,
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x63, 0x73, 0x74, 0x72, 0x69, 0x6E,
+ 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x2A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x6E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0xA0, 0x01, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0xB8, 0x01, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
+ 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0xB5, 0x6F, 0x46,
+ 0x82, 0xB0, 0x40, 0xF2, 0x18, 0x00, 0xC0, 0xF2,
+ 0x00, 0x00, 0x78, 0x44, 0x00, 0x21, 0xC0, 0xF2,
+ 0x00, 0x01, 0x01, 0x91, 0xFF, 0xF7, 0xF2, 0xFF,
+ 0x00, 0x21, 0xC0, 0xF2, 0x00, 0x01, 0x00, 0x90,
+ 0x08, 0x46, 0x02, 0xB0, 0x80, 0xBD, 0x68, 0x65,
+ 0x6C, 0x6C, 0x6F, 0x0A, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x6D,
+ 0x0A, 0x00, 0x00, 0xB9, 0x2A, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0xB1, 0x0E, 0x00, 0x00, 0x00,
+ 0x06, 0x00, 0x00, 0xA9, 0x2A, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xA1, 0x0E, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x0F, 0x01, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x5F, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x5F,
+ 0x70, 0x72, 0x69, 0x6E, 0x74, 0x66, 0x00, 0x00
+ };
+ std::unique_ptr<NormalizedFile> f =
+ fromBinary(fileBytes, sizeof(fileBytes), "armv7");
+
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7);
+ EXPECT_EQ((int)(f->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_EQ(f->sections.size(), 2UL);
+ const Section& text = f->sections[0];
+ EXPECT_TRUE(text.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(text.sectionName.equals("__text"));
+ EXPECT_EQ(text.type, S_REGULAR);
+ EXPECT_EQ(text.attributes,SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(text.alignment, 2U);
+ EXPECT_EQ(text.address, Hex64(0x0));
+ EXPECT_EQ(text.content.size(), 42UL);
+ EXPECT_EQ((int)(text.content[0]), 0x80);
+ EXPECT_EQ((int)(text.content[1]), 0xB5);
+ EXPECT_TRUE(text.indirectSymbols.empty());
+ EXPECT_EQ(text.relocations.size(), 5UL);
+ const Relocation& call = text.relocations[0];
+ EXPECT_EQ(call.offset, Hex32(0x18));
+ EXPECT_EQ(call.scattered, false);
+ EXPECT_EQ(call.type, ARM_THUMB_RELOC_BR22);
+ EXPECT_EQ(call.length, 2);
+ EXPECT_EQ(call.isExtern, true);
+ EXPECT_EQ(call.symbol, 1U);
+ const Relocation& movt = text.relocations[1];
+ EXPECT_EQ(movt.offset, Hex32(0xA));
+ EXPECT_EQ(movt.scattered, true);
+ EXPECT_EQ(movt.type, ARM_RELOC_HALF_SECTDIFF);
+ EXPECT_EQ(movt.length, 3);
+ EXPECT_EQ(movt.value, Hex32(0x2A));
+ const Relocation& movtPair = text.relocations[2];
+ EXPECT_EQ(movtPair.offset, Hex32(0x18));
+ EXPECT_EQ(movtPair.scattered, true);
+ EXPECT_EQ(movtPair.type, ARM_RELOC_PAIR);
+ EXPECT_EQ(movtPair.length, 3);
+ EXPECT_EQ(movtPair.value, Hex32(0xE));
+ const Relocation& movw = text.relocations[3];
+ EXPECT_EQ(movw.offset, Hex32(0x6));
+ EXPECT_EQ(movw.scattered, true);
+ EXPECT_EQ(movw.type, ARM_RELOC_HALF_SECTDIFF);
+ EXPECT_EQ(movw.length, 2);
+ EXPECT_EQ(movw.value, Hex32(0x2A));
+ const Relocation& movwPair = text.relocations[4];
+ EXPECT_EQ(movwPair.offset, Hex32(0x0));
+ EXPECT_EQ(movwPair.scattered, true);
+ EXPECT_EQ(movwPair.type, ARM_RELOC_PAIR);
+ EXPECT_EQ(movwPair.length, 2);
+ EXPECT_EQ(movwPair.value, Hex32(0xE));
+
+ const Section& cstring = f->sections[1];
+ EXPECT_TRUE(cstring.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(cstring.sectionName.equals("__cstring"));
+ EXPECT_EQ(cstring.type, S_CSTRING_LITERALS);
+ EXPECT_EQ(cstring.attributes, SectionAttr(0));
+ EXPECT_EQ(cstring.alignment, 0U);
+ EXPECT_EQ(cstring.address, Hex64(0x02A));
+ EXPECT_EQ(cstring.content.size(), 7UL);
+ EXPECT_EQ((int)(cstring.content[0]), 0x68);
+ EXPECT_EQ((int)(cstring.content[1]), 0x65);
+ EXPECT_EQ((int)(cstring.content[2]), 0x6c);
+ EXPECT_TRUE(cstring.indirectSymbols.empty());
+ EXPECT_TRUE(cstring.relocations.empty());
+
+ EXPECT_EQ(f->localSymbols.size(), 0UL);
+ EXPECT_EQ(f->globalSymbols.size(), 1UL);
+ const Symbol& mainLabel = f->globalSymbols[0];
+ EXPECT_TRUE(mainLabel.name.equals("_main"));
+ EXPECT_EQ(mainLabel.type, N_SECT);
+ EXPECT_EQ(mainLabel.sect, 1);
+ EXPECT_EQ(mainLabel.scope, SymbolScope(N_EXT));
+ EXPECT_EQ(mainLabel.value, Hex64(0x0));
+ EXPECT_EQ(f->undefinedSymbols.size(), 1UL);
+ const Symbol& printfLabel = f->undefinedSymbols[0];
+ EXPECT_TRUE(printfLabel.name.equals("_printf"));
+ EXPECT_EQ(printfLabel.type, N_UNDF);
+ EXPECT_EQ(printfLabel.scope, SymbolScope(N_EXT));
+}
+
+
+TEST(BinaryReaderTest, hello_obj_ppc) {
+ FILEBYTES = {
+ 0xFE, 0xED, 0xFA, 0xCE, 0x00, 0x00, 0x00, 0x12,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x28,
+ 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x01, 0x44,
+ 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x07,
+ 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x00, 0x00, 0x5F, 0x5F, 0x74, 0x65,
+ 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5F, 0x5F, 0x54, 0x45,
+ 0x58, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x01, 0x44,
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x90,
+ 0x00, 0x00, 0x00, 0x05, 0x80, 0x00, 0x04, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x63, 0x73, 0x74, 0x72, 0x69, 0x6E,
+ 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x5F, 0x5F, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x07,
+ 0x00, 0x00, 0x01, 0x88, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x01, 0xB8,
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0xD0,
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0B,
+ 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x02, 0xA6,
+ 0xBF, 0xC1, 0xFF, 0xF8, 0x90, 0x01, 0x00, 0x08,
+ 0x94, 0x21, 0xFF, 0xB0, 0x7C, 0x3E, 0x0B, 0x78,
+ 0x42, 0x9F, 0x00, 0x05, 0x7F, 0xE8, 0x02, 0xA6,
+ 0x3C, 0x5F, 0x00, 0x00, 0x38, 0x62, 0x00, 0x2C,
+ 0x4B, 0xFF, 0xFF, 0xDD, 0x38, 0x00, 0x00, 0x00,
+ 0x7C, 0x03, 0x03, 0x78, 0x80, 0x21, 0x00, 0x00,
+ 0x80, 0x01, 0x00, 0x08, 0x7C, 0x08, 0x03, 0xA6,
+ 0xBB, 0xC1, 0xFF, 0xF8, 0x4E, 0x80, 0x00, 0x20,
+ 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x0A, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x01, 0xD3,
+ 0xAB, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x44,
+ 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+ 0xAC, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x44,
+ 0xA1, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x18,
+ 0x00, 0x00, 0x00, 0x01, 0x0F, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x5F, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x5F,
+ 0x70, 0x72, 0x69, 0x6E, 0x74, 0x66, 0x00, 0x00
+ };
+ std::unique_ptr<NormalizedFile> f =
+ fromBinary(fileBytes, sizeof(fileBytes), "ppc");
+
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_ppc);
+ EXPECT_EQ((int)(f->fileType), MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_EQ(f->sections.size(), 2UL);
+ const Section& text = f->sections[0];
+ EXPECT_TRUE(text.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(text.sectionName.equals("__text"));
+ EXPECT_EQ(text.type, S_REGULAR);
+ EXPECT_EQ(text.attributes,SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(text.alignment, 2U);
+ EXPECT_EQ(text.address, Hex64(0x0));
+ EXPECT_EQ(text.content.size(), 68UL);
+ EXPECT_EQ((int)(text.content[0]), 0x7C);
+ EXPECT_EQ((int)(text.content[1]), 0x08);
+ EXPECT_TRUE(text.indirectSymbols.empty());
+ EXPECT_EQ(text.relocations.size(), 5UL);
+ const Relocation& bl = text.relocations[0];
+ EXPECT_EQ(bl.offset, Hex32(0x24));
+ EXPECT_EQ(bl.type, PPC_RELOC_BR24);
+ EXPECT_EQ(bl.length, 2);
+ EXPECT_EQ(bl.isExtern, true);
+ EXPECT_EQ(bl.symbol, 1U);
+ const Relocation& lo = text.relocations[1];
+ EXPECT_EQ(lo.offset, Hex32(0x20));
+ EXPECT_EQ(lo.scattered, true);
+ EXPECT_EQ(lo.type, PPC_RELOC_LO16_SECTDIFF);
+ EXPECT_EQ(lo.length, 2);
+ EXPECT_EQ(lo.value, Hex32(0x44));
+ const Relocation& loPair = text.relocations[2];
+ EXPECT_EQ(loPair.offset, Hex32(0x0));
+ EXPECT_EQ(loPair.scattered, true);
+ EXPECT_EQ(loPair.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(loPair.length, 2);
+ EXPECT_EQ(loPair.value, Hex32(0x18));
+ const Relocation& ha = text.relocations[3];
+ EXPECT_EQ(ha.offset, Hex32(0x1C));
+ EXPECT_EQ(ha.scattered, true);
+ EXPECT_EQ(ha.type, PPC_RELOC_HA16_SECTDIFF);
+ EXPECT_EQ(ha.length, 2);
+ EXPECT_EQ(ha.value, Hex32(0x44));
+ const Relocation& haPair = text.relocations[4];
+ EXPECT_EQ(haPair.offset, Hex32(0x2c));
+ EXPECT_EQ(haPair.scattered, true);
+ EXPECT_EQ(haPair.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(haPair.length, 2);
+ EXPECT_EQ(haPair.value, Hex32(0x18));
+
+ const Section& cstring = f->sections[1];
+ EXPECT_TRUE(cstring.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(cstring.sectionName.equals("__cstring"));
+ EXPECT_EQ(cstring.type, S_CSTRING_LITERALS);
+ EXPECT_EQ(cstring.attributes, SectionAttr(0));
+ EXPECT_EQ(cstring.alignment, 2U);
+ EXPECT_EQ(cstring.address, Hex64(0x044));
+ EXPECT_EQ(cstring.content.size(), 7UL);
+ EXPECT_EQ((int)(cstring.content[0]), 0x68);
+ EXPECT_EQ((int)(cstring.content[1]), 0x65);
+ EXPECT_EQ((int)(cstring.content[2]), 0x6c);
+ EXPECT_TRUE(cstring.indirectSymbols.empty());
+ EXPECT_TRUE(cstring.relocations.empty());
+
+ EXPECT_EQ(f->localSymbols.size(), 0UL);
+ EXPECT_EQ(f->globalSymbols.size(), 1UL);
+ const Symbol& mainLabel = f->globalSymbols[0];
+ EXPECT_TRUE(mainLabel.name.equals("_main"));
+ EXPECT_EQ(mainLabel.type, N_SECT);
+ EXPECT_EQ(mainLabel.sect, 1);
+ EXPECT_EQ(mainLabel.scope, SymbolScope(N_EXT));
+ EXPECT_EQ(mainLabel.value, Hex64(0x0));
+ EXPECT_EQ(f->undefinedSymbols.size(), 1UL);
+ const Symbol& printfLabel = f->undefinedSymbols[0];
+ EXPECT_TRUE(printfLabel.name.equals("_printf"));
+ EXPECT_EQ(printfLabel.type, N_UNDF);
+ EXPECT_EQ(printfLabel.scope, SymbolScope(N_EXT));
+
+ writeBinary(*f, "/tmp/foo.o");
+
+}
diff --git a/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp b/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp
new file mode 100644
index 000000000000..d79c6d62a847
--- /dev/null
+++ b/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp
@@ -0,0 +1,693 @@
+//===- lld/unittest/MachOTests/MachONormalizedFileBinaryWriterTests.cpp ---===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "../../lib/ReaderWriter/MachO/MachONormalizedFile.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/MachO.h"
+#include <cassert>
+#include <memory>
+#include <system_error>
+#include <vector>
+
+using llvm::StringRef;
+using llvm::MemoryBuffer;
+using llvm::SmallString;
+using llvm::Twine;
+using llvm::ErrorOr;
+using namespace llvm::MachO;
+using namespace lld::mach_o::normalized;
+
+// Parses binary mach-o file at specified path and returns
+// ownership of buffer to mb parameter and ownership of
+// Normalized file to nf parameter.
+static void fromBinary(StringRef path, std::unique_ptr<MemoryBuffer> &mb,
+ std::unique_ptr<NormalizedFile> &nf, StringRef archStr) {
+ ErrorOr<std::unique_ptr<MemoryBuffer>> mbOrErr = MemoryBuffer::getFile(path);
+ std::error_code ec = mbOrErr.getError();
+ EXPECT_FALSE(ec);
+ mb = std::move(mbOrErr.get());
+
+ ErrorOr<std::unique_ptr<NormalizedFile>> r =
+ lld::mach_o::normalized::readBinary(
+ mb, lld::MachOLinkingContext::archFromName(archStr));
+ EXPECT_FALSE(!r);
+ nf.reset(r->release());
+}
+
+static Relocation
+makeReloc(unsigned addr, bool rel, bool ext, RelocationInfoType type,
+ unsigned sym) {
+ Relocation result;
+ result.offset = addr;
+ result.scattered = false;
+ result.type = type;
+ result.length = 2;
+ result.pcRel = rel;
+ result.isExtern = ext;
+ result.value = 0;
+ result.symbol = sym;
+ return result;
+}
+
+static Relocation
+makeScatReloc(unsigned addr, RelocationInfoType type, unsigned value) {
+ Relocation result;
+ result.offset = addr;
+ result.scattered = true;
+ result.type = type;
+ result.length = 2;
+ result.pcRel = false;
+ result.isExtern = true;
+ result.value = value;
+ result.symbol = 0;
+ return result;
+}
+
+static Symbol
+makeUndefSymbol(StringRef name) {
+ Symbol sym;
+ sym.name = name;
+ sym.type = N_UNDF;
+ sym.scope = N_EXT;
+ sym.sect = NO_SECT;
+ sym.desc = 0;
+ sym.value = 0;
+ return sym;
+}
+
+
+static Symbol
+makeSymbol(StringRef name, unsigned addr) {
+ Symbol sym;
+ sym.name = name;
+ sym.type = N_SECT;
+ sym.scope = N_EXT;
+ sym.sect = 1;
+ sym.desc = 0;
+ sym.value = addr;
+ return sym;
+}
+
+static Symbol
+makeThumbSymbol(StringRef name, unsigned addr) {
+ Symbol sym;
+ sym.name = name;
+ sym.type = N_SECT;
+ sym.scope = N_EXT;
+ sym.sect = 1;
+ sym.desc = N_ARM_THUMB_DEF;
+ sym.value = addr;
+ return sym;
+}
+
+TEST(BinaryWriterTest, obj_relocs_x86_64) {
+ SmallString<128> tmpFl;
+ {
+ NormalizedFile f;
+ f.arch = lld::MachOLinkingContext::arch_x86_64;
+ f.fileType = MH_OBJECT;
+ f.flags = MH_SUBSECTIONS_VIA_SYMBOLS;
+ f.os = lld::MachOLinkingContext::OS::macOSX;
+ f.sections.resize(1);
+ Section& text = f.sections.front();
+ text.segmentName = "__TEXT";
+ text.sectionName = "__text";
+ text.type = S_REGULAR;
+ text.attributes = SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS);
+ text.alignment = 4;
+ text.address = 0;
+ const uint8_t textBytes[] = {
+ 0xe8, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x05,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0x35, 0x00, 0x00,
+ 0x00, 0x00, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00,
+ 0xc6, 0x05, 0xff, 0xff, 0xff, 0xff, 0x12, 0xc7,
+ 0x05, 0xfc, 0xff, 0xff, 0xff, 0x78, 0x56, 0x34,
+ 0x12, 0x48, 0x8b, 0x3d, 0x00, 0x00, 0x00, 0x00 };
+
+ text.content = llvm::makeArrayRef(textBytes, sizeof(textBytes));
+ text.relocations.push_back(makeReloc(0x01, false, true, X86_64_RELOC_BRANCH, 1));
+ text.relocations.push_back(makeReloc(0x08, false, true, X86_64_RELOC_GOT_LOAD, 1));
+ text.relocations.push_back(makeReloc(0x0E, false, true, X86_64_RELOC_GOT, 1));
+ text.relocations.push_back(makeReloc(0x14, false, true, X86_64_RELOC_SIGNED, 1));
+ text.relocations.push_back(makeReloc(0x1A, false, true, X86_64_RELOC_SIGNED_1, 1));
+ text.relocations.push_back(makeReloc(0x21, false, true, X86_64_RELOC_SIGNED_4, 1));
+ text.relocations.push_back(makeReloc(0x2C, false, true, X86_64_RELOC_TLV, 2));
+
+ f.undefinedSymbols.push_back(makeUndefSymbol("_bar"));
+ f.undefinedSymbols.push_back(makeUndefSymbol("_tbar"));
+
+ std::error_code ec =
+ llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
+ EXPECT_FALSE(ec);
+ ec = writeBinary(f, tmpFl);
+ EXPECT_FALSE(ec);
+ }
+
+ std::unique_ptr<MemoryBuffer> bufferOwner;
+ std::unique_ptr<NormalizedFile> f2;
+ fromBinary(tmpFl, bufferOwner, f2, "x86_64");
+
+ EXPECT_EQ(lld::MachOLinkingContext::arch_x86_64, f2->arch);
+ EXPECT_EQ(MH_OBJECT, f2->fileType);
+ EXPECT_EQ(FileFlags(MH_SUBSECTIONS_VIA_SYMBOLS), f2->flags);
+
+ EXPECT_TRUE(f2->localSymbols.empty());
+ EXPECT_TRUE(f2->globalSymbols.empty());
+ EXPECT_EQ(2UL, f2->undefinedSymbols.size());
+ const Symbol& barUndef = f2->undefinedSymbols[0];
+ EXPECT_TRUE(barUndef.name.equals("_bar"));
+ EXPECT_EQ(N_UNDF, barUndef.type);
+ EXPECT_EQ(SymbolScope(N_EXT), barUndef.scope);
+ const Symbol& tbarUndef = f2->undefinedSymbols[1];
+ EXPECT_TRUE(tbarUndef.name.equals("_tbar"));
+ EXPECT_EQ(N_UNDF, tbarUndef.type);
+ EXPECT_EQ(SymbolScope(N_EXT), tbarUndef.scope);
+
+ EXPECT_EQ(1UL, f2->sections.size());
+ const Section& text = f2->sections[0];
+ EXPECT_TRUE(text.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(text.sectionName.equals("__text"));
+ EXPECT_EQ(S_REGULAR, text.type);
+ EXPECT_EQ(text.attributes,SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(text.alignment, 4U);
+ EXPECT_EQ(text.address, Hex64(0x0));
+ EXPECT_EQ(48UL, text.content.size());
+ const Relocation& call = text.relocations[0];
+ EXPECT_EQ(call.offset, Hex32(0x1));
+ EXPECT_EQ(call.type, X86_64_RELOC_BRANCH);
+ EXPECT_EQ(call.length, 2);
+ EXPECT_EQ(call.isExtern, true);
+ EXPECT_EQ(call.symbol, 1U);
+ const Relocation& gotLoad = text.relocations[1];
+ EXPECT_EQ(gotLoad.offset, Hex32(0x8));
+ EXPECT_EQ(gotLoad.type, X86_64_RELOC_GOT_LOAD);
+ EXPECT_EQ(gotLoad.length, 2);
+ EXPECT_EQ(gotLoad.isExtern, true);
+ EXPECT_EQ(gotLoad.symbol, 1U);
+ const Relocation& gotUse = text.relocations[2];
+ EXPECT_EQ(gotUse.offset, Hex32(0xE));
+ EXPECT_EQ(gotUse.type, X86_64_RELOC_GOT);
+ EXPECT_EQ(gotUse.length, 2);
+ EXPECT_EQ(gotUse.isExtern, true);
+ EXPECT_EQ(gotUse.symbol, 1U);
+ const Relocation& signed0 = text.relocations[3];
+ EXPECT_EQ(signed0.offset, Hex32(0x14));
+ EXPECT_EQ(signed0.type, X86_64_RELOC_SIGNED);
+ EXPECT_EQ(signed0.length, 2);
+ EXPECT_EQ(signed0.isExtern, true);
+ EXPECT_EQ(signed0.symbol, 1U);
+ const Relocation& signed1 = text.relocations[4];
+ EXPECT_EQ(signed1.offset, Hex32(0x1A));
+ EXPECT_EQ(signed1.type, X86_64_RELOC_SIGNED_1);
+ EXPECT_EQ(signed1.length, 2);
+ EXPECT_EQ(signed1.isExtern, true);
+ EXPECT_EQ(signed1.symbol, 1U);
+ const Relocation& signed4 = text.relocations[5];
+ EXPECT_EQ(signed4.offset, Hex32(0x21));
+ EXPECT_EQ(signed4.type, X86_64_RELOC_SIGNED_4);
+ EXPECT_EQ(signed4.length, 2);
+ EXPECT_EQ(signed4.isExtern, true);
+ EXPECT_EQ(signed4.symbol, 1U);
+
+ std::error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
+ EXPECT_FALSE(ec);
+}
+
+
+
+TEST(BinaryWriterTest, obj_relocs_x86) {
+ SmallString<128> tmpFl;
+ {
+ NormalizedFile f;
+ f.arch = lld::MachOLinkingContext::arch_x86;
+ f.fileType = MH_OBJECT;
+ f.flags = MH_SUBSECTIONS_VIA_SYMBOLS;
+ f.os = lld::MachOLinkingContext::OS::macOSX;
+ f.sections.resize(1);
+ Section& text = f.sections.front();
+ text.segmentName = "__TEXT";
+ text.sectionName = "__text";
+ text.type = S_REGULAR;
+ text.attributes = SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS);
+ text.alignment = 4;
+ text.address = 0;
+ const uint8_t textBytes[] = {
+ 0xe8, 0xfb, 0xff, 0xff, 0xff, 0xa1, 0x00, 0x00,
+ 0x00, 0x00, 0x8b, 0xb0, 0xfb, 0xff, 0xff, 0xff,
+ 0x8b, 0x80, 0x11, 0x00, 0x00, 0x00 };
+
+ text.content = llvm::makeArrayRef(textBytes, sizeof(textBytes));
+ text.relocations.push_back(makeReloc(0x01, true, true, GENERIC_RELOC_VANILLA, 0));
+ text.relocations.push_back(makeReloc(0x06, false, true, GENERIC_RELOC_VANILLA, 0));
+ text.relocations.push_back(makeScatReloc(0x0c, GENERIC_RELOC_LOCAL_SECTDIFF, 0));
+ text.relocations.push_back(makeScatReloc(0x0, GENERIC_RELOC_PAIR, 5));
+ text.relocations.push_back(makeReloc(0x12, true, true, GENERIC_RELOC_TLV, 1));
+
+ f.undefinedSymbols.push_back(makeUndefSymbol("_bar"));
+ f.undefinedSymbols.push_back(makeUndefSymbol("_tbar"));
+
+ std::error_code ec =
+ llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
+ EXPECT_FALSE(ec);
+ ec = writeBinary(f, tmpFl);
+ EXPECT_FALSE(ec);
+ }
+ std::unique_ptr<MemoryBuffer> bufferOwner;
+ std::unique_ptr<NormalizedFile> f2;
+ fromBinary(tmpFl, bufferOwner, f2, "i386");
+
+ EXPECT_EQ(lld::MachOLinkingContext::arch_x86, f2->arch);
+ EXPECT_EQ(MH_OBJECT, f2->fileType);
+ EXPECT_EQ(FileFlags(MH_SUBSECTIONS_VIA_SYMBOLS), f2->flags);
+
+ EXPECT_TRUE(f2->localSymbols.empty());
+ EXPECT_TRUE(f2->globalSymbols.empty());
+ EXPECT_EQ(2UL, f2->undefinedSymbols.size());
+ const Symbol& barUndef = f2->undefinedSymbols[0];
+ EXPECT_TRUE(barUndef.name.equals("_bar"));
+ EXPECT_EQ(N_UNDF, barUndef.type);
+ EXPECT_EQ(SymbolScope(N_EXT), barUndef.scope);
+ const Symbol& tbarUndef = f2->undefinedSymbols[1];
+ EXPECT_TRUE(tbarUndef.name.equals("_tbar"));
+ EXPECT_EQ(N_UNDF, tbarUndef.type);
+ EXPECT_EQ(SymbolScope(N_EXT), tbarUndef.scope);
+
+ EXPECT_EQ(1UL, f2->sections.size());
+ const Section& text = f2->sections[0];
+ EXPECT_TRUE(text.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(text.sectionName.equals("__text"));
+ EXPECT_EQ(S_REGULAR, text.type);
+ EXPECT_EQ(text.attributes,SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(text.alignment, 4U);
+ EXPECT_EQ(text.address, Hex64(0x0));
+ EXPECT_EQ(22UL, text.content.size());
+ const Relocation& call = text.relocations[0];
+ EXPECT_EQ(call.offset, Hex32(0x1));
+ EXPECT_EQ(call.scattered, false);
+ EXPECT_EQ(call.type, GENERIC_RELOC_VANILLA);
+ EXPECT_EQ(call.pcRel, true);
+ EXPECT_EQ(call.length, 2);
+ EXPECT_EQ(call.isExtern, true);
+ EXPECT_EQ(call.symbol, 0U);
+ const Relocation& absLoad = text.relocations[1];
+ EXPECT_EQ(absLoad.offset, Hex32(0x6));
+ EXPECT_EQ(absLoad.scattered, false);
+ EXPECT_EQ(absLoad.type, GENERIC_RELOC_VANILLA);
+ EXPECT_EQ(absLoad.pcRel, false);
+ EXPECT_EQ(absLoad.length, 2);
+ EXPECT_EQ(absLoad.isExtern, true);
+ EXPECT_EQ(absLoad.symbol,0U);
+ const Relocation& pic1 = text.relocations[2];
+ EXPECT_EQ(pic1.offset, Hex32(0xc));
+ EXPECT_EQ(pic1.scattered, true);
+ EXPECT_EQ(pic1.type, GENERIC_RELOC_LOCAL_SECTDIFF);
+ EXPECT_EQ(pic1.length, 2);
+ EXPECT_EQ(pic1.value, 0U);
+ const Relocation& pic2 = text.relocations[3];
+ EXPECT_EQ(pic2.offset, Hex32(0x0));
+ EXPECT_EQ(pic1.scattered, true);
+ EXPECT_EQ(pic2.type, GENERIC_RELOC_PAIR);
+ EXPECT_EQ(pic2.length, 2);
+ EXPECT_EQ(pic2.value, 5U);
+ const Relocation& tlv = text.relocations[4];
+ EXPECT_EQ(tlv.offset, Hex32(0x12));
+ EXPECT_EQ(tlv.type, GENERIC_RELOC_TLV);
+ EXPECT_EQ(tlv.length, 2);
+ EXPECT_EQ(tlv.isExtern, true);
+ EXPECT_EQ(tlv.symbol, 1U);
+
+ //llvm::errs() << "temp = " << tmpFl << "\n";
+ std::error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
+ EXPECT_FALSE(ec);
+}
+
+
+
+TEST(BinaryWriterTest, obj_relocs_armv7) {
+ SmallString<128> tmpFl;
+ {
+ NormalizedFile f;
+ f.arch = lld::MachOLinkingContext::arch_armv7;
+ f.fileType = MH_OBJECT;
+ f.flags = MH_SUBSECTIONS_VIA_SYMBOLS;
+ f.os = lld::MachOLinkingContext::OS::macOSX;
+ f.sections.resize(1);
+ Section& text = f.sections.front();
+ text.segmentName = "__TEXT";
+ text.sectionName = "__text";
+ text.type = S_REGULAR;
+ text.attributes = SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS);
+ text.alignment = 2;
+ text.address = 0;
+ const uint8_t textBytes[] = {
+ 0xff, 0xf7, 0xfe, 0xef, 0x40, 0xf2, 0x05, 0x01,
+ 0xc0, 0xf2, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xbf };
+
+ text.content = llvm::makeArrayRef(textBytes, sizeof(textBytes));
+ text.relocations.push_back(makeReloc(0x00, true, true,
+ ARM_THUMB_RELOC_BR22, 2));
+ text.relocations.push_back(makeScatReloc(0x04,
+ ARM_RELOC_HALF_SECTDIFF, 0x10));
+ text.relocations.push_back(makeScatReloc(0x00,
+ ARM_RELOC_PAIR, 0xC));
+ text.relocations.push_back(makeScatReloc(0x08,
+ ARM_RELOC_HALF_SECTDIFF, 0x10));
+ text.relocations.push_back(makeScatReloc(0x00,
+ ARM_RELOC_PAIR, 0xC));
+ text.relocations.push_back(makeReloc(0x0C, false, true,
+ ARM_RELOC_VANILLA, 2));
+
+ f.globalSymbols.push_back(makeThumbSymbol("_foo", 0x00));
+ f.globalSymbols.push_back(makeThumbSymbol("_foo2", 0x10));
+ f.undefinedSymbols.push_back(makeUndefSymbol("_bar"));
+
+ std::error_code ec =
+ llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
+ EXPECT_FALSE(ec);
+ ec = writeBinary(f, tmpFl);
+ EXPECT_FALSE(ec);
+ }
+ std::unique_ptr<MemoryBuffer> bufferOwner;
+ std::unique_ptr<NormalizedFile> f2;
+ fromBinary(tmpFl, bufferOwner, f2, "armv7");
+
+ EXPECT_EQ(lld::MachOLinkingContext::arch_armv7, f2->arch);
+ EXPECT_EQ(MH_OBJECT, f2->fileType);
+ EXPECT_EQ(FileFlags(MH_SUBSECTIONS_VIA_SYMBOLS), f2->flags);
+
+ EXPECT_TRUE(f2->localSymbols.empty());
+ EXPECT_EQ(2UL, f2->globalSymbols.size());
+ const Symbol& fooDef = f2->globalSymbols[0];
+ EXPECT_TRUE(fooDef.name.equals("_foo"));
+ EXPECT_EQ(N_SECT, fooDef.type);
+ EXPECT_EQ(1, fooDef.sect);
+ EXPECT_EQ(SymbolScope(N_EXT), fooDef.scope);
+ const Symbol& foo2Def = f2->globalSymbols[1];
+ EXPECT_TRUE(foo2Def.name.equals("_foo2"));
+ EXPECT_EQ(N_SECT, foo2Def.type);
+ EXPECT_EQ(1, foo2Def.sect);
+ EXPECT_EQ(SymbolScope(N_EXT), foo2Def.scope);
+
+ EXPECT_EQ(1UL, f2->undefinedSymbols.size());
+ const Symbol& barUndef = f2->undefinedSymbols[0];
+ EXPECT_TRUE(barUndef.name.equals("_bar"));
+ EXPECT_EQ(N_UNDF, barUndef.type);
+ EXPECT_EQ(SymbolScope(N_EXT), barUndef.scope);
+
+ EXPECT_EQ(1UL, f2->sections.size());
+ const Section& text = f2->sections[0];
+ EXPECT_TRUE(text.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(text.sectionName.equals("__text"));
+ EXPECT_EQ(S_REGULAR, text.type);
+ EXPECT_EQ(text.attributes,SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(text.alignment, 2U);
+ EXPECT_EQ(text.address, Hex64(0x0));
+ EXPECT_EQ(18UL, text.content.size());
+ const Relocation& blx = text.relocations[0];
+ EXPECT_EQ(blx.offset, Hex32(0x0));
+ EXPECT_EQ(blx.scattered, false);
+ EXPECT_EQ(blx.type, ARM_THUMB_RELOC_BR22);
+ EXPECT_EQ(blx.pcRel, true);
+ EXPECT_EQ(blx.length, 2);
+ EXPECT_EQ(blx.isExtern, true);
+ EXPECT_EQ(blx.symbol, 2U);
+ const Relocation& movw1 = text.relocations[1];
+ EXPECT_EQ(movw1.offset, Hex32(0x4));
+ EXPECT_EQ(movw1.scattered, true);
+ EXPECT_EQ(movw1.type, ARM_RELOC_HALF_SECTDIFF);
+ EXPECT_EQ(movw1.length, 2);
+ EXPECT_EQ(movw1.value, 0x10U);
+ const Relocation& movw2 = text.relocations[2];
+ EXPECT_EQ(movw2.offset, Hex32(0x0));
+ EXPECT_EQ(movw2.scattered, true);
+ EXPECT_EQ(movw2.type, ARM_RELOC_PAIR);
+ EXPECT_EQ(movw2.length, 2);
+ EXPECT_EQ(movw2.value, Hex32(0xC));
+ const Relocation& movt1 = text.relocations[3];
+ EXPECT_EQ(movt1.offset, Hex32(0x8));
+ EXPECT_EQ(movt1.scattered, true);
+ EXPECT_EQ(movt1.type, ARM_RELOC_HALF_SECTDIFF);
+ EXPECT_EQ(movt1.length, 2);
+ EXPECT_EQ(movt1.value, Hex32(0x10));
+ const Relocation& movt2 = text.relocations[4];
+ EXPECT_EQ(movt2.offset, Hex32(0x0));
+ EXPECT_EQ(movt2.scattered, true);
+ EXPECT_EQ(movt2.type, ARM_RELOC_PAIR);
+ EXPECT_EQ(movt2.length, 2);
+ EXPECT_EQ(movt2.value, Hex32(0xC));
+ const Relocation& absPointer = text.relocations[5];
+ EXPECT_EQ(absPointer.offset, Hex32(0xC));
+ EXPECT_EQ(absPointer.type, ARM_RELOC_VANILLA);
+ EXPECT_EQ(absPointer.length, 2);
+ EXPECT_EQ(absPointer.isExtern, true);
+ EXPECT_EQ(absPointer.symbol, 2U);
+
+ //llvm::errs() << "temp = " << tmpFl << "\n";
+ std::error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
+ EXPECT_FALSE(ec);
+}
+
+
+
+TEST(BinaryWriterTest, obj_relocs_ppc) {
+ SmallString<128> tmpFl;
+ {
+ NormalizedFile f;
+ f.arch = lld::MachOLinkingContext::arch_ppc;
+ f.fileType = MH_OBJECT;
+ f.flags = MH_SUBSECTIONS_VIA_SYMBOLS;
+ f.os = lld::MachOLinkingContext::OS::macOSX;
+ f.sections.resize(1);
+ Section& text = f.sections.front();
+ text.segmentName = "__TEXT";
+ text.sectionName = "__text";
+ text.type = S_REGULAR;
+ text.attributes = SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS);
+ text.alignment = 2;
+ text.address = 0;
+ const uint8_t textBytes[] = {
+ 0x48, 0x00, 0x00, 0x01, 0x40, 0x82, 0xff, 0xfc,
+ 0x3c, 0x62, 0x00, 0x00, 0x3c, 0x62, 0x00, 0x00,
+ 0x80, 0x63, 0x00, 0x24, 0x80, 0x63, 0x00, 0x24,
+ 0x3c, 0x40, 0x00, 0x00, 0x3c, 0x60, 0x00, 0x00,
+ 0x80, 0x42, 0x00, 0x28, 0x80, 0x63, 0x00, 0x28,
+ 0x60, 0x00, 0x00, 0x00 };
+
+ text.content = llvm::makeArrayRef(textBytes, sizeof(textBytes));
+ text.relocations.push_back(makeReloc(0x00, true, true,
+ PPC_RELOC_BR24, 2));
+ text.relocations.push_back(makeReloc(0x04, true, true,
+ PPC_RELOC_BR14, 2));
+ text.relocations.push_back(makeScatReloc(0x08,
+ PPC_RELOC_HI16_SECTDIFF, 0x28));
+ text.relocations.push_back(makeScatReloc(0x24,
+ PPC_RELOC_PAIR, 0x4));
+ text.relocations.push_back(makeScatReloc(0x0C,
+ PPC_RELOC_HA16_SECTDIFF, 0x28));
+ text.relocations.push_back(makeScatReloc(0x24,
+ PPC_RELOC_PAIR, 0x4));
+ text.relocations.push_back(makeScatReloc(0x10,
+ PPC_RELOC_LO16_SECTDIFF, 0x28));
+ text.relocations.push_back(makeScatReloc(0x00,
+ PPC_RELOC_PAIR, 0x4));
+ text.relocations.push_back(makeScatReloc(0x14,
+ PPC_RELOC_LO14_SECTDIFF, 0x28));
+ text.relocations.push_back(makeScatReloc(0x00,
+ PPC_RELOC_PAIR, 0x4));
+ text.relocations.push_back(makeReloc(0x18, false, false,
+ PPC_RELOC_HI16, 1));
+ text.relocations.push_back(makeReloc(0x28, false, false,
+ PPC_RELOC_PAIR, 0));
+ text.relocations.push_back(makeReloc(0x1C, false, false,
+ PPC_RELOC_HA16, 1));
+ text.relocations.push_back(makeReloc(0x28, false, false,
+ PPC_RELOC_PAIR, 0));
+ text.relocations.push_back(makeReloc(0x20, false, false,
+ PPC_RELOC_LO16, 1));
+ text.relocations.push_back(makeReloc(0x00, false, false,
+ PPC_RELOC_PAIR, 0));
+ text.relocations.push_back(makeReloc(0x24, false, false,
+ PPC_RELOC_LO14, 1));
+ text.relocations.push_back(makeReloc(0x00, false, false,
+ PPC_RELOC_PAIR, 0));
+
+ f.globalSymbols.push_back(makeSymbol("_foo", 0x00));
+ f.globalSymbols.push_back(makeSymbol("_foo2", 0x28));
+ f.undefinedSymbols.push_back(makeUndefSymbol("_bar"));
+
+ std::error_code ec =
+ llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
+ EXPECT_FALSE(ec);
+ ec = writeBinary(f, tmpFl);
+ EXPECT_FALSE(ec);
+ }
+ std::unique_ptr<MemoryBuffer> bufferOwner;
+ std::unique_ptr<NormalizedFile> f2;
+ fromBinary(tmpFl, bufferOwner, f2, "ppc");
+
+ EXPECT_EQ(lld::MachOLinkingContext::arch_ppc, f2->arch);
+ EXPECT_EQ(MH_OBJECT, f2->fileType);
+ EXPECT_EQ(FileFlags(MH_SUBSECTIONS_VIA_SYMBOLS), f2->flags);
+
+ EXPECT_TRUE(f2->localSymbols.empty());
+ EXPECT_EQ(2UL, f2->globalSymbols.size());
+ const Symbol& fooDef = f2->globalSymbols[0];
+ EXPECT_TRUE(fooDef.name.equals("_foo"));
+ EXPECT_EQ(N_SECT, fooDef.type);
+ EXPECT_EQ(1, fooDef.sect);
+ EXPECT_EQ(SymbolScope(N_EXT), fooDef.scope);
+ const Symbol& foo2Def = f2->globalSymbols[1];
+ EXPECT_TRUE(foo2Def.name.equals("_foo2"));
+ EXPECT_EQ(N_SECT, foo2Def.type);
+ EXPECT_EQ(1, foo2Def.sect);
+ EXPECT_EQ(SymbolScope(N_EXT), foo2Def.scope);
+
+ EXPECT_EQ(1UL, f2->undefinedSymbols.size());
+ const Symbol& barUndef = f2->undefinedSymbols[0];
+ EXPECT_TRUE(barUndef.name.equals("_bar"));
+ EXPECT_EQ(N_UNDF, barUndef.type);
+ EXPECT_EQ(SymbolScope(N_EXT), barUndef.scope);
+
+ EXPECT_EQ(1UL, f2->sections.size());
+ const Section& text = f2->sections[0];
+ EXPECT_TRUE(text.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(text.sectionName.equals("__text"));
+ EXPECT_EQ(S_REGULAR, text.type);
+ EXPECT_EQ(text.attributes,SectionAttr(S_ATTR_PURE_INSTRUCTIONS
+ | S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(text.alignment, 2U);
+ EXPECT_EQ(text.address, Hex64(0x0));
+ EXPECT_EQ(44UL, text.content.size());
+ const Relocation& br24 = text.relocations[0];
+ EXPECT_EQ(br24.offset, Hex32(0x0));
+ EXPECT_EQ(br24.scattered, false);
+ EXPECT_EQ(br24.type, PPC_RELOC_BR24);
+ EXPECT_EQ(br24.pcRel, true);
+ EXPECT_EQ(br24.length, 2);
+ EXPECT_EQ(br24.isExtern, true);
+ EXPECT_EQ(br24.symbol, 2U);
+ const Relocation& br14 = text.relocations[1];
+ EXPECT_EQ(br14.offset, Hex32(0x4));
+ EXPECT_EQ(br14.scattered, false);
+ EXPECT_EQ(br14.type, PPC_RELOC_BR14);
+ EXPECT_EQ(br14.pcRel, true);
+ EXPECT_EQ(br14.length, 2);
+ EXPECT_EQ(br14.isExtern, true);
+ EXPECT_EQ(br14.symbol, 2U);
+ const Relocation& pichi1 = text.relocations[2];
+ EXPECT_EQ(pichi1.offset, Hex32(0x8));
+ EXPECT_EQ(pichi1.scattered, true);
+ EXPECT_EQ(pichi1.type, PPC_RELOC_HI16_SECTDIFF);
+ EXPECT_EQ(pichi1.length, 2);
+ EXPECT_EQ(pichi1.value, 0x28U);
+ const Relocation& pichi2 = text.relocations[3];
+ EXPECT_EQ(pichi2.offset, Hex32(0x24));
+ EXPECT_EQ(pichi2.scattered, true);
+ EXPECT_EQ(pichi2.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(pichi2.length, 2);
+ EXPECT_EQ(pichi2.value, 0x4U);
+ const Relocation& picha1 = text.relocations[4];
+ EXPECT_EQ(picha1.offset, Hex32(0xC));
+ EXPECT_EQ(picha1.scattered, true);
+ EXPECT_EQ(picha1.type, PPC_RELOC_HA16_SECTDIFF);
+ EXPECT_EQ(picha1.length, 2);
+ EXPECT_EQ(picha1.value, 0x28U);
+ const Relocation& picha2 = text.relocations[5];
+ EXPECT_EQ(picha2.offset, Hex32(0x24));
+ EXPECT_EQ(picha2.scattered, true);
+ EXPECT_EQ(picha2.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(picha2.length, 2);
+ EXPECT_EQ(picha2.value, 0x4U);
+ const Relocation& piclo1 = text.relocations[6];
+ EXPECT_EQ(piclo1.offset, Hex32(0x10));
+ EXPECT_EQ(piclo1.scattered, true);
+ EXPECT_EQ(piclo1.type, PPC_RELOC_LO16_SECTDIFF);
+ EXPECT_EQ(piclo1.length, 2);
+ EXPECT_EQ(piclo1.value, 0x28U);
+ const Relocation& piclo2 = text.relocations[7];
+ EXPECT_EQ(piclo2.offset, Hex32(0x0));
+ EXPECT_EQ(piclo2.scattered, true);
+ EXPECT_EQ(piclo2.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(piclo2.length, 2);
+ EXPECT_EQ(piclo2.value, 0x4U);
+ const Relocation& picloa1 = text.relocations[8];
+ EXPECT_EQ(picloa1.offset, Hex32(0x14));
+ EXPECT_EQ(picloa1.scattered, true);
+ EXPECT_EQ(picloa1.type, PPC_RELOC_LO14_SECTDIFF);
+ EXPECT_EQ(picloa1.length, 2);
+ EXPECT_EQ(picloa1.value, 0x28U);
+ const Relocation& picloa2 = text.relocations[9];
+ EXPECT_EQ(picloa2.offset, Hex32(0x0));
+ EXPECT_EQ(picloa2.scattered, true);
+ EXPECT_EQ(picloa2.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(picloa2.length, 2);
+ EXPECT_EQ(picloa2.value, 0x4U);
+ const Relocation& abshi1 = text.relocations[10];
+ EXPECT_EQ(abshi1.offset, Hex32(0x18));
+ EXPECT_EQ(abshi1.scattered, false);
+ EXPECT_EQ(abshi1.type, PPC_RELOC_HI16);
+ EXPECT_EQ(abshi1.length, 2);
+ EXPECT_EQ(abshi1.symbol, 1U);
+ const Relocation& abshi2 = text.relocations[11];
+ EXPECT_EQ(abshi2.offset, Hex32(0x28));
+ EXPECT_EQ(abshi2.scattered, false);
+ EXPECT_EQ(abshi2.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(abshi2.length, 2);
+ EXPECT_EQ(abshi2.symbol, 0U);
+ const Relocation& absha1 = text.relocations[12];
+ EXPECT_EQ(absha1.offset, Hex32(0x1C));
+ EXPECT_EQ(absha1.scattered, false);
+ EXPECT_EQ(absha1.type, PPC_RELOC_HA16);
+ EXPECT_EQ(absha1.length, 2);
+ EXPECT_EQ(absha1.symbol, 1U);
+ const Relocation& absha2 = text.relocations[13];
+ EXPECT_EQ(absha2.offset, Hex32(0x28));
+ EXPECT_EQ(absha2.scattered, false);
+ EXPECT_EQ(absha2.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(absha2.length, 2);
+ EXPECT_EQ(absha2.symbol, 0U);
+ const Relocation& abslo1 = text.relocations[14];
+ EXPECT_EQ(abslo1.offset, Hex32(0x20));
+ EXPECT_EQ(abslo1.scattered, false);
+ EXPECT_EQ(abslo1.type, PPC_RELOC_LO16);
+ EXPECT_EQ(abslo1.length, 2);
+ EXPECT_EQ(abslo1.symbol, 1U);
+ const Relocation& abslo2 = text.relocations[15];
+ EXPECT_EQ(abslo2.offset, Hex32(0x00));
+ EXPECT_EQ(abslo2.scattered, false);
+ EXPECT_EQ(abslo2.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(abslo2.length, 2);
+ EXPECT_EQ(abslo2.symbol, 0U);
+ const Relocation& absloa1 = text.relocations[16];
+ EXPECT_EQ(absloa1.offset, Hex32(0x24));
+ EXPECT_EQ(absloa1.scattered, false);
+ EXPECT_EQ(absloa1.type, PPC_RELOC_LO14);
+ EXPECT_EQ(absloa1.length, 2);
+ EXPECT_EQ(absloa1.symbol, 1U);
+ const Relocation& absloa2 = text.relocations[17];
+ EXPECT_EQ(absloa2.offset, Hex32(0x00));
+ EXPECT_EQ(absloa2.scattered, false);
+ EXPECT_EQ(absloa2.type, PPC_RELOC_PAIR);
+ EXPECT_EQ(absloa2.length, 2);
+ EXPECT_EQ(absloa2.symbol, 0U);
+
+ std::error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
+ EXPECT_FALSE(ec);
+}
+
diff --git a/unittests/MachOTests/MachONormalizedFileToAtomsTests.cpp b/unittests/MachOTests/MachONormalizedFileToAtomsTests.cpp
new file mode 100644
index 000000000000..16ef88aa4a40
--- /dev/null
+++ b/unittests/MachOTests/MachONormalizedFileToAtomsTests.cpp
@@ -0,0 +1,94 @@
+//===- lld/unittest/MachOTests/MachONormalizedFileToAtomsTests.cpp --------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "../../lib/ReaderWriter/MachO/MachONormalizedFile.h"
+#include "llvm/Support/MachO.h"
+#include <assert.h>
+#include <vector>
+
+using llvm::ErrorOr;
+
+using namespace lld::mach_o::normalized;
+using namespace llvm::MachO;
+
+TEST(ToAtomsTest, empty_obj_x86_64) {
+ NormalizedFile f;
+ f.arch = lld::MachOLinkingContext::arch_x86_64;
+ ErrorOr<std::unique_ptr<const lld::File>> atom_f =
+ normalizedToAtoms(f, "", false);
+ EXPECT_FALSE(!atom_f);
+ EXPECT_EQ(0U, (*atom_f)->defined().size());
+}
+
+TEST(ToAtomsTest, basic_obj_x86_64) {
+ NormalizedFile f;
+ f.arch = lld::MachOLinkingContext::arch_x86_64;
+ Section textSection;
+ static const uint8_t contentBytes[] = { 0x90, 0xC3, 0xC3, 0xC4 };
+ const unsigned contentSize = sizeof(contentBytes) / sizeof(contentBytes[0]);
+ textSection.content = llvm::makeArrayRef(contentBytes, contentSize);
+ f.sections.push_back(textSection);
+ Symbol fooSymbol;
+ fooSymbol.name = "_foo";
+ fooSymbol.type = N_SECT;
+ fooSymbol.scope = N_EXT;
+ fooSymbol.sect = 1;
+ fooSymbol.value = 0;
+ f.globalSymbols.push_back(fooSymbol);
+ Symbol barSymbol;
+ barSymbol.name = "_bar";
+ barSymbol.type = N_SECT;
+ barSymbol.scope = N_EXT;
+ barSymbol.sect = 1;
+ barSymbol.value = 2;
+ f.globalSymbols.push_back(barSymbol);
+ Symbol undefSym;
+ undefSym.name = "_undef";
+ undefSym.type = N_UNDF;
+ f.undefinedSymbols.push_back(undefSym);
+ Symbol bazSymbol;
+ bazSymbol.name = "_baz";
+ bazSymbol.type = N_SECT;
+ bazSymbol.scope = N_EXT | N_PEXT;
+ bazSymbol.sect = 1;
+ bazSymbol.value = 3;
+ f.localSymbols.push_back(bazSymbol);
+
+ ErrorOr<std::unique_ptr<const lld::File>> atom_f =
+ normalizedToAtoms(f, "", false);
+ EXPECT_FALSE(!atom_f);
+ const lld::File &file = **atom_f;
+ EXPECT_EQ(3U, file.defined().size());
+ lld::File::defined_iterator it = file.defined().begin();
+ const lld::DefinedAtom *atom1 = *it;
+ ++it;
+ const lld::DefinedAtom *atom2 = *it;
+ ++it;
+ const lld::DefinedAtom *atom3 = *it;
+ const lld::UndefinedAtom *atom4 = *file.undefined().begin();
+ EXPECT_TRUE(atom1->name().equals("_foo"));
+ EXPECT_EQ(2U, atom1->rawContent().size());
+ EXPECT_EQ(0x90, atom1->rawContent()[0]);
+ EXPECT_EQ(0xC3, atom1->rawContent()[1]);
+ EXPECT_EQ(lld::Atom::scopeGlobal, atom1->scope());
+
+ EXPECT_TRUE(atom2->name().equals("_bar"));
+ EXPECT_EQ(1U, atom2->rawContent().size());
+ EXPECT_EQ(0xC3, atom2->rawContent()[0]);
+ EXPECT_EQ(lld::Atom::scopeGlobal, atom2->scope());
+
+ EXPECT_TRUE(atom3->name().equals("_baz"));
+ EXPECT_EQ(1U, atom3->rawContent().size());
+ EXPECT_EQ(0xC4, atom3->rawContent()[0]);
+ EXPECT_EQ(lld::Atom::scopeLinkageUnit, atom3->scope());
+
+ EXPECT_TRUE(atom4->name().equals("_undef"));
+ EXPECT_EQ(lld::Atom::definitionUndefined, atom4->definition());
+}
diff --git a/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp b/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp
new file mode 100644
index 000000000000..562dae60049d
--- /dev/null
+++ b/unittests/MachOTests/MachONormalizedFileYAMLTests.cpp
@@ -0,0 +1,766 @@
+//===- lld/unittest/MachOTests/MachONormalizedFileYAMLTests.cpp -----------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "../../lib/ReaderWriter/MachO/MachONormalizedFile.h"
+#include "llvm/Support/MachO.h"
+#include <assert.h>
+#include <vector>
+
+using llvm::StringRef;
+using llvm::MemoryBuffer;
+using llvm::ErrorOr;
+using lld::mach_o::normalized::NormalizedFile;
+using lld::mach_o::normalized::Symbol;
+using lld::mach_o::normalized::Section;
+using lld::mach_o::normalized::Relocation;
+
+
+static std::unique_ptr<NormalizedFile> fromYAML(StringRef str) {
+ std::unique_ptr<MemoryBuffer> mb(MemoryBuffer::getMemBuffer(str));
+ ErrorOr<std::unique_ptr<NormalizedFile>> r
+ = lld::mach_o::normalized::readYaml(mb);
+ EXPECT_FALSE(!r);
+ return std::move(*r);
+}
+
+static void toYAML(const NormalizedFile &f, std::string &out) {
+ llvm::raw_string_ostream ostr(out);
+ std::error_code ec = lld::mach_o::normalized::writeYaml(f, ostr);
+ EXPECT_TRUE(!ec);
+}
+
+
+// ppc is no longer supported, but it is here to test endianness handling.
+TEST(ObjectFileYAML, empty_ppc) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: ppc\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_ppc);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->sections.empty());
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+TEST(ObjectFileYAML, empty_x86_64) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: x86_64\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->sections.empty());
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+TEST(ObjectFileYAML, empty_x86) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: x86\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->sections.empty());
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+TEST(ObjectFileYAML, empty_armv6) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: armv6\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv6);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->sections.empty());
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+TEST(ObjectFileYAML, empty_armv7) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: armv7\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->sections.empty());
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+TEST(ObjectFileYAML, empty_armv7s) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: armv7s\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7s);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f->sections.empty());
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+}
+
+
+TEST(ObjectFileYAML, roundTrip) {
+ std::string intermediate;
+ {
+ NormalizedFile f;
+ f.arch = lld::MachOLinkingContext::arch_x86_64;
+ f.fileType = llvm::MachO::MH_OBJECT;
+ f.flags = llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS;
+ f.os = lld::MachOLinkingContext::OS::macOSX;
+ toYAML(f, intermediate);
+ }
+ {
+ std::unique_ptr<NormalizedFile> f2 = fromYAML(intermediate);
+ EXPECT_EQ(f2->arch, lld::MachOLinkingContext::arch_x86_64);
+ EXPECT_EQ((int)(f2->fileType), llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f2->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_TRUE(f2->sections.empty());
+ EXPECT_TRUE(f2->localSymbols.empty());
+ EXPECT_TRUE(f2->globalSymbols.empty());
+ EXPECT_TRUE(f2->undefinedSymbols.empty());
+ }
+}
+
+
+TEST(ObjectFileYAML, oneSymbol) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: x86_64\n"
+ "file-type: MH_OBJECT\n"
+ "global-symbols:\n"
+ " - name: _main\n"
+ " type: N_SECT\n"
+ " scope: [ N_EXT ]\n"
+ " sect: 1\n"
+ " desc: [ ]\n"
+ " value: 0x100\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_TRUE(f->sections.empty());
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+ EXPECT_EQ(f->globalSymbols.size(), 1UL);
+ const Symbol& sym = f->globalSymbols[0];
+ EXPECT_TRUE(sym.name.equals("_main"));
+ EXPECT_EQ((int)(sym.type), llvm::MachO::N_SECT);
+ EXPECT_EQ((int)(sym.scope), llvm::MachO::N_EXT);
+ EXPECT_EQ(sym.sect, 1);
+ EXPECT_EQ((int)(sym.desc), 0);
+ EXPECT_EQ((uint64_t)sym.value, 0x100ULL);
+}
+
+
+TEST(ObjectFileYAML, oneSection) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: x86_64\n"
+ "file-type: MH_OBJECT\n"
+ "sections:\n"
+ " - segment: __TEXT\n"
+ " section: __text\n"
+ " type: S_REGULAR\n"
+ " attributes: [ S_ATTR_PURE_INSTRUCTIONS ]\n"
+ " alignment: 1\n"
+ " address: 0x12345678\n"
+ " content: [ 0x90, 0x90 ]\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_TRUE(f->localSymbols.empty());
+ EXPECT_TRUE(f->globalSymbols.empty());
+ EXPECT_TRUE(f->undefinedSymbols.empty());
+ EXPECT_EQ(f->sections.size(), 1UL);
+ const Section& sect = f->sections[0];
+ EXPECT_TRUE(sect.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(sect.sectionName.equals("__text"));
+ EXPECT_EQ((uint32_t)(sect.type), (uint32_t)(llvm::MachO::S_REGULAR));
+ EXPECT_EQ((uint32_t)(sect.attributes),
+ (uint32_t)(llvm::MachO::S_ATTR_PURE_INSTRUCTIONS));
+ EXPECT_EQ(sect.alignment, 1U);
+ EXPECT_EQ((uint64_t)sect.address, 0x12345678ULL);
+ EXPECT_EQ(sect.content.size(), 2UL);
+ EXPECT_EQ((int)(sect.content[0]), 0x90);
+ EXPECT_EQ((int)(sect.content[1]), 0x90);
+}
+
+
+TEST(ObjectFileYAML, hello_x86_64) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: x86_64\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "sections:\n"
+ " - segment: __TEXT\n"
+ " section: __text\n"
+ " type: S_REGULAR\n"
+ " attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS]\n"
+ " alignment: 0\n"
+ " address: 0x0000\n"
+ " content: [ 0x55, 0x48, 0x89, 0xe5, 0x48, 0x8d, 0x3d, 0x00,\n"
+ " 0x00, 0x00, 0x00, 0x30, 0xc0, 0xe8, 0x00, 0x00,\n"
+ " 0x00, 0x00, 0x31, 0xc0, 0x5d, 0xc3 ]\n"
+ " relocations:\n"
+ " - offset: 0x0e\n"
+ " type: X86_64_RELOC_BRANCH\n"
+ " length: 2\n"
+ " pc-rel: true\n"
+ " extern: true\n"
+ " symbol: 2\n"
+ " - offset: 0x07\n"
+ " type: X86_64_RELOC_SIGNED\n"
+ " length: 2\n"
+ " pc-rel: true\n"
+ " extern: true\n"
+ " symbol: 1\n"
+ " - segment: __TEXT\n"
+ " section: __cstring\n"
+ " type: S_CSTRING_LITERALS\n"
+ " attributes: [ ]\n"
+ " alignment: 0\n"
+ " address: 0x0016\n"
+ " content: [ 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a, 0x00 ]\n"
+ "global-symbols:\n"
+ " - name: _main\n"
+ " type: N_SECT\n"
+ " scope: [ N_EXT ]\n"
+ " sect: 1\n"
+ " value: 0x0\n"
+ "local-symbols:\n"
+ " - name: L_.str\n"
+ " type: N_SECT\n"
+ " scope: [ ]\n"
+ " sect: 2\n"
+ " value: 0x16\n"
+ "undefined-symbols:\n"
+ " - name: _printf\n"
+ " type: N_UNDF\n"
+ " value: 0x0\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86_64);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_EQ(f->sections.size(), 2UL);
+
+ const Section& sect1 = f->sections[0];
+ EXPECT_TRUE(sect1.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(sect1.sectionName.equals("__text"));
+ EXPECT_EQ((uint32_t)(sect1.type), (uint32_t)(llvm::MachO::S_REGULAR));
+ EXPECT_EQ((uint32_t)(sect1.attributes),
+ (uint32_t)(llvm::MachO::S_ATTR_PURE_INSTRUCTIONS
+ | llvm::MachO::S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(sect1.alignment, 0U);
+ EXPECT_EQ((uint64_t)sect1.address, 0x0ULL);
+ EXPECT_EQ(sect1.content.size(), 22UL);
+ EXPECT_EQ((int)(sect1.content[0]), 0x55);
+ EXPECT_EQ((int)(sect1.content[1]), 0x48);
+ EXPECT_EQ(sect1.relocations.size(), 2UL);
+ const Relocation& reloc1 = sect1.relocations[0];
+ EXPECT_EQ(reloc1.offset, 0x0eU);
+ EXPECT_FALSE(reloc1.scattered);
+ EXPECT_EQ((int)reloc1.type, (int)llvm::MachO::X86_64_RELOC_BRANCH);
+ EXPECT_EQ(reloc1.length, 2);
+ EXPECT_TRUE(reloc1.pcRel);
+ EXPECT_TRUE(reloc1.isExtern);
+ EXPECT_EQ(reloc1.symbol, 2U);
+ EXPECT_EQ((int)(reloc1.value), 0);
+ const Relocation& reloc2 = sect1.relocations[1];
+ EXPECT_EQ(reloc2.offset, 0x07U);
+ EXPECT_FALSE(reloc2.scattered);
+ EXPECT_EQ((int)reloc2.type, (int)llvm::MachO::X86_64_RELOC_SIGNED);
+ EXPECT_EQ(reloc2.length, 2);
+ EXPECT_TRUE(reloc2.pcRel);
+ EXPECT_TRUE(reloc2.isExtern);
+ EXPECT_EQ(reloc2.symbol, 1U);
+ EXPECT_EQ((int)(reloc2.value), 0);
+
+ const Section& sect2 = f->sections[1];
+ EXPECT_TRUE(sect2.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(sect2.sectionName.equals("__cstring"));
+ EXPECT_EQ((uint32_t)(sect2.type), (uint32_t)(llvm::MachO::S_CSTRING_LITERALS));
+ EXPECT_EQ((uint32_t)(sect2.attributes), 0U);
+ EXPECT_EQ(sect2.alignment, 0U);
+ EXPECT_EQ((uint64_t)sect2.address, 0x016ULL);
+ EXPECT_EQ(sect2.content.size(), 7UL);
+ EXPECT_EQ((int)(sect2.content[0]), 0x68);
+ EXPECT_EQ((int)(sect2.content[1]), 0x65);
+ EXPECT_EQ((int)(sect2.content[2]), 0x6c);
+
+ EXPECT_EQ(f->globalSymbols.size(), 1UL);
+ const Symbol& sym1 = f->globalSymbols[0];
+ EXPECT_TRUE(sym1.name.equals("_main"));
+ EXPECT_EQ((int)(sym1.type), llvm::MachO::N_SECT);
+ EXPECT_EQ((int)(sym1.scope), llvm::MachO::N_EXT);
+ EXPECT_EQ(sym1.sect, 1);
+ EXPECT_EQ((int)(sym1.desc), 0);
+ EXPECT_EQ((uint64_t)sym1.value, 0x0ULL);
+ EXPECT_EQ(f->localSymbols.size(), 1UL);
+ const Symbol& sym2 = f->localSymbols[0];
+ EXPECT_TRUE(sym2.name.equals("L_.str"));
+ EXPECT_EQ((int)(sym2.type), llvm::MachO::N_SECT);
+ EXPECT_EQ((int)(sym2.scope), 0);
+ EXPECT_EQ(sym2.sect, 2);
+ EXPECT_EQ((int)(sym2.desc), 0);
+ EXPECT_EQ((uint64_t)sym2.value, 0x16ULL);
+ EXPECT_EQ(f->undefinedSymbols.size(), 1UL);
+ const Symbol& sym3 = f->undefinedSymbols[0];
+ EXPECT_TRUE(sym3.name.equals("_printf"));
+ EXPECT_EQ((int)(sym3.type), llvm::MachO::N_UNDF);
+ EXPECT_EQ((int)(sym3.scope), 0);
+ EXPECT_EQ(sym3.sect, 0);
+ EXPECT_EQ((int)(sym3.desc), 0);
+ EXPECT_EQ((uint64_t)sym3.value, 0x0ULL);
+}
+
+
+TEST(ObjectFileYAML, hello_x86) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: x86\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "sections:\n"
+ " - segment: __TEXT\n"
+ " section: __text\n"
+ " type: S_REGULAR\n"
+ " attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS]\n"
+ " alignment: 0\n"
+ " address: 0x0000\n"
+ " content: [ 0x55, 0x89, 0xe5, 0x83, 0xec, 0x08, 0xe8, 0x00,\n"
+ " 0x00, 0x00, 0x00, 0x58, 0x8d, 0x80, 0x16, 0x00,\n"
+ " 0x00, 0x00, 0x89, 0x04, 0x24, 0xe8, 0xe6, 0xff,\n"
+ " 0xff, 0xff, 0x31, 0xc0, 0x83, 0xc4, 0x08, 0x5d,\n"
+ " 0xc3 ]\n"
+ " relocations:\n"
+ " - offset: 0x16\n"
+ " type: GENERIC_RELOC_VANILLA\n"
+ " length: 2\n"
+ " pc-rel: true\n"
+ " extern: true\n"
+ " symbol: 1\n"
+ " - offset: 0x0e\n"
+ " scattered: true\n"
+ " type: GENERIC_RELOC_LOCAL_SECTDIFF\n"
+ " length: 2\n"
+ " pc-rel: false\n"
+ " value: 0x21\n"
+ " - offset: 0x0\n"
+ " scattered: true\n"
+ " type: GENERIC_RELOC_PAIR\n"
+ " length: 2\n"
+ " pc-rel: false\n"
+ " value: 0xb\n"
+ " - segment: __TEXT\n"
+ " section: __cstring\n"
+ " type: S_CSTRING_LITERALS\n"
+ " attributes: [ ]\n"
+ " alignment: 0\n"
+ " address: 0x0021\n"
+ " content: [ 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a, 0x00 ]\n"
+ "global-symbols:\n"
+ " - name: _main\n"
+ " type: N_SECT\n"
+ " scope: [ N_EXT ]\n"
+ " sect: 1\n"
+ " value: 0x0\n"
+ "undefined-symbols:\n"
+ " - name: _printf\n"
+ " type: N_UNDF\n"
+ " value: 0x0\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_x86);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_EQ(f->sections.size(), 2UL);
+
+ const Section& sect1 = f->sections[0];
+ EXPECT_TRUE(sect1.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(sect1.sectionName.equals("__text"));
+ EXPECT_EQ((uint32_t)(sect1.type), (uint32_t)(llvm::MachO::S_REGULAR));
+ EXPECT_EQ((uint32_t)(sect1.attributes),
+ (uint32_t)(llvm::MachO::S_ATTR_PURE_INSTRUCTIONS
+ | llvm::MachO::S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(sect1.alignment, 0U);
+ EXPECT_EQ((uint64_t)sect1.address, 0x0ULL);
+ EXPECT_EQ(sect1.content.size(), 33UL);
+ EXPECT_EQ((int)(sect1.content[0]), 0x55);
+ EXPECT_EQ((int)(sect1.content[1]), 0x89);
+ EXPECT_EQ(sect1.relocations.size(), 3UL);
+ const Relocation& reloc1 = sect1.relocations[0];
+ EXPECT_EQ(reloc1.offset, 0x16U);
+ EXPECT_FALSE(reloc1.scattered);
+ EXPECT_EQ((int)reloc1.type, (int)llvm::MachO::GENERIC_RELOC_VANILLA);
+ EXPECT_EQ(reloc1.length, 2);
+ EXPECT_TRUE(reloc1.pcRel);
+ EXPECT_TRUE(reloc1.isExtern);
+ EXPECT_EQ(reloc1.symbol, 1U);
+ EXPECT_EQ((int)(reloc1.value), 0);
+ const Relocation& reloc2 = sect1.relocations[1];
+ EXPECT_EQ(reloc2.offset, 0x0eU);
+ EXPECT_TRUE(reloc2.scattered);
+ EXPECT_EQ((int)reloc2.type, (int)llvm::MachO::GENERIC_RELOC_LOCAL_SECTDIFF);
+ EXPECT_EQ(reloc2.length, 2);
+ EXPECT_FALSE(reloc2.pcRel);
+ EXPECT_EQ(reloc2.symbol, 0U);
+ EXPECT_EQ((int)(reloc2.value), 0x21);
+ const Relocation& reloc3 = sect1.relocations[2];
+ EXPECT_EQ(reloc3.offset, 0U);
+ EXPECT_TRUE(reloc3.scattered);
+ EXPECT_EQ((int)reloc3.type, (int)llvm::MachO::GENERIC_RELOC_PAIR);
+ EXPECT_EQ(reloc3.length, 2);
+ EXPECT_FALSE(reloc3.pcRel);
+ EXPECT_EQ(reloc3.symbol, 0U);
+ EXPECT_EQ((int)(reloc3.value), 0xb);
+
+ const Section& sect2 = f->sections[1];
+ EXPECT_TRUE(sect2.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(sect2.sectionName.equals("__cstring"));
+ EXPECT_EQ((uint32_t)(sect2.type), (uint32_t)(llvm::MachO::S_CSTRING_LITERALS));
+ EXPECT_EQ((uint32_t)(sect2.attributes), 0U);
+ EXPECT_EQ(sect2.alignment, 0U);
+ EXPECT_EQ((uint64_t)sect2.address, 0x021ULL);
+ EXPECT_EQ(sect2.content.size(), 7UL);
+ EXPECT_EQ((int)(sect2.content[0]), 0x68);
+ EXPECT_EQ((int)(sect2.content[1]), 0x65);
+ EXPECT_EQ((int)(sect2.content[2]), 0x6c);
+
+ EXPECT_EQ(f->globalSymbols.size(), 1UL);
+ const Symbol& sym1 = f->globalSymbols[0];
+ EXPECT_TRUE(sym1.name.equals("_main"));
+ EXPECT_EQ((int)(sym1.type), llvm::MachO::N_SECT);
+ EXPECT_EQ((int)(sym1.scope), llvm::MachO::N_EXT);
+ EXPECT_EQ(sym1.sect, 1);
+ EXPECT_EQ((int)(sym1.desc), 0);
+ EXPECT_EQ((uint64_t)sym1.value, 0x0ULL);
+ EXPECT_EQ(f->undefinedSymbols.size(), 1UL);
+ const Symbol& sym2 = f->undefinedSymbols[0];
+ EXPECT_TRUE(sym2.name.equals("_printf"));
+ EXPECT_EQ((int)(sym2.type), llvm::MachO::N_UNDF);
+ EXPECT_EQ((int)(sym2.scope), 0);
+ EXPECT_EQ(sym2.sect, 0);
+ EXPECT_EQ((int)(sym2.desc), 0);
+ EXPECT_EQ((uint64_t)sym2.value, 0x0ULL);
+}
+
+TEST(ObjectFileYAML, hello_armv6) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: armv6\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "sections:\n"
+ " - segment: __TEXT\n"
+ " section: __text\n"
+ " type: S_REGULAR\n"
+ " attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS]\n"
+ " alignment: 2\n"
+ " address: 0x0000\n"
+ " content: [ 0x80, 0x40, 0x2d, 0xe9, 0x10, 0x00, 0x9f, 0xe5,\n"
+ " 0x0d, 0x70, 0xa0, 0xe1, 0x00, 0x00, 0x8f, 0xe0,\n"
+ " 0xfa, 0xff, 0xff, 0xeb, 0x00, 0x00, 0xa0, 0xe3,\n"
+ " 0x80, 0x80, 0xbd, 0xe8, 0x0c, 0x00, 0x00, 0x00 ]\n"
+ " relocations:\n"
+ " - offset: 0x1c\n"
+ " scattered: true\n"
+ " type: ARM_RELOC_SECTDIFF\n"
+ " length: 2\n"
+ " pc-rel: false\n"
+ " value: 0x20\n"
+ " - offset: 0x0\n"
+ " scattered: true\n"
+ " type: ARM_RELOC_PAIR\n"
+ " length: 2\n"
+ " pc-rel: false\n"
+ " value: 0xc\n"
+ " - offset: 0x10\n"
+ " type: ARM_RELOC_BR24\n"
+ " length: 2\n"
+ " pc-rel: true\n"
+ " extern: true\n"
+ " symbol: 1\n"
+ " - segment: __TEXT\n"
+ " section: __cstring\n"
+ " type: S_CSTRING_LITERALS\n"
+ " attributes: [ ]\n"
+ " alignment: 0\n"
+ " address: 0x0020\n"
+ " content: [ 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a, 0x00 ]\n"
+ "global-symbols:\n"
+ " - name: _main\n"
+ " type: N_SECT\n"
+ " scope: [ N_EXT ]\n"
+ " sect: 1\n"
+ " value: 0x0\n"
+ "undefined-symbols:\n"
+ " - name: _printf\n"
+ " type: N_UNDF\n"
+ " value: 0x0\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv6);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_EQ(f->sections.size(), 2UL);
+
+ const Section& sect1 = f->sections[0];
+ EXPECT_TRUE(sect1.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(sect1.sectionName.equals("__text"));
+ EXPECT_EQ((uint32_t)(sect1.type), (uint32_t)(llvm::MachO::S_REGULAR));
+ EXPECT_EQ((uint32_t)(sect1.attributes),
+ (uint32_t)(llvm::MachO::S_ATTR_PURE_INSTRUCTIONS
+ | llvm::MachO::S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(sect1.alignment, 2U);
+ EXPECT_EQ((uint64_t)sect1.address, 0x0ULL);
+ EXPECT_EQ(sect1.content.size(), 32UL);
+ EXPECT_EQ((int)(sect1.content[0]), 0x80);
+ EXPECT_EQ((int)(sect1.content[1]), 0x40);
+ EXPECT_EQ(sect1.relocations.size(), 3UL);
+ const Relocation& reloc1 = sect1.relocations[0];
+ EXPECT_EQ(reloc1.offset, 0x1cU);
+ EXPECT_TRUE(reloc1.scattered);
+ EXPECT_EQ((int)reloc1.type, (int)llvm::MachO::ARM_RELOC_SECTDIFF);
+ EXPECT_EQ(reloc1.length, 2);
+ EXPECT_FALSE(reloc1.pcRel);
+ EXPECT_EQ(reloc1.symbol, 0U);
+ EXPECT_EQ((int)(reloc1.value), 0x20);
+ const Relocation& reloc2 = sect1.relocations[1];
+ EXPECT_EQ(reloc2.offset, 0x0U);
+ EXPECT_TRUE(reloc2.scattered);
+ EXPECT_EQ((int)reloc2.type, (int)llvm::MachO::ARM_RELOC_PAIR);
+ EXPECT_EQ(reloc2.length, 2);
+ EXPECT_FALSE(reloc2.pcRel);
+ EXPECT_EQ(reloc2.symbol, 0U);
+ EXPECT_EQ((int)(reloc2.value), 0xc);
+ const Relocation& reloc3 = sect1.relocations[2];
+ EXPECT_EQ(reloc3.offset, 0x10U);
+ EXPECT_FALSE(reloc3.scattered);
+ EXPECT_EQ((int)reloc3.type, (int)llvm::MachO::ARM_RELOC_BR24);
+ EXPECT_EQ(reloc3.length, 2);
+ EXPECT_TRUE(reloc3.pcRel);
+ EXPECT_TRUE(reloc3.isExtern);
+ EXPECT_EQ(reloc3.symbol, 1U);
+ EXPECT_EQ((int)(reloc3.value), 0);
+
+ const Section& sect2 = f->sections[1];
+ EXPECT_TRUE(sect2.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(sect2.sectionName.equals("__cstring"));
+ EXPECT_EQ((uint32_t)(sect2.type), (uint32_t)(llvm::MachO::S_CSTRING_LITERALS));
+ EXPECT_EQ((uint32_t)(sect2.attributes), 0U);
+ EXPECT_EQ(sect2.alignment, 0U);
+ EXPECT_EQ((uint64_t)sect2.address, 0x020ULL);
+ EXPECT_EQ(sect2.content.size(), 7UL);
+ EXPECT_EQ((int)(sect2.content[0]), 0x68);
+ EXPECT_EQ((int)(sect2.content[1]), 0x65);
+ EXPECT_EQ((int)(sect2.content[2]), 0x6c);
+
+ EXPECT_EQ(f->globalSymbols.size(), 1UL);
+ const Symbol& sym1 = f->globalSymbols[0];
+ EXPECT_TRUE(sym1.name.equals("_main"));
+ EXPECT_EQ((int)(sym1.type), llvm::MachO::N_SECT);
+ EXPECT_EQ((int)(sym1.scope), llvm::MachO::N_EXT);
+ EXPECT_EQ(sym1.sect, 1);
+ EXPECT_EQ((int)(sym1.desc), 0);
+ EXPECT_EQ((uint64_t)sym1.value, 0x0ULL);
+ EXPECT_EQ(f->undefinedSymbols.size(), 1UL);
+ const Symbol& sym2 = f->undefinedSymbols[0];
+ EXPECT_TRUE(sym2.name.equals("_printf"));
+ EXPECT_EQ((int)(sym2.type), llvm::MachO::N_UNDF);
+ EXPECT_EQ((int)(sym2.scope), 0);
+ EXPECT_EQ(sym2.sect, 0);
+ EXPECT_EQ((int)(sym2.desc), 0);
+ EXPECT_EQ((uint64_t)sym2.value, 0x0ULL);
+}
+
+
+
+TEST(ObjectFileYAML, hello_armv7) {
+ std::unique_ptr<NormalizedFile> f = fromYAML(
+ "---\n"
+ "arch: armv7\n"
+ "file-type: MH_OBJECT\n"
+ "flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]\n"
+ "sections:\n"
+ " - segment: __TEXT\n"
+ " section: __text\n"
+ " type: S_REGULAR\n"
+ " attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS]\n"
+ " alignment: 1\n"
+ " address: 0x0000\n"
+ " content: [ 0x80, 0xb5, 0x40, 0xf2, 0x06, 0x00, 0x6f, 0x46,\n"
+ " 0xc0, 0xf2, 0x00, 0x00, 0x78, 0x44, 0xff, 0xf7,\n"
+ " 0xf8, 0xef, 0x00, 0x20, 0x80, 0xbd ]\n"
+ " relocations:\n"
+ " - offset: 0x0e\n"
+ " type: ARM_THUMB_RELOC_BR22\n"
+ " length: 2\n"
+ " pc-rel: true\n"
+ " extern: true\n"
+ " symbol: 1\n"
+ " - offset: 0x08\n"
+ " scattered: true\n"
+ " type: ARM_RELOC_HALF_SECTDIFF\n"
+ " length: 3\n"
+ " pc-rel: false\n"
+ " value: 0x16\n"
+ " - offset: 0x06\n"
+ " scattered: true\n"
+ " type: ARM_RELOC_PAIR\n"
+ " length: 3\n"
+ " pc-rel: false\n"
+ " value: 0xc\n"
+ " - offset: 0x02\n"
+ " scattered: true\n"
+ " type: ARM_RELOC_HALF_SECTDIFF\n"
+ " length: 2\n"
+ " pc-rel: false\n"
+ " value: 0x16\n"
+ " - offset: 0x0\n"
+ " scattered: true\n"
+ " type: ARM_RELOC_PAIR\n"
+ " length: 2\n"
+ " pc-rel: false\n"
+ " value: 0xc\n"
+ " - segment: __TEXT\n"
+ " section: __cstring\n"
+ " type: S_CSTRING_LITERALS\n"
+ " attributes: [ ]\n"
+ " alignment: 0\n"
+ " address: 0x0016\n"
+ " content: [ 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a, 0x00 ]\n"
+ "global-symbols:\n"
+ " - name: _main\n"
+ " type: N_SECT\n"
+ " scope: [ N_EXT ]\n"
+ " sect: 1\n"
+ " desc: [ N_ARM_THUMB_DEF ]\n"
+ " value: 0x0\n"
+ "undefined-symbols:\n"
+ " - name: _printf\n"
+ " type: N_UNDF\n"
+ " value: 0x0\n"
+ "...\n");
+ EXPECT_EQ(f->arch, lld::MachOLinkingContext::arch_armv7);
+ EXPECT_EQ(f->fileType, llvm::MachO::MH_OBJECT);
+ EXPECT_EQ((int)(f->flags), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS);
+ EXPECT_EQ(f->sections.size(), 2UL);
+
+ const Section& sect1 = f->sections[0];
+ EXPECT_TRUE(sect1.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(sect1.sectionName.equals("__text"));
+ EXPECT_EQ((uint32_t)(sect1.type), (uint32_t)(llvm::MachO::S_REGULAR));
+ EXPECT_EQ((uint32_t)(sect1.attributes),
+ (uint32_t)(llvm::MachO::S_ATTR_PURE_INSTRUCTIONS
+ | llvm::MachO::S_ATTR_SOME_INSTRUCTIONS));
+ EXPECT_EQ(sect1.alignment, 1U);
+ EXPECT_EQ((uint64_t)sect1.address, 0x0ULL);
+ EXPECT_EQ(sect1.content.size(), 22UL);
+ EXPECT_EQ((int)(sect1.content[0]), 0x80);
+ EXPECT_EQ((int)(sect1.content[1]), 0xb5);
+ EXPECT_EQ(sect1.relocations.size(), 5UL);
+ const Relocation& reloc1 = sect1.relocations[0];
+ EXPECT_EQ(reloc1.offset, 0x0eU);
+ EXPECT_FALSE(reloc1.scattered);
+ EXPECT_EQ((int)reloc1.type, (int)llvm::MachO::ARM_THUMB_RELOC_BR22);
+ EXPECT_EQ(reloc1.length, 2);
+ EXPECT_TRUE(reloc1.pcRel);
+ EXPECT_TRUE(reloc1.isExtern);
+ EXPECT_EQ(reloc1.symbol, 1U);
+ EXPECT_EQ((int)(reloc1.value), 0);
+ const Relocation& reloc2 = sect1.relocations[1];
+ EXPECT_EQ(reloc2.offset, 0x8U);
+ EXPECT_TRUE(reloc2.scattered);
+ EXPECT_EQ((int)reloc2.type, (int)llvm::MachO::ARM_RELOC_HALF_SECTDIFF);
+ EXPECT_EQ(reloc2.length, 3);
+ EXPECT_FALSE(reloc2.pcRel);
+ EXPECT_EQ(reloc2.symbol, 0U);
+ EXPECT_EQ((int)(reloc2.value), 0x16);
+ const Relocation& reloc3 = sect1.relocations[2];
+ EXPECT_EQ(reloc3.offset, 0x6U);
+ EXPECT_TRUE(reloc3.scattered);
+ EXPECT_EQ((int)reloc3.type, (int)llvm::MachO::ARM_RELOC_PAIR);
+ EXPECT_EQ(reloc3.length, 3);
+ EXPECT_FALSE(reloc3.pcRel);
+ EXPECT_EQ(reloc3.symbol, 0U);
+ EXPECT_EQ((int)(reloc3.value), 0xc);
+ const Relocation& reloc4 = sect1.relocations[3];
+ EXPECT_EQ(reloc4.offset, 0x2U);
+ EXPECT_TRUE(reloc4.scattered);
+ EXPECT_EQ((int)reloc4.type, (int)llvm::MachO::ARM_RELOC_HALF_SECTDIFF);
+ EXPECT_EQ(reloc4.length, 2);
+ EXPECT_FALSE(reloc4.pcRel);
+ EXPECT_EQ(reloc4.symbol, 0U);
+ EXPECT_EQ((int)(reloc4.value), 0x16);
+ const Relocation& reloc5 = sect1.relocations[4];
+ EXPECT_EQ(reloc5.offset, 0x0U);
+ EXPECT_TRUE(reloc5.scattered);
+ EXPECT_EQ((int)reloc5.type, (int)llvm::MachO::ARM_RELOC_PAIR);
+ EXPECT_EQ(reloc5.length, 2);
+ EXPECT_FALSE(reloc5.pcRel);
+ EXPECT_EQ(reloc5.symbol, 0U);
+ EXPECT_EQ((int)(reloc5.value), 0xc);
+
+ const Section& sect2 = f->sections[1];
+ EXPECT_TRUE(sect2.segmentName.equals("__TEXT"));
+ EXPECT_TRUE(sect2.sectionName.equals("__cstring"));
+ EXPECT_EQ((uint32_t)(sect2.type), (uint32_t)(llvm::MachO::S_CSTRING_LITERALS));
+ EXPECT_EQ((uint32_t)(sect2.attributes), 0U);
+ EXPECT_EQ(sect2.alignment, 0U);
+ EXPECT_EQ((uint64_t)sect2.address, 0x016ULL);
+ EXPECT_EQ(sect2.content.size(), 7UL);
+ EXPECT_EQ((int)(sect2.content[0]), 0x68);
+ EXPECT_EQ((int)(sect2.content[1]), 0x65);
+ EXPECT_EQ((int)(sect2.content[2]), 0x6c);
+
+ EXPECT_EQ(f->globalSymbols.size(), 1UL);
+ const Symbol& sym1 = f->globalSymbols[0];
+ EXPECT_TRUE(sym1.name.equals("_main"));
+ EXPECT_EQ((int)(sym1.type), llvm::MachO::N_SECT);
+ EXPECT_EQ((int)(sym1.scope), llvm::MachO::N_EXT);
+ EXPECT_EQ(sym1.sect, 1);
+ EXPECT_EQ((int)(sym1.desc), (int)(llvm::MachO::N_ARM_THUMB_DEF));
+ EXPECT_EQ((uint64_t)sym1.value, 0x0ULL);
+ EXPECT_EQ(f->undefinedSymbols.size(), 1UL);
+ const Symbol& sym2 = f->undefinedSymbols[0];
+ EXPECT_TRUE(sym2.name.equals("_printf"));
+ EXPECT_EQ((int)(sym2.type), llvm::MachO::N_UNDF);
+ EXPECT_EQ((int)(sym2.scope), 0);
+ EXPECT_EQ(sym2.sect, 0);
+ EXPECT_EQ((int)(sym2.desc), 0);
+ EXPECT_EQ((uint64_t)sym2.value, 0x0ULL);
+}
diff --git a/unittests/MachOTests/empty_obj_x86_armv7.txt b/unittests/MachOTests/empty_obj_x86_armv7.txt
new file mode 100644
index 000000000000..9d340cb7132e
--- /dev/null
+++ b/unittests/MachOTests/empty_obj_x86_armv7.txt
@@ -0,0 +1,1272 @@
+0xca, 0xfe, 0xba, 0xbe, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x07, 0x00,
+0x00, 0x00, 0x03, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00,
+0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x40,
+0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xcf, 0xfa, 0xed, 0xfe, 0x07, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00,
+0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x98, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00,
+0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x5f, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x5f, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xce, 0xfa, 0xed, 0xfe, 0x0c, 0x00, 0x00, 0x00, 0x09,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7c, 0x00,
+0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00,
+0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x5f, 0x74,
+0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x5f, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
diff --git a/unittests/Makefile b/unittests/Makefile
new file mode 100644
index 000000000000..0fbb17d48289
--- /dev/null
+++ b/unittests/Makefile
@@ -0,0 +1,31 @@
+##===- unittests/Makefile ----------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+# If LLD_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
+# are being included from a subdirectory makefile.
+
+ifndef LLD_LEVEL
+
+IS_UNITTEST_LEVEL := 1
+LLD_LEVEL := ..
+
+PARALLEL_DIRS = CoreTests DriverTests
+
+include $(LLD_LEVEL)/../../Makefile.config
+
+endif # LLD_LEVEL
+
+include $(LLD_LEVEL)/Makefile
+
+ifndef IS_UNITTEST_LEVEL
+
+MAKEFILE_UNITTEST_NO_INCLUDE_COMMON := 1
+include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest
+
+endif # IS_UNITTEST_LEVEL