Remove the relocations section from the image.
This section was unused since
https://android-review.googlesource.com/771001 .
This partially reverts commits
6121aa69098e3496cf1a81bf3e5e7ae70f66eacb
ca8de0a70eab62707f3c71a211093f340fdcd5f4
and cleans up.
Prebuilt sizes for aosp_taimen-userdebug:
- before:
arm/boot*.art: 14951820
arm64/boot*.art: 19398428
oat/arm64/services.art: 526138
- after:
arm/boot*.art: 14503936 (-437KiB)
arm64/boot*.art: 18817024 (-568KiB)
oat/arm64/services.art: 499712 (-26KiB)
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Test: m test-art-target-gtest
Test: testrunner.py --target --optimizing
Bug: 77856493
Change-Id: Ib44cd00cf3944e93e2d61ca8df381993cfeff130
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index 6e6023d..9e67957 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -509,21 +509,11 @@
const size_t image_bitmap_offset = RoundUp(sizeof(ImageHeader) + image_header->GetDataSize(),
kPageSize);
const size_t end_of_bitmap = image_bitmap_offset + bitmap_section.Size();
- const ImageSection& relocations_section = image_header->GetImageRelocationsSection();
- if (relocations_section.Offset() != bitmap_section.Offset() + bitmap_section.Size()) {
+ if (end_of_bitmap != image_file_size) {
*error_msg = StringPrintf(
- "Relocations do not start immediately after bitmap: %u vs. %u + %u.",
- relocations_section.Offset(),
- bitmap_section.Offset(),
- bitmap_section.Size());
- return nullptr;
- }
- const size_t end_of_relocations = end_of_bitmap + relocations_section.Size();
- if (end_of_relocations != image_file_size) {
- *error_msg = StringPrintf(
- "Image file size does not equal end of relocations: size=%" PRIu64 " vs. %zu.",
+ "Image file size does not equal end of bitmap: size=%" PRIu64 " vs. %zu.",
image_file_size,
- end_of_relocations);
+ end_of_bitmap);
return nullptr;
}