diff options
author | Dmitriy Ivanov <dimitry@google.com> | 2015-05-15 17:53:39 -0700 |
---|---|---|
committer | Dmitriy Ivanov <dimitry@google.com> | 2015-05-15 18:39:16 -0700 |
commit | 69a5fb951d69689dedd83cb033ae3dcd0ef05b65 (patch) | |
tree | 81540a3dd46f0a604f90993d371c207f5bf3e721 /linker | |
parent | ff407803dbbee26ab19c02aaece0e75c019534c4 (diff) | |
download | bionic-69a5fb951d69689dedd83cb033ae3dcd0ef05b65.zip bionic-69a5fb951d69689dedd83cb033ae3dcd0ef05b65.tar.gz bionic-69a5fb951d69689dedd83cb033ae3dcd0ef05b65.tar.bz2 |
Apply work around b/19059885 to x86
Bug: http://b/19059885
Bug: http://b/21203348
Change-Id: Ic375e9f877d68de8f866d17362879a7dde638465
Diffstat (limited to 'linker')
-rw-r--r-- | linker/Android.mk | 3 | ||||
-rw-r--r-- | linker/linker.cpp | 8 | ||||
-rw-r--r-- | linker/linker.h | 10 |
3 files changed, 12 insertions, 9 deletions
diff --git a/linker/Android.mk b/linker/Android.mk index 5bdc2f9..4a7da76 100644 --- a/linker/Android.mk +++ b/linker/Android.mk @@ -35,6 +35,9 @@ LOCAL_CFLAGS += \ -fvisibility=hidden \ -Wall -Wextra -Wunused -Werror \ +LOCAL_CFLAGS_arm += -D__work_around_b_19059885__ +LOCAL_CFLAGS_x86 += -D__work_around_b_19059885__ + LOCAL_CONLYFLAGS += \ -std=gnu99 \ diff --git a/linker/linker.cpp b/linker/linker.cpp index 9d796ae..f9df831 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -1544,7 +1544,7 @@ static void soinfo_unload(soinfo* root) { } } } else { -#if !defined(__arm__) +#if !defined(__work_around_b_19059885__) __libc_fatal("soinfo for \"%s\"@%p has no version", si->get_realpath(), si); #else PRINT("warning: soinfo for \"%s\"@%p has no version", si->get_realpath(), si); @@ -2270,7 +2270,7 @@ void soinfo::set_dt_flags_1(uint32_t dt_flags_1) { } const char* soinfo::get_realpath() const { -#if defined(__arm__) +#if defined(__work_around_b_19059885__) if (has_min_version(2)) { return realpath_.c_str(); } else { @@ -2282,7 +2282,7 @@ const char* soinfo::get_realpath() const { } const char* soinfo::get_soname() const { -#if defined(__arm__) +#if defined(__work_around_b_19059885__) if (has_min_version(2)) { return soname_; } else { @@ -2820,7 +2820,7 @@ bool soinfo::prelink_image() { for (ElfW(Dyn)* d = dynamic; d->d_tag != DT_NULL; ++d) { if (d->d_tag == DT_SONAME) { soname_ = get_string(d->d_un.d_val); -#if defined(__arm__) +#if defined(__work_around_b_19059885__) strlcpy(old_name_, soname_, sizeof(old_name_)); #endif break; diff --git a/linker/linker.h b/linker/linker.h index dc8c6e0..c7118ea 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -97,7 +97,7 @@ #define SOINFO_VERSION 2 -#if defined(__arm__) +#if defined(__work_around_b_19059885__) #define SOINFO_NAME_LEN 128 #endif @@ -172,7 +172,7 @@ class VersionTracker { struct soinfo { public: typedef LinkedList<soinfo, SoinfoListAllocator> soinfo_list_t; -#if defined(__arm__) +#if defined(__work_around_b_19059885__) private: char old_name_[SOINFO_NAME_LEN]; #endif @@ -183,13 +183,13 @@ struct soinfo { ElfW(Addr) base; size_t size; -#if defined(__arm__) +#if defined(__work_around_b_19059885__) uint32_t unused1; // DO NOT USE, maintained for compatibility. #endif ElfW(Dyn)* dynamic; -#if defined(__arm__) +#if defined(__work_around_b_19059885__) uint32_t unused2; // DO NOT USE, maintained for compatibility uint32_t unused3; // DO NOT USE, maintained for compatibility #endif @@ -305,7 +305,7 @@ struct soinfo { bool is_gnu_hash() const; bool inline has_min_version(uint32_t min_version __unused) const { -#if defined(__arm__) +#if defined(__work_around_b_19059885__) return (flags_ & FLAG_NEW_SOINFO) != 0 && version_ >= min_version; #else return true; |