art patchoat
This tool takes already compiled images and oat files and changes their base address, acting as a cheap form of relocation.
Add a –include-patch-information flag to dex2oat and code to add required patch information to oat files created with the quick compiler.
https://android.googlesource.com/platform/art/+/53cb16b98acf3cf6f3a1e2204ad4958ecf1b5a3c
关闭patchoat
尽管打开了WITH_PREODEX之后,已经生成了odex文件,但是第一次开机的时候,android会去做patchoat的动作,会修改odex文件偏移量,并放到/data/dalvik-cache/arm/目录下面。这样做主要是为了安全考虑,因为ELF文件被load进系统之后,如果每一次都映射同样的位置,很容易被hack利用这一点进行攻击。如果不考虑这种安全性问题,可以把这个属性给关闭。
关闭方法如下:
/art/runtime/globals.h
static