Lines Matching refs:soinfo
82 static LinkerTypeAllocator<soinfo> g_soinfo_allocator;
83 static LinkerTypeAllocator<LinkedListEntry<soinfo>> g_soinfo_links_allocator;
186 static bool is_greylisted(android_namespace_t* ns, const char* name, const soinfo* needed_by) {
294 static void notify_gdb_of_load(soinfo* info) {
313 static void notify_gdb_of_unload(soinfo* info) {
317 LinkedListEntry<soinfo>* SoinfoListAllocator::alloc() {
321 void SoinfoListAllocator::free(LinkedListEntry<soinfo>* entry) {
333 soinfo* soinfo_alloc(android_namespace_t* ns, const char* name,
340 TRACE("name %s: allocating soinfo for ns=%p", name, ns);
342 soinfo* si = new (g_soinfo_allocator.alloc()) soinfo(ns, name, file_stat,
350 TRACE("name %s: allocated soinfo @ %p", name, si);
354 static void soinfo_free(soinfo* si) {
369 TRACE("name %s: freeing soinfo @ %p", si->get_realpath(), si);
372 async_safe_fatal("soinfo=%p is not in soinfo_list (double unload?)", si);
378 si->~soinfo();
418 if (soinfo* si = find_containing_library(reinterpret_cast<void*>(pc))) {
432 for (soinfo* si = solist_get_head(); si != nullptr; si = si->next) {
447 bool soinfo_do_lookup(soinfo* si_from, const char* name, const version_info* vi,
448 soinfo** si_found_in, const soinfo_list_t& global_group,
478 global_group.visit([&](soinfo* global_si) {
502 local_group.visit([&](soinfo* local_si) {
616 soinfo* needed_by,
618 std::unordered_map<const soinfo*, ElfReader>* readers_map) {
627 soinfo* get_needed_by() const {
631 soinfo* get_soinfo() const {
635 void set_soinfo(soinfo* si) {
690 std::unordered_map<const soinfo*, ElfReader>* get_readers_map() {
717 soinfo* needed_by,
719 std::unordered_map<const soinfo*, ElfReader>* readers_map)
731 soinfo* needed_by_;
732 soinfo* si_;
737 std::unordered_map<const soinfo*, ElfReader>* elf_readers_map_;
751 typedef linked_list_t<soinfo> SoinfoLinkedList;
761 // This function walks down the tree of soinfo dependencies
763 // * calls action(soinfo* si) for each node, and
771 static bool walk_dependencies_tree(soinfo* root_soinfo, F action) {
777 soinfo* si;
792 si->get_children().for_each([&](soinfo* child) {
803 soinfo* root,
804 soinfo* skip_until,
805 soinfo** found,
811 walk_dependencies_tree(root, [&](soinfo* current_soinfo) {
840 soinfo** found,
841 soinfo* caller,
845 // specified soinfo object and its dependencies in breadth first order.
846 static const ElfW(Sym)* dlsym_handle_lookup(soinfo* si,
847 soinfo** found,
872 specified soinfo (for RTLD_NEXT).
877 soinfo** found,
878 soinfo* caller,
897 soinfo* si = *it;
918 soinfo* local_group_root = caller->get_local_group_root();
936 soinfo* find_containing_library(const void* p) {
938 for (soinfo* si = solist_get_head(); si != nullptr; si = si->next) {
1125 const char* name, soinfo *needed_by,
1210 soinfo** candidate) {
1212 auto predicate = [&](soinfo* si) {
1225 soinfo* si = linked_ns->soinfo_list().find_if(predicate);
1238 bool search_linked_namespaces, soinfo** candidate) {
1239 auto predicate = [&](soinfo* si) { return strcmp(realpath, si->get_realpath()) == 0; };
1246 soinfo* si = linked_ns->soinfo_list().find_if(predicate);
1294 soinfo* si = nullptr;
1298 "will return existing soinfo",
1323 const soinfo* needed_by = task->is_dt_needed() ? task->get_needed_by() : nullptr;
1327 const soinfo* needed_or_dlopened_by = task->get_needed_by();
1362 soinfo* si = soinfo_alloc(ns, realpath.c_str(), &file_stat, file_offset, rtld_flags);
1378 // going to be overwritten on soinfo::prelink_image
1415 soinfo* needed_by = task->get_needed_by();
1456 soinfo** candidate) {
1457 return !ns->soinfo_list().visit([&](soinfo* si) {
1472 soinfo** candidate) {
1504 soinfo* candidate;
1531 // returning true with empty soinfo means that the library is okay to be
1545 soinfo* candidate;
1615 static void soinfo_unload(soinfo* si);
1635 soinfo* start_with,
1638 soinfo* soinfos[],
1639 std::vector<soinfo*>* ld_preloads,
1647 std::unordered_map<const soinfo*, ElfReader> readers_map;
1663 size_t soinfos_size = sizeof(soinfo*)*library_names_count;
1664 soinfos = reinterpret_cast<soinfo**>(alloca(soinfos_size));
1683 soinfo* needed_by = task->get_needed_by();
1705 soinfo* si = task->get_soinfo();
1725 soinfo* si = task->get_soinfo();
1769 soinfo* si = task->get_soinfo();
1791 soinfo* si = task->get_soinfo();
1814 std::vector<soinfo*> local_group_roots;
1823 soinfo* si = task->get_soinfo();
1824 soinfo* needed_by = task->get_needed_by();
1857 [&] (soinfo* si) {
1867 bool linked = local_group.visit([&](soinfo* si) {
1901 soinfo* si = task->get_soinfo();
1906 soinfo* si = task->get_soinfo();
1907 soinfo* needed_by = task->get_needed_by();
1919 static soinfo* find_library(android_namespace_t* ns,
1922 soinfo* needed_by) {
1923 soinfo* si = nullptr;
1949 static void soinfo_unload_impl(soinfo* root) {
1967 soinfo* si = nullptr;
1977 soinfo* child = nullptr;
1993 async_safe_fatal("soinfo for \"%s\"@%p has no version", si->get_realpath(), si);
1997 local_unload_list.for_each([](soinfo* si) {
2034 static void soinfo_unload(soinfo* unload_si) {
2042 soinfo* root = is_linked ? unload_si->get_local_group_root() : unload_si;
2074 soinfo* si = find_containing_library(dso_handle);
2080 "increment_dso_handle_reference_counter: Couldn't find soinfo by dso_handle=%p",
2097 soinfo* si = find_containing_library(dso_handle);
2103 "decrement_dso_handle_reference_counter: Couldn't find soinfo by dso_handle=%p",
2118 static android_namespace_t* get_caller_namespace(soinfo* caller) {
2184 soinfo* const caller = find_containing_library(caller_addr);
2263 soinfo* si = nullptr;
2276 soinfo* si = find_library(ns, translated_name, flags, extinfo, caller);
2297 soinfo* si = find_containing_library(addr);
2318 static soinfo* soinfo_from_handle(void* handle) {
2328 return static_cast<soinfo*>(handle);
2344 soinfo* found = nullptr;
2346 soinfo* caller = find_containing_library(caller_addr);
2348 soinfo* si = nullptr;
2430 soinfo* si = soinfo_from_handle(handle);
2499 soinfo* caller_soinfo = find_containing_library(caller_addr);
2621 const soinfo* target_si) {
2631 bool VersionTracker::init_verneed(const soinfo* si_from) {
2652 soinfo* target_si = si_from->get_children().find_if([&](const soinfo* si) {
2678 static bool for_each_verdef(const soinfo* si, F functor) {
2725 bool find_verdef_version_index(const soinfo* si, const version_info* vi, ElfW(Versym)* versym) {
2746 bool VersionTracker::init_verdef(const soinfo* si_from) {
2756 bool VersionTracker::init(const soinfo* si_from) {
2764 // TODO (dimitry): Methods below need to be moved out of soinfo
2767 // independent from soinfo (?).
2768 bool soinfo::lookup_version_info(const VersionTracker& version_tracker, ElfW(Word) sym,
2789 void soinfo::apply_relr_reloc(ElfW(Addr) offset) {
2797 bool soinfo::relocate_relr() {
2863 bool soinfo::relocate(const VersionTracker& version_tracker, ElfRelIteratorT&& rel_iterator,
2888 soinfo* lsi = nullptr;
3374 bool soinfo::prelink_image() {
3872 bool soinfo::link_image(const soinfo_list_t& global_group, const soinfo_list_t& local_group,
4032 bool soinfo::protect_relro() {
4120 soinfo* somain = solist_get_somain();
4208 soinfo* ld_android_so = solist_get_head();
4211 soinfo* vdso = solist_get_vdso();