Add ELF alignment mismatch test

When executing 'standalone' tests that run against an on-device deployed
ART APEX (see test/README.atest.md), the test ART configuration and the
existing deployed ART configuration must be compatible for the testing
to be meaningful.

One source of incompatibility is ELF segment alignment, where the value
of the constexpr kElfSegmentAlignment in the test build must match the
ELF files that are compiled on-device. Many tests are expected to fail if
there is a mismatch, but the runtime errors could be difficult to debug.

This patch adds an ELF alignment mismatch test to clearly identify when
this incompatibility occurs, to ease debugging in the future.

The test determines the value of kElfSegmentAlignment used by the
on-device ART APEX by reading the alignment of the boot.oat file.

Bug: 333480073

As the ELF segment alignment is controlled by enabling page-agnostic
mode (kPageSizeAgnostic), tests were run on Oriole running page-agnostic
4K and 16K as well legacy constexpr 4K. Test failures were confirmed
when page-agnostic standalone tests were run against a constexpr 4K ART
APEX, and vice versa.

Test: art/tools/run-gtests.sh
Test: atest ArtGtestsTargetChroot
Test: atest art_standalone_* -- --abi arm64-v8a
Test: atest art_standalone_runtime_tests -- --abi arm64-v8a

Change-Id: I1deac98167443766686c7a2c5b6f6c33166c9530
4 files changed