Commit 3856af0d authored by Alex Klyubin's avatar Alex Klyubin Committed by Chris Morin
Browse files

Reland: Enable patchoat to write image relocation files

This adds an off by default feature to patchoat whereby it can write
image relocation information (i.e., which offsets are patched up by
patchoat) to .rel files. .rel file writing is enabled by specifying
the name of boot.art.rel file using command-line parameter
--output-image-relocation-file=...

The currently intended use case is to make the Android build process
store these files on the system image next to boot*.art files. At boot
time, in follow-up commits, these .rel files will then be used to
verify that all differences between /system boot*.art and
/data/dalvik-cache boot*.art files can be explained by relocation. The
goal is to mitigate /data/dalvik-cache boot*.art being a persistence
vector.

Test: ./art/test/testrunner/run_build_test_target.py art-gtest-debug-gc
Test: make test-art-host-gtest-patchoat_test
Test: ART_HEAP_POISONING=true make test-art-host-gtest-patchoat_test
Test: make test-art-target-gtest-patchoat_test
Test: ANDROID_ROOT=out/target/product/sailfish/system \
        ANDROID_DATA=out/target/product/sailfish/dex_bootjars/system/framework/arm64/ \
        out/host/linux-x86/bin/patchoat \
        --input-image-location=<full path to>/out/target/product/sailfish/dex_bootjars/system/framework/boot.art \
        --output-image-file=out/target/product/sailfish/dex_bootjars/system/framework/arm64/boot.art \
        --instruction-set=arm64 --base-offset-delta=0x10000000
        produces same boot*.art files as prior to this change
Test: ANDROID_ROOT=out/target/product/sailfish/system \
        ANDROID_DATA=out/target/product/sailfish/dex_bootjars/system/framework/arm64/ \
        out/host/linux-x86/bin/patchoat \
        --input-image-location=<full path to>/out/target/product/sailfish/dex_bootjars/system/framework/boot.art \
        --output-image-relocation-file=out/target/product/sailfish/dex_bootjars/system/framework/arm64/boot.art.rel \
        --instruction-set=arm64 --base-offset-delta=0x10000000
        produces no boot*.art files, but produces expected boot.art.rel files
Bug: 66697305

Change-Id: Ia6b548c61429c61a62706d4021f8e6f22c49082e
parent 688a4638
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment