platform_bionic/tests/libs
Ryan Prichard 058eb8fa4e Ensure same order of global group members in all NS's
During "step 1" of find_libraries, the linker finds the transitive
closure of dependencies, in BFS order. As it finds each library, it
adds the library to its primary namespace (so that, if some other
library also depends on it, find_loaded_library_by_soname can find the
library in the process of being loaded).

LD_PRELOAD libraries are automatically marked DF_1_GLOBAL, and any
DF_1_GLOBAL library is added to every linker namespace. Previously,
this secondary namespace registration happened after step 1. The result
is that across different namespaces, the order of libraries could vary.
In general, a namespace's primary members will all appear before
secondary members. This is undesirable for libsigchain.so, which we
want to have appear before any other non-preloaded library.

Instead, when an soinfo is added to its primary namespace, immediately
add it to all the other namespaces, too. This ensures that the order of
soinfo objects is the same across namespaces.

Expand the dl.exec_with_ld_config_file_with_ld_preload and
dl.exec_with_ld_config_file tests to cover the new behavior. Mark
lib1.so DF_1_GLOBAL and use a "foo" symbol to mimic the behavior of a
signal API interposed by (e.g.) libsigchain.so and a ASAN preload.

Test: bionic unit tests
Bug: http://b/143219447
Change-Id: I9fd90f6f0d14caf1aca6d414b3e9aab77deca3ff
2021-01-22 03:27:43 -08:00
..
Android.bp Ensure same order of global group members in all NS's 2021-01-22 03:27:43 -08:00
Android.build.dlext_testzip.mk dlfcn.dt_runpath* tests are amended to handle LIB 2019-01-30 21:05:03 +09:00
Android.mk Convert more bionic tests to Android.bp 2020-01-16 10:12:46 -08:00
atexit_testlib.cpp
bionic_tests_zipalign.cpp Move off the Next ZipString overload. 2019-05-22 18:50:53 -07:00
cfi_test_bad_lib.cpp Runtime support for CFI 2017-01-18 13:13:52 -08:00
cfi_test_helper.cpp Disable a few bionic tests under HWASan. 2018-11-06 16:59:25 -08:00
cfi_test_helper2.cpp Fix CFI initialization crash on x86. 2017-02-02 14:44:46 -08:00
cfi_test_lib.cpp Use PROT_NONE on the unused parts of CFI shadow. 2020-06-12 12:22:32 -07:00
check_rtld_next_from_library.cpp Fix for dlfcn.rtld_next_from_library. 2017-11-03 15:00:09 -07:00
dl_df_1_global.cpp
dl_df_1_global_dummy.cpp Fix: linker segfault on dlopen of a DF_1_GLOBAL so 2017-10-19 15:13:54 +09:00
dl_df_1_use_global.cpp
dl_preempt_library_1.cpp
dl_preempt_library_2.cpp
dlext_test_library.cpp
dlext_test_recursive_library.cpp linker: allow using reserved space for multiple libraries. 2019-02-20 17:29:36 -05:00
dlopen_2_parents_reloc_answer.cpp Count references for groups instead of instances 2014-12-02 10:54:26 -08:00
dlopen_b.cpp Changes for #inclusivefixit. 2020-07-21 16:34:58 -07:00
dlopen_check_init_fini_child.cpp Add test checking init/fini call order 2017-02-09 14:07:05 -08:00
dlopen_check_init_fini_grand_child.cpp Add test checking init/fini call order 2017-02-09 14:07:05 -08:00
dlopen_check_init_fini_root.cpp Add test checking init/fini call order 2017-02-09 14:07:05 -08:00
dlopen_check_order_dlsym_answer.cpp
dlopen_check_order_reloc_answer.cpp
dlopen_check_order_reloc_answer_impl.cpp
dlopen_check_order_reloc_grandchild_answer.cpp
dlopen_check_order_reloc_grandchild_answer_impl.cpp
dlopen_check_order_reloc_nephew_answer.cpp
dlopen_check_order_reloc_root_answer.cpp
dlopen_check_order_reloc_root_answer_impl.cpp
dlopen_nodelete_1.cpp
dlopen_nodelete_2.cpp
dlopen_nodelete_dt_flags_1.cpp
dlopen_testlib_dlopen_from_ctor.cpp Minimize calls to mprotect 2015-01-23 16:30:34 -08:00
dlopen_testlib_ifunc.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
dlopen_testlib_ifunc_variable.cpp Add ifunc for variable test-case 2017-05-02 16:35:20 -07:00
dlopen_testlib_ifunc_variable_impl.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
dlopen_testlib_loopy_a.cpp Count references for groups instead of instances 2014-12-02 10:54:26 -08:00
dlopen_testlib_loopy_b.cpp Count references for groups instead of instances 2014-12-02 10:54:26 -08:00
dlopen_testlib_loopy_c.cpp Count references for groups instead of instances 2014-12-02 10:54:26 -08:00
dlopen_testlib_loopy_invalid.cpp Count references for groups instead of instances 2014-12-02 10:54:26 -08:00
dlopen_testlib_loopy_root.cpp Count references for groups instead of instances 2014-12-02 10:54:26 -08:00
dlopen_testlib_missing_symbol.cpp Fix logic in loading dependencies crossing namespace boundaries 2017-12-10 22:04:55 +01:00
dlopen_testlib_relo_check_dt_needed_order.cpp
dlopen_testlib_relo_check_dt_needed_order_1.cpp
dlopen_testlib_relo_check_dt_needed_order_2.cpp
dlopen_testlib_simple.cpp
dlopen_weak_undefined.cpp Add another test for weak-reference 2014-12-16 19:46:45 +00:00
dlsym_from_this_functions.cpp Improved dlsym tests and fixes to linker 2015-05-12 13:46:40 -07:00
dlsym_from_this_symbol.cpp Improved dlsym tests and fixes to linker 2015-05-12 13:46:40 -07:00
dlsym_from_this_symbol2.cpp Improved dlsym tests and fixes to linker 2015-05-12 13:46:40 -07:00
dlsym_weak_function.cpp
elftls_dlopen_ie_error_helper.cpp Add tests for static ELF TLS 2019-01-18 22:44:55 +00:00
elftls_dynamic.cpp Changes for #inclusivefixit. 2020-07-21 16:34:58 -07:00
elftls_dynamic_filler.cpp Add tests for dynamic ELF TLS 2019-01-29 08:35:10 +00:00
elftls_shared_var.cpp Add tests for static ELF TLS 2019-01-18 22:44:55 +00:00
elftls_shared_var_ie.cpp Add tests for static ELF TLS 2019-01-18 22:44:55 +00:00
elftls_tprel.cpp Add tests for static ELF TLS 2019-01-18 22:44:55 +00:00
empty.cpp
exec_linker_helper.cpp Use shared globals to init __progname + environ 2018-11-28 14:26:14 -08:00
exec_linker_helper_lib.cpp Allow invoking the linker on an executable. 2018-10-10 14:31:06 -07:00
heap_tagging_helper.cpp Tests for memory tagging ELF notes. 2021-01-13 17:18:42 -08:00
ld_config_test_helper.cpp Ensure same order of global group members in all NS's 2021-01-22 03:27:43 -08:00
ld_config_test_helper_lib1.cpp Ensure same order of global group members in all NS's 2021-01-22 03:27:43 -08:00
ld_config_test_helper_lib2.cpp Ensure same order of global group members in all NS's 2021-01-22 03:27:43 -08:00
ld_config_test_helper_lib3.cpp Ensure same order of global group members in all NS's 2021-01-22 03:27:43 -08:00
ld_preload_test_helper.cpp linker: the global group is added to all built-in namespaces 2017-08-03 01:02:07 +09:00
ld_preload_test_helper_lib1.cpp linker: the global group is added to all built-in namespaces 2017-08-03 01:02:07 +09:00
ld_preload_test_helper_lib2.cpp linker: the global group is added to all built-in namespaces 2017-08-03 01:02:07 +09:00
libnstest_ns_a_public1.cpp linker: Allow link namespaces without name filters 2018-01-25 14:45:29 +08:00
libnstest_ns_a_public1_internal.cpp linker: Allow link namespaces without name filters 2018-01-25 14:45:29 +08:00
libnstest_ns_b_public2.cpp linker: Allow link namespaces without name filters 2018-01-25 14:45:29 +08:00
libnstest_ns_b_public3.cpp linker: Allow link namespaces without name filters 2018-01-25 14:45:29 +08:00
libs_utils.h Fix x86 system calls made from ELF preinit. 2017-03-29 13:48:02 -07:00
namespaces_dlopened.cpp Introducing linker namespaces 2015-11-15 12:09:16 -08:00
namespaces_private.cpp Introducing linker namespaces 2015-11-15 12:09:16 -08:00
namespaces_public.cpp Introducing linker namespaces 2015-11-15 12:09:16 -08:00
namespaces_public_internal.cpp Replace public library list with shared lib sonames (part 2/2) 2017-02-09 23:26:44 -08:00
namespaces_root.cpp Replace public library list with shared lib sonames (part 2/2) 2017-02-09 23:26:44 -08:00
ns_hidden_child_app.cpp Ignore symbols of imported libs' dependencies 2020-02-03 14:20:40 -08:00
ns_hidden_child_global.cpp Ignore symbols of imported libs' dependencies 2020-02-03 14:20:40 -08:00
ns_hidden_child_helper.cpp Ignore symbols of imported libs' dependencies 2020-02-03 14:20:40 -08:00
ns_hidden_child_internal.cpp Ignore symbols of imported libs' dependencies 2020-02-03 14:20:40 -08:00
ns_hidden_child_public.cpp Ignore symbols of imported libs' dependencies 2020-02-03 14:20:40 -08:00
preinit_getauxval_test_helper.cpp Fix x86 system calls made from ELF preinit. 2017-03-29 13:48:02 -07:00
preinit_syscall_test_helper.cpp Fix x86 system calls made from ELF preinit. 2017-03-29 13:48:02 -07:00
pthread_atfork.cpp Unregister pthread_atfork handlers on dlclose() 2015-04-24 17:57:37 -07:00
relocations.cpp Test all four supported relocation encodings. 2020-01-28 17:59:23 -08:00
segment_gap_inner.cpp linker: Handle libraries with disjoint mappings correctly. 2019-03-08 18:34:34 -08:00
segment_gap_outer.cpp Specify sections to merge in segment_gap_outer.lds more precisely 2020-07-24 10:57:48 -07:00
segment_gap_outer.lds Specify sections to merge in segment_gap_outer.lds more precisely 2020-07-24 10:57:48 -07:00
thread_exit_cb_helper.cpp Add a thread-properties API 2020-08-11 16:51:43 +00:00
thread_local_dtor.cpp Fix/suppress bionic google-explicit-constructor warnings 2019-01-02 11:04:05 -08:00
thread_local_dtor2.cpp Fix/suppress bionic google-explicit-constructor warnings 2019-01-02 11:04:05 -08:00
tls_properties_helper.cpp Fix bug in finding another thread's TCB. 2020-10-15 10:28:19 -04:00
versioned_lib_other.cpp Support symbol versioning 2015-04-16 17:57:30 -07:00
versioned_lib_other.map Support symbol versioning 2015-04-16 17:57:30 -07:00
versioned_lib_v1.cpp Support symbol versioning 2015-04-16 17:57:30 -07:00
versioned_lib_v1.map Support symbol versioning 2015-04-16 17:57:30 -07:00
versioned_lib_v2.cpp Support symbol versioning 2015-04-16 17:57:30 -07:00
versioned_lib_v2.map Support symbol versioning 2015-04-16 17:57:30 -07:00
versioned_lib_v3.cpp Support symbol versioning 2015-04-16 17:57:30 -07:00
versioned_lib_v3.map Support symbol versioning 2015-04-16 17:57:30 -07:00
versioned_uselib.cpp Support symbol versioning 2015-04-16 17:57:30 -07:00
versioned_uselib.map Support symbol versioning 2015-04-16 17:57:30 -07:00