Use mmapped boot image intern table for PIC app HLoadString.

Implement new HLoadString load kind for boot image strings
referenced by PIC-compiled apps (i.e. prebuilts) that uses
PC-relative load from a boot image InternTable mmapped into
the apps .bss. This reduces the size of the PIC prebuilts
that reference boot image strings compared to the kBssEntry
as we can completely avoid the slow path and stack map.

We separate the InternedStrings and ClassTable sections of
the boot image (.art) file from the rest, aligning the
start of the InternedStrings section to a page boundary.
This may actually increase the size of the boot image file
by a page but it also allows mprotecting() these tables as
read-only. The ClassTable section is included in
anticipation of a similar load kind for HLoadClass.

Prebuilt services.odex for aosp_angler-userdebug (arm64):
  - before: 20862776
  - after: 20308512 (-541KiB)
Note that 92KiB savings could have been achieved by simply
avoiding the read barrier, similar to the HLoadClass flag
IsInBootImage(). Such flag is now unnecessary.

Test: m test-art-host-gtest
Test: testrunner.py --host
Test: testrunner.py --host --pictest
Test: testrunner.py --target on Nexus 6P.
Test: testrunner.py --target --pictest on Nexus 6P.
Test: Nexus 6P boots.
Bug: 31951624
Change-Id: I5f2bf1fc0bb36a8483244317cfdfa69e192ef6c5
diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc
index e10b171..5bf3513 100644
--- a/dex2oat/dex2oat_test.cc
+++ b/dex2oat/dex2oat_test.cc
@@ -706,7 +706,7 @@
     }
   }
 
-  uint64_t GetImageSize(const std::string& image_file_name) {
+  uint64_t GetImageObjectSectionSize(const std::string& image_file_name) {
     EXPECT_FALSE(image_file_name.empty());
     std::unique_ptr<File> file(OS::OpenFileForReading(image_file_name.c_str()));
     CHECK(file != nullptr);
@@ -715,7 +715,7 @@
     CHECK(success);
     CHECK(image_header.IsValid());
     ReaderMutexLock mu(Thread::Current(), *Locks::mutator_lock_);
-    return image_header.GetImageSize();
+    return image_header.GetObjectsSection().Size();
   }
 
   void RunTest(bool app_image) {
@@ -734,7 +734,7 @@
       CheckValidity();
       ASSERT_TRUE(success_);
       // Don't check the result since CheckResult relies on the class being in the profile.
-      image_file_empty_profile = GetImageSize(app_image_file);
+      image_file_empty_profile = GetImageObjectSectionSize(app_image_file);
       EXPECT_GT(image_file_empty_profile, 0u);
     }
 
@@ -750,8 +750,8 @@
 
     if (app_image) {
       // Test that the profile made a difference by adding more classes.
-      const uint64_t image_file_small_profile = GetImageSize(app_image_file);
-      CHECK_LT(image_file_empty_profile, image_file_small_profile);
+      const uint64_t image_file_small_profile = GetImageObjectSectionSize(app_image_file);
+      ASSERT_LT(image_file_empty_profile, image_file_small_profile);
     }
   }