Temporarily disable text relocation warnings for x86 libraries
Too many such warnings will cause CTS failed. This issue still exists in some x86 version libraries: libdvm.so/libart.so. $scanelf -qT out/target/product/generic_x86/system/lib/libdvm.so libdvm.so: (memory/data?) [0x2BAC7] in (optimized out: previous dvmAsmInstructionStartCode) [0x2B2F8] libdvm.so: (memory/data?) [0x2BB98] in (optimized out: previous dvmAsmInstructionStartCode) [0x2B2F8] libdvm.so: (memory/data?) [0x2EB28] in (optimized out: previous dvmAsmInstructionStartCode) [0x2B2F8] libdvm.so: (memory/data?) [0x2EF87] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] libdvm.so: (memory/data?) [0x2EFAF] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] libdvm.so: (memory/data?) [0x2EFD7] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] libdvm.so: (memory/data?) [0x2EFFF] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] libdvm.so: (memory/data?) [0x2F027] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] Bug: https://code.google.com/p/android/issues/detail?id=68431 Change-Id: I11ecac282f1163e49a82156fce2a76cc2d619960
This commit is contained in:

committed by
Elliott Hughes

parent
9b22c21cee
commit
865119efd4
@@ -1833,8 +1833,10 @@ static bool soinfo_link_image(soinfo* si) {
|
|||||||
if (si->has_text_relocations) {
|
if (si->has_text_relocations) {
|
||||||
// Make segments writable to allow text relocations to work properly. We will later call
|
// Make segments writable to allow text relocations to work properly. We will later call
|
||||||
// phdr_table_protect_segments() after all of them are applied and all constructors are run.
|
// phdr_table_protect_segments() after all of them are applied and all constructors are run.
|
||||||
|
#if !defined(__i386__) // The platform itself has too many text relocations on x86.
|
||||||
DL_WARN("%s has text relocations. This is wasting memory and prevents "
|
DL_WARN("%s has text relocations. This is wasting memory and prevents "
|
||||||
"security hardening. Please fix.", si->name);
|
"security hardening. Please fix.", si->name);
|
||||||
|
#endif
|
||||||
if (phdr_table_unprotect_segments(si->phdr, si->phnum, si->load_bias) < 0) {
|
if (phdr_table_unprotect_segments(si->phdr, si->phnum, si->load_bias) < 0) {
|
||||||
DL_ERR("can't unprotect loadable segments for \"%s\": %s",
|
DL_ERR("can't unprotect loadable segments for \"%s\": %s",
|
||||||
si->name, strerror(errno));
|
si->name, strerror(errno));
|
||||||
|
Reference in New Issue
Block a user