am a8993c99: Merge "Remove text-relocs support for apps targeting M+"

* commit 'a8993c994e45ec2dc00dcef15910560e22d67be9':
  Remove text-relocs support for apps targeting M+
This commit is contained in:
Dmitriy Ivanov
2015-06-22 19:50:50 +00:00
committed by Android Git Automerger

View File

@@ -2954,6 +2954,13 @@ bool soinfo::link_image(const soinfo_list_t& global_group, const soinfo_list_t&
#if !defined(__LP64__)
if (has_text_relocations) {
// Fail if app is targeting sdk version > 22
// TODO (dimitry): remove != __ANDROID_API__ check once http://b/20020312 is fixed
if (get_application_target_sdk_version() != __ANDROID_API__
&& get_application_target_sdk_version() > 22) {
DL_ERR("%s: has text relocations", get_realpath());
return false;
}
// 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.
DL_WARN("%s has text relocations. This is wasting memory and prevents "