diff options
author | Dmitriy Ivanov <dimitry@google.com> | 2015-06-12 15:00:31 -0700 |
---|---|---|
committer | Dmitriy Ivanov <dimitry@google.com> | 2015-06-12 15:09:54 -0700 |
commit | 3e6f7807541bab8157f9c26e55829fd193683349 (patch) | |
tree | f4c65e21100db8c092b22f7d034d32d1b70b8998 /linker | |
parent | ae1e75458ad281f121116c8c5dfe9d8086e43a2b (diff) | |
download | bionic-3e6f7807541bab8157f9c26e55829fd193683349.zip bionic-3e6f7807541bab8157f9c26e55829fd193683349.tar.gz bionic-3e6f7807541bab8157f9c26e55829fd193683349.tar.bz2 |
Remove text-relocs support for apps targeting M+
Remove support of text-relocations for apps targeting sdk version > 22
Bug: http://b/20013628
Change-Id: I2127739544480c747315e32df15dfbd1b79de4f5
Diffstat (limited to 'linker')
-rw-r--r-- | linker/linker.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index bbdd1b0..d1b2ad2 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -2851,6 +2851,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 " |