diff options
author | Christopher R. Palmer <crpalmer@gmail.com> | 2016-02-07 06:46:05 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-03-10 10:53:19 -0800 |
commit | f6f044521265ce0161276c42ea8f87d1ab6570cf (patch) | |
tree | 809261f4c3e6ad218e974f1c94d333dec200e657 | |
parent | e31f2d8c7de0d3f38329695afc12a7a74711dd26 (diff) | |
download | bionic-f6f044521265ce0161276c42ea8f87d1ab6570cf.zip bionic-f6f044521265ce0161276c42ea8f87d1ab6570cf.tar.gz bionic-f6f044521265ce0161276c42ea8f87d1ab6570cf.tar.bz2 |
linker: Allow text-relocs for x86 (only)
This effectively reverts
https://android.googlesource.com/platform/bionic/+/e4ad91f86a47b39612e030a162f4793cb3421d31%5E%21/#F0
for x86 platforms. Unfortunately, this seems like it is required
if we are going to support ffmpeg. The ffmpeg team decreed that they
require text relocations for x86 (only) and that they would not
fix the fact that android 6.0 makes ffmpeg unusable on x86:
https://trac.ffmpeg.org/ticket/4928
Change-Id: I68397f4d62f4f6acd8e0d41b7ecdc115969b890a
-rw-r--r-- | linker/linker.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index ed2536a..bc40cf1 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -3013,12 +3013,14 @@ bool soinfo::link_image(const soinfo_list_t& global_group, const soinfo_list_t& 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 !defined(__i386__) // ffmpeg says that they require text relocations on x86 if (get_application_target_sdk_version() != __ANDROID_API__ && get_application_target_sdk_version() > 22) { PRINT("%s: has text relocations", get_realpath()); DL_ERR("%s: has text relocations", get_realpath()); return false; } +#endif // 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 " |