am a9585aed: Merge "Temporarily disable text relocation warnings for x86 libraries"

* commit 'a9585aedbc89242b1fe8c2f9eec1212d9b206e88':
  Temporarily disable text relocation warnings for x86 libraries
This commit is contained in:
Elliott Hughes 2014-04-18 23:10:06 +00:00 committed by Android Git Automerger
commit 57a61f859d

View File

@ -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));