diff options
Diffstat (limited to 'linker/linker.h')
-rw-r--r-- | linker/linker.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/linker/linker.h b/linker/linker.h index dae3972..023b672 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 @@ -247,7 +247,9 @@ struct soinfo { uint32_t mips_symtabno_; uint32_t mips_local_gotno_; uint32_t mips_gotsym_; - bool mips_relocate_got(const soinfo_list_t& global_group, const soinfo_list_t& local_group); + bool mips_relocate_got(const VersionTracker& version_tracker, + const soinfo_list_t& global_group, + const soinfo_list_t& local_group); #endif size_t ref_count_; @@ -303,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; @@ -332,17 +334,22 @@ struct soinfo { bool find_verdef_version_index(const version_info* vi, ElfW(Versym)* versym) const; + uint32_t get_target_sdk_version() const; + private: bool elf_lookup(SymbolName& symbol_name, const version_info* vi, uint32_t* symbol_index) const; ElfW(Sym)* elf_addr_lookup(const void* addr); bool gnu_lookup(SymbolName& symbol_name, const version_info* vi, uint32_t* symbol_index) const; ElfW(Sym)* gnu_addr_lookup(const void* addr); + bool lookup_version_info(const VersionTracker& version_tracker, ElfW(Word) sym, + const char* sym_name, const version_info** vi); + void call_array(const char* array_name, linker_function_t* functions, size_t count, bool reverse); void call_function(const char* function_name, linker_function_t function); template<typename ElfRelIteratorT> - bool relocate(ElfRelIteratorT&& rel_iterator, const soinfo_list_t& global_group, - const soinfo_list_t& local_group); + bool relocate(const VersionTracker& version_tracker, ElfRelIteratorT&& rel_iterator, + const soinfo_list_t& global_group, const soinfo_list_t& local_group); private: // This part of the structure is only available @@ -388,6 +395,8 @@ struct soinfo { ElfW(Addr) verneed_ptr_; size_t verneed_cnt_; + uint32_t target_sdk_version_; + friend soinfo* get_libdl_info(); }; @@ -412,6 +421,8 @@ void do_android_update_LD_LIBRARY_PATH(const char* ld_library_path); soinfo* do_dlopen(const char* name, int flags, const android_dlextinfo* extinfo); void do_dlclose(soinfo* si); +int do_dl_iterate_phdr(int (*cb)(dl_phdr_info* info, size_t size, void* data), void* data); + const ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* caller, void* handle); soinfo* find_containing_library(const void* addr); @@ -424,4 +435,7 @@ extern "C" void notify_gdb_of_libraries(); char* linker_get_error_buffer(); size_t linker_get_error_buffer_size(); +void set_application_target_sdk_version(uint32_t target); +uint32_t get_application_target_sdk_version(); + #endif |