Lines Matching refs:soinfo
70 static LinkerTypeAllocator<soinfo> g_soinfo_allocator;
71 static LinkerTypeAllocator<LinkedListEntry<soinfo>> g_soinfo_links_allocator;
73 static soinfo* solist;
74 static soinfo* sonext;
75 static soinfo* somain; // main process, always the one after libdl_info
94 static std::vector<soinfo*> g_ld_preloads;
140 static void insert_soinfo_into_debug_map(soinfo* info) { in insert_soinfo_into_debug_map()
164 static void remove_soinfo_from_debug_map(soinfo* info) { in remove_soinfo_from_debug_map()
179 static void notify_gdb_of_load(soinfo* info) { in notify_gdb_of_load()
196 static void notify_gdb_of_unload(soinfo* info) { in notify_gdb_of_unload()
220 LinkedListEntry<soinfo>* SoinfoListAllocator::alloc() { in alloc()
224 void SoinfoListAllocator::free(LinkedListEntry<soinfo>* entry) { in free()
228 static soinfo* soinfo_alloc(const char* name, struct stat* file_stat, in soinfo_alloc()
235 soinfo* si = new (g_soinfo_allocator.alloc()) soinfo(name, file_stat, file_offset, rtld_flags); in soinfo_alloc()
244 static void soinfo_free(soinfo* si) { in soinfo_free()
253 soinfo *prev = nullptr, *trav; in soinfo_free()
280 si->~soinfo(); in soinfo_free()
342 for (soinfo* si = solist; si != 0; si = si->next) { in dl_unwind_find_exidx()
358 for (soinfo* si = solist; si != nullptr; si = si->next) { in do_dl_iterate_phdr()
372 const ElfW(Versym)* soinfo::get_versym(size_t n) const { in ElfW()
380 ElfW(Addr) soinfo::get_verneed_ptr() const { in ElfW()
388 size_t soinfo::get_verneed_cnt() const { in get_verneed_cnt()
396 ElfW(Addr) soinfo::get_verdef_ptr() const { in ElfW()
404 size_t soinfo::get_verdef_cnt() const { in get_verdef_cnt()
413 static bool for_each_verdef(const soinfo* si, F functor) { in for_each_verdef()
460 bool soinfo::find_verdef_version_index(const version_info* vi, ElfW(Versym)* versym) const { in find_verdef_version_index()
481 bool soinfo::find_symbol_by_name(SymbolName& symbol_name, in find_symbol_by_name()
497 static bool is_symbol_global_and_defined(const soinfo* si, const ElfW(Sym)* s) { in is_symbol_global_and_defined()
523 bool soinfo::gnu_lookup(SymbolName& symbol_name, in gnu_lookup()
592 bool soinfo::elf_lookup(SymbolName& symbol_name, in elf_lookup()
635 soinfo::soinfo(const char* realpath, const struct stat* file_stat, in soinfo() function in soinfo
690 bool soinfo_do_lookup(soinfo* si_from, const char* name, const version_info* vi, in soinfo_do_lookup()
691 soinfo** si_found_in, const soinfo::soinfo_list_t& global_group, in soinfo_do_lookup()
692 const soinfo::soinfo_list_t& local_group, const ElfW(Sym)** symbol) { in soinfo_do_lookup()
721 global_group.visit([&](soinfo* global_si) { in soinfo_do_lookup()
745 local_group.visit([&](soinfo* local_si) { in soinfo_do_lookup()
854 static LoadTask* create(const char* name, soinfo* needed_by) { in create()
863 soinfo* get_needed_by() const { in get_needed_by()
867 LoadTask(const char* name, soinfo* needed_by) in LoadTask()
871 soinfo* needed_by_;
881 typedef linked_list_t<soinfo> SoinfoLinkedList;
894 static bool walk_dependencies_tree(soinfo* root_soinfos[], size_t root_soinfos_size, F action) { in walk_dependencies_tree()
902 soinfo* si; in walk_dependencies_tree()
914 si->get_children().for_each([&](soinfo* child) { in walk_dependencies_tree()
923 static const ElfW(Sym)* dlsym_handle_lookup(soinfo* root, soinfo* skip_until, in ElfW()
924 soinfo** found, SymbolName& symbol_name) { in ElfW()
928 walk_dependencies_tree(&root, 1, [&](soinfo* current_soinfo) { in ElfW()
952 const ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name) { in ElfW()
974 soinfo** found, in ElfW()
975 soinfo* caller, in ElfW()
979 soinfo* start = solist; in ElfW()
990 for (soinfo* si = start; si != nullptr; si = si->next) { in ElfW()
1025 soinfo* find_containing_library(const void* p) { in find_containing_library()
1027 for (soinfo* si = solist; si != nullptr; si = si->next) { in find_containing_library()
1035 ElfW(Sym)* soinfo::find_symbol_by_address(const void* addr) { in ElfW()
1045 ElfW(Sym)* soinfo::gnu_addr_lookup(const void* addr) { in ElfW()
1066 ElfW(Sym)* soinfo::elf_addr_lookup(const void* addr) { in ElfW()
1236 static void for_each_dt_needed(const soinfo* si, F action) { in for_each_dt_needed()
1244 static soinfo* load_library(int fd, off64_t file_offset, in load_library()
1271 for (soinfo* si = solist; si != nullptr; si = si->next) { in load_library()
1301 soinfo* si = soinfo_alloc(realpath.c_str(), &file_stat, file_offset, rtld_flags); in load_library()
1323 static soinfo* load_library(LoadTaskList& load_tasks, in load_library()
1341 soinfo* result = load_library(fd, file_offset, load_tasks, name, rtld_flags, extinfo); in load_library()
1350 static bool find_loaded_library_by_soname(const char* name, soinfo** candidate) { in find_loaded_library_by_soname()
1360 for (soinfo* si = solist; si != nullptr; si = si->next) { in find_loaded_library_by_soname()
1383 static soinfo* find_library_internal(LoadTaskList& load_tasks, const char* name, in find_library_internal()
1385 soinfo* candidate; in find_library_internal()
1396 soinfo* si = load_library(load_tasks, name, rtld_flags, extinfo); in find_library_internal()
1408 static void soinfo_unload(soinfo* si);
1417 static soinfo::soinfo_list_t make_global_group() { in make_global_group()
1418 soinfo::soinfo_list_t global_group; in make_global_group()
1419 for (soinfo* si = somain; si != nullptr; si = si->next) { in make_global_group()
1428 static bool find_libraries(soinfo* start_with, const char* const library_names[], in find_libraries()
1429 size_t library_names_count, soinfo* soinfos[], std::vector<soinfo*>* ld_preloads, in find_libraries()
1439 soinfo::soinfo_list_t global_group = make_global_group(); in find_libraries()
1449 size_t soinfos_size = sizeof(soinfo*)*library_names_count; in find_libraries()
1450 soinfos = reinterpret_cast<soinfo**>(alloca(soinfos_size)); in find_libraries()
1471 soinfo* si = find_library_internal(load_tasks, task->get_name(), rtld_flags, extinfo); in find_libraries()
1476 soinfo* needed_by = task->get_needed_by(); in find_libraries()
1503 soinfo::soinfo_list_t local_group; in find_libraries()
1507 [&] (soinfo* si) { in find_libraries()
1516 bool linked = local_group.visit([&](soinfo* si) { in find_libraries()
1538 static soinfo* find_library(const char* name, int rtld_flags, const android_dlextinfo* extinfo) { in find_library()
1539 soinfo* si; in find_library()
1550 static void soinfo_unload(soinfo* root) { in soinfo_unload()
1569 soinfo::soinfo_list_t local_unload_list; in soinfo_unload()
1570 soinfo::soinfo_list_t external_unload_list; in soinfo_unload()
1571 soinfo::soinfo_list_t depth_first_list; in soinfo_unload()
1573 soinfo* si = nullptr; in soinfo_unload()
1583 soinfo* child = nullptr; in soinfo_unload()
1605 soinfo* needed = find_library(library_name, RTLD_NOLOAD, nullptr); in soinfo_unload()
1627 local_unload_list.for_each([](soinfo* si) { in soinfo_unload()
1667 soinfo* do_dlopen(const char* name, int flags, const android_dlextinfo* extinfo) { in do_dlopen()
1686 soinfo* si = find_library(name, flags, extinfo); in do_dlopen()
1693 void do_dlclose(soinfo* si) { in do_dlclose()
1721 const soinfo* target_si) { in add_version_info()
1731 bool VersionTracker::init_verneed(const soinfo* si_from) { in init_verneed()
1752 soinfo* target_si = si_from->get_children().find_if([&](const soinfo* si) { in init_verneed()
1777 bool VersionTracker::init_verdef(const soinfo* si_from) { in init_verdef()
1787 bool VersionTracker::init(const soinfo* si_from) { in init()
1795 bool soinfo::lookup_version_info(const VersionTracker& version_tracker, ElfW(Word) sym, in lookup_version_info()
1832 bool soinfo::relocate(const VersionTracker& version_tracker, ElfRelIteratorT&& rel_iterator, in relocate()
1854 soinfo* lsi = nullptr; in relocate()
2199 void soinfo::call_array(const char* array_name __unused, linker_function_t* functions, in call_array()
2219 void soinfo::call_function(const char* function_name __unused, linker_function_t function) { in call_function()
2229 void soinfo::call_pre_init_constructors() { in call_pre_init_constructors()
2235 void soinfo::call_constructors() { in call_constructors()
2258 get_children().for_each([] (soinfo* si) { in call_constructors()
2269 void soinfo::call_destructors() { in call_destructors()
2286 void soinfo::add_child(soinfo* child) { in add_child()
2293 void soinfo::remove_all_links() { in remove_all_links()
2299 children_.for_each([&] (soinfo* child) { in remove_all_links()
2300 child->parents_.remove_if([&] (const soinfo* parent) { in remove_all_links()
2305 parents_.for_each([&] (soinfo* parent) { in remove_all_links()
2306 parent->children_.remove_if([&] (const soinfo* child) { in remove_all_links()
2316 dev_t soinfo::get_st_dev() const { in get_st_dev()
2324 ino_t soinfo::get_st_ino() const { in get_st_ino()
2332 off64_t soinfo::get_file_offset() const { in get_file_offset()
2340 uint32_t soinfo::get_rtld_flags() const { in get_rtld_flags()
2348 uint32_t soinfo::get_dt_flags_1() const { in get_dt_flags_1()
2356 void soinfo::set_dt_flags_1(uint32_t dt_flags_1) { in set_dt_flags_1()
2370 const char* soinfo::get_realpath() const { in get_realpath()
2382 const char* soinfo::get_soname() const { in get_soname()
2396 static soinfo::soinfo_list_t g_empty_list;
2398 soinfo::soinfo_list_t& soinfo::get_children() { in get_children()
2406 const soinfo::soinfo_list_t& soinfo::get_children() const { in get_children()
2414 soinfo::soinfo_list_t& soinfo::get_parents() { in get_parents()
2422 ElfW(Addr) soinfo::resolve_symbol_address(const ElfW(Sym)* s) const { in ElfW()
2430 const char* soinfo::get_string(ElfW(Word) index) const { in get_string()
2439 bool soinfo::is_gnu_hash() const { in is_gnu_hash()
2443 bool soinfo::can_unload() const { in can_unload()
2447 bool soinfo::is_linked() const { in is_linked()
2451 bool soinfo::is_main_executable() const { in is_main_executable()
2455 void soinfo::set_linked() { in set_linked()
2459 void soinfo::set_linker_flag() { in set_linker_flag()
2463 void soinfo::set_main_executable() { in set_main_executable()
2467 void soinfo::increment_ref_count() { in increment_ref_count()
2471 size_t soinfo::decrement_ref_count() { in decrement_ref_count()
2475 soinfo* soinfo::get_local_group_root() const { in get_local_group_root()
2482 uint32_t soinfo::get_target_sdk_version() const { in get_target_sdk_version()
2490 bool soinfo::prelink_image() { in prelink_image()
2915 bool soinfo::link_image(const soinfo_list_t& global_group, const soinfo_list_t& local_group, in link_image()
3073 soinfo* si = soinfo_alloc("[vdso]", nullptr, 0, 0); in add_vdso()
3082 si->link_image(g_empty_list, soinfo::soinfo_list_t::make_list(si), nullptr); in add_vdso()
3098 static uint8_t linker_soinfo_for_gdb_buf[sizeof(soinfo)] __attribute__((aligned(8)));
3099 static soinfo* linker_soinfo_for_gdb = nullptr;
3109 linker_soinfo_for_gdb = new (linker_soinfo_for_gdb_buf) soinfo(LINKER_PATH, nullptr, 0, 0); in init_linker_info_for_gdb()
3164 soinfo* si = soinfo_alloc(args.argv[0], nullptr, 0, RTLD_GLOBAL);
3251 if (!si->link_image(g_empty_list, soinfo::soinfo_list_t::make_list(si), nullptr)) {
3362 soinfo linker_so(nullptr, nullptr, 0, 0);