Reinstate the x86 dynamic linker warning for text relocations.

Bug: 11358761
Change-Id: I4fc56ce7d76c9703a307ddd4d371d5e98bc6f51d
This commit is contained in:
Elliott Hughes 2014-06-30 14:46:53 -07:00
parent eac2bbf0fc
commit aa836f7310

View File

@ -1929,10 +1929,8 @@ static bool soinfo_link_image(soinfo* si, const android_dlextinfo* extinfo) {
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));