2 // Copyright (C) 2012 The Android Open Source Project
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 name: "bionic_testlib_defaults",
21 "-Wl,--rpath,${ORIGIN}",
22 "-Wl,--enable-new-dtags",
24 relative_install_path: "bionic-loader-test-libs",
38 // -----------------------------------------------------------------------------
39 // Library to test gnu-styled hash
40 // -----------------------------------------------------------------------------
42 name: "libgnu-hash-table-library",
43 defaults: ["bionic_testlib_defaults"],
44 srcs: ["dlext_test_library.cpp"],
45 ldflags: ["-Wl,--hash-style=gnu"],
56 // -----------------------------------------------------------------------------
57 // Library to test sysv-styled hash
58 // -----------------------------------------------------------------------------
60 name: "libsysv-hash-table-library",
61 defaults: ["bionic_testlib_defaults"],
62 srcs: ["dlext_test_library.cpp"],
63 ldflags: ["-Wl,--hash-style=sysv"],
66 // -----------------------------------------------------------------------------
67 // Library used by dlext tests - with GNU RELRO program header
68 // -----------------------------------------------------------------------------
69 // In Android.mk to support creating symlinks
71 // -----------------------------------------------------------------------------
72 // Library used by dlext tests - without GNU RELRO program header
73 // -----------------------------------------------------------------------------
75 name: "libdlext_test_norelro",
76 defaults: ["bionic_testlib_defaults"],
77 srcs: ["dlext_test_library.cpp"],
78 ldflags: ["-Wl,-z,norelro"],
79 shared_libs = ["libtest_simple"],
82 // -----------------------------------------------------------------------------
83 // Library used by dlext tests - different name non-default location
84 // -----------------------------------------------------------------------------
85 // In Android.mk to support installing to /data
87 // -----------------------------------------------------------------------------
88 // Libraries used by dlext tests for open from a zip-file
89 // -----------------------------------------------------------------------------
90 // In Android.mk to support installing to /data
92 // ----------------------------------------------------------------------------
93 // Library with soname which does not match filename
94 // ----------------------------------------------------------------------------
95 // In Android.mk to support zipped and aligned tests
97 // -----------------------------------------------------------------------------
98 // Library used by dlext tests - zipped and aligned
99 // -----------------------------------------------------------------------------
100 // In Android.mk to support zipped and aligned tests
102 // -----------------------------------------------------------------------------
103 // Library used by dlfcn tests
104 // -----------------------------------------------------------------------------
106 name: "libtest_simple",
107 defaults: ["bionic_testlib_defaults"],
108 srcs: ["dlopen_testlib_simple.cpp"],
111 // -----------------------------------------------------------------------------
112 // Library used by dlfcn nodelete tests
113 // -----------------------------------------------------------------------------
115 name: "libtest_nodelete_1",
116 defaults: ["bionic_testlib_defaults"],
117 srcs: ["dlopen_nodelete_1.cpp"],
120 // -----------------------------------------------------------------------------
121 // Library used by dlfcn nodelete tests
122 // -----------------------------------------------------------------------------
124 name: "libtest_nodelete_2",
125 defaults: ["bionic_testlib_defaults"],
126 srcs: ["dlopen_nodelete_2.cpp"],
129 // -----------------------------------------------------------------------------
130 // Library used by dlfcn nodelete tests
131 // -----------------------------------------------------------------------------
133 name: "libtest_nodelete_dt_flags_1",
134 defaults: ["bionic_testlib_defaults"],
135 srcs: ["dlopen_nodelete_dt_flags_1.cpp"],
136 ldflags: ["-Wl,-z,nodelete"],
139 // -----------------------------------------------------------------------------
140 // Build test helper libraries for linker namespaces
141 // -----------------------------------------------------------------------------
142 // include $(LOCAL_PATH)/Android.build.linker_namespaces.mk
144 // -----------------------------------------------------------------------------
145 // Build DT_RUNPATH test helper libraries
146 // -----------------------------------------------------------------------------
147 // include $(LOCAL_PATH)/Android.build.dt_runpath.mk
149 // -----------------------------------------------------------------------------
150 // Build library with two parents
151 // -----------------------------------------------------------------------------
152 // include $(LOCAL_PATH)/Android.build.dlopen_2_parents_reloc.mk
154 // -----------------------------------------------------------------------------
155 // Build libtest_check_order_dlsym.so with its dependencies.
156 // -----------------------------------------------------------------------------
157 // include $(LOCAL_PATH)/Android.build.dlopen_check_order_dlsym.mk
159 // -----------------------------------------------------------------------------
160 // Build libtest_check_order_siblings.so with its dependencies.
161 // -----------------------------------------------------------------------------
162 // include $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_siblings.mk
164 // -----------------------------------------------------------------------------
165 // Build libtest_check_order_root.so with its dependencies.
166 // -----------------------------------------------------------------------------
167 // include $(LOCAL_PATH)/Android.build.dlopen_check_order_reloc_main_executable.mk
169 // -----------------------------------------------------------------------------
170 // Build libtest_versioned_lib.so with its dependencies.
171 // -----------------------------------------------------------------------------
172 // include $(LOCAL_PATH)/Android.build.versioned_lib.mk
174 // -----------------------------------------------------------------------------
175 // Build libraries needed by pthread_atfork tests
176 // -----------------------------------------------------------------------------
177 // include $(LOCAL_PATH)/Android.build.pthread_atfork.mk
179 // -----------------------------------------------------------------------------
180 // Library with dependency loop used by dlfcn tests
182 // libtest_with_dependency_loop -> a -> b -> c -> a
183 // -----------------------------------------------------------------------------
185 name: "libtest_with_dependency_loop",
186 defaults: ["bionic_testlib_defaults"],
187 srcs: ["dlopen_testlib_loopy_root.cpp"],
188 shared_libs: ["libtest_with_dependency_loop_a"],
191 // -----------------------------------------------------------------------------
192 // libtest_with_dependency_loop_a.so
193 // -----------------------------------------------------------------------------
195 name: "libtest_with_dependency_loop_a",
196 defaults: ["bionic_testlib_defaults"],
197 srcs: ["dlopen_testlib_loopy_a.cpp"],
198 shared_libs: ["libtest_with_dependency_loop_b_tmp"],
201 // -----------------------------------------------------------------------------
202 // libtest_with_dependency_loop_b.so
204 // this is temporary placeholder - will be removed
205 // -----------------------------------------------------------------------------
207 name: "libtest_with_dependency_loop_b_tmp",
208 defaults: ["bionic_testlib_defaults"],
209 srcs: ["dlopen_testlib_loopy_invalid.cpp"],
210 ldflags: ["-Wl,-soname=libtest_with_dependency_loop_b.so"],
213 // -----------------------------------------------------------------------------
214 // libtest_with_dependency_loop_b.so
215 // -----------------------------------------------------------------------------
217 name: "libtest_with_dependency_loop_b",
218 defaults: ["bionic_testlib_defaults"],
219 srcs: ["dlopen_testlib_loopy_b.cpp"],
220 shared_libs: ["libtest_with_dependency_loop_c"],
223 // -----------------------------------------------------------------------------
224 // libtest_with_dependency_loop_c.so
225 // -----------------------------------------------------------------------------
227 name: "libtest_with_dependency_loop_c",
228 defaults: ["bionic_testlib_defaults"],
229 srcs: ["dlopen_testlib_loopy_c.cpp"],
230 shared_libs: ["libtest_with_dependency_loop_a"],
233 // -----------------------------------------------------------------------------
234 // libtest_relo_check_dt_needed_order.so
236 // +-> libtest_relo_check_dt_needed_order_1.so
238 // +-> libtest_relo_check_dt_needed_order_2.so
239 // -----------------------------------------------------------------------------
243 name: "libtest_relo_check_dt_needed_order",
244 defaults: ["bionic_testlib_defaults"],
245 srcs: ["dlopen_testlib_relo_check_dt_needed_order.cpp"],
247 "libtest_relo_check_dt_needed_order_1",
248 "libtest_relo_check_dt_needed_order_2",
253 name: "libtest_relo_check_dt_needed_order_1",
254 defaults: ["bionic_testlib_defaults"],
255 srcs: ["dlopen_testlib_relo_check_dt_needed_order_1.cpp"],
259 name: "libtest_relo_check_dt_needed_order_2",
260 defaults: ["bionic_testlib_defaults"],
261 srcs: ["dlopen_testlib_relo_check_dt_needed_order_2.cpp"],
264 // -----------------------------------------------------------------------------
265 // Library with dependency used by dlfcn tests
266 // -----------------------------------------------------------------------------
267 // In Android.mk to support dependency on libdlext_test
269 // -----------------------------------------------------------------------------
270 // Library used by ifunc tests
271 // -----------------------------------------------------------------------------
273 name: "libtest_ifunc",
274 defaults: ["bionic_testlib_defaults"],
275 srcs: ["dlopen_testlib_ifunc.cpp"],
288 shared_libs: ["libdl"],
291 host_ldlibs: ["-ldl"],
297 name: "libtest_ifunc_variable",
298 defaults: ["bionic_testlib_defaults"],
299 srcs: ["dlopen_testlib_ifunc_variable.cpp"],
300 shared_libs: [ "libtest_ifunc_variable_impl" ],
313 shared_libs: ["libdl"],
316 host_ldlibs: ["-ldl"],
322 name: "libtest_ifunc_variable_impl",
323 defaults: ["bionic_testlib_defaults"],
324 srcs: ["dlopen_testlib_ifunc_variable_impl.cpp"],
337 shared_libs: ["libdl"],
340 host_ldlibs: ["-ldl"],
345 // -----------------------------------------------------------------------------
346 // Library used by atexit tests
347 // -----------------------------------------------------------------------------
350 name: "libtest_atexit",
351 defaults: ["bionic_testlib_defaults"],
352 srcs: ["atexit_testlib.cpp"],
355 // -----------------------------------------------------------------------------
356 // This library is used by dl_load test to check symbol preempting
357 // by main executable
358 // -----------------------------------------------------------------------------
360 name: "libdl_preempt_test_1",
361 defaults: ["bionic_testlib_defaults"],
362 srcs: ["dl_preempt_library_1.cpp"],
365 // -----------------------------------------------------------------------------
366 // This library is used by dl_load test to check symbol preempting
367 // by libdl_preempt_test_1.so
368 // -----------------------------------------------------------------------------
370 name: "libdl_preempt_test_2",
371 defaults: ["bionic_testlib_defaults"],
372 srcs: ["dl_preempt_library_2.cpp"],
375 // -----------------------------------------------------------------------------
376 // Library with DF_1_GLOBAL
377 // -----------------------------------------------------------------------------
379 name: "libdl_test_df_1_global",
380 defaults: ["bionic_testlib_defaults"],
381 srcs: ["dl_df_1_global.cpp"],
382 ldflags: ["-Wl,-z,global"],
386 // TODO (dimitry): host ld.gold does not yet support -z global
387 // remove this line once it is updated.
388 ldflags: ["-fuse-ld=bfd"],
393 // -----------------------------------------------------------------------------
394 // Library using symbol from libdl_test_df_1_global
395 // -----------------------------------------------------------------------------
397 name: "libtest_dlsym_df_1_global",
398 defaults: ["bionic_testlib_defaults"],
399 srcs: ["dl_df_1_use_global.cpp"],
402 // -----------------------------------------------------------------------------
403 // Library with weak function
404 // -----------------------------------------------------------------------------
406 name: "libtest_dlsym_weak_func",
407 defaults: ["bionic_testlib_defaults"],
408 srcs: ["dlsym_weak_function.cpp"],
411 // -----------------------------------------------------------------------------
412 // Library to check RTLD_LOCAL with dlsym in 'this'
413 // -----------------------------------------------------------------------------
415 name: "libtest_dlsym_from_this",
416 defaults: ["bionic_testlib_defaults"],
417 srcs: ["dlsym_from_this_symbol.cpp"],
418 shared_libs: ["libtest_dlsym_from_this_child"],
422 shared_libs: ["libdl"],
425 host_ldlibs: ["-ldl"],
430 // -----------------------------------------------------------------------------
432 name: "libtest_dlsym_from_this_child",
433 defaults: ["bionic_testlib_defaults"],
434 srcs: ["dlsym_from_this_functions.cpp"],
435 shared_libs: ["libtest_dlsym_from_this_grandchild"],
438 shared_libs: ["libdl"],
441 host_ldlibs: ["-ldl"],
446 // -----------------------------------------------------------------------------
448 name: "libtest_dlsym_from_this_grandchild",
449 defaults: ["bionic_testlib_defaults"],
450 srcs: ["dlsym_from_this_symbol2.cpp"],
453 // -----------------------------------------------------------------------------
455 // -----------------------------------------------------------------------------
457 name: "libtest_empty",
458 defaults: ["bionic_testlib_defaults"],
462 // -----------------------------------------------------------------------------
463 // Library with weak undefined function
464 // -----------------------------------------------------------------------------
466 name: "libtest_dlopen_weak_undefined_func",
467 defaults: ["bionic_testlib_defaults"],
468 srcs: ["dlopen_weak_undefined.cpp"],
471 // -----------------------------------------------------------------------------
472 // Check that RTLD_NEXT of a libc symbol works in dlopened library
473 // -----------------------------------------------------------------------------
475 name: "libtest_check_rtld_next_from_library",
476 defaults: ["bionic_testlib_defaults"],
477 srcs: ["check_rtld_next_from_library.cpp"],
481 shared_libs: ["libdl"],
484 host_ldlibs: ["-ldl"],
489 // -----------------------------------------------------------------------------
490 // Library with constructor that calls dlopen() b/7941716
491 // -----------------------------------------------------------------------------
493 name: "libtest_dlopen_from_ctor",
494 defaults: ["bionic_testlib_defaults"],
495 srcs: ["dlopen_testlib_dlopen_from_ctor.cpp"],
498 shared_libs: ["libdl"],
501 host_ldlibs: ["-ldl"],
506 // -----------------------------------------------------------------------------
507 // Libraries used to check init/fini call order
508 // -----------------------------------------------------------------------------
510 name: "libtest_init_fini_order_root",
511 defaults: ["bionic_testlib_defaults"],
512 srcs: ["dlopen_check_init_fini_root.cpp"],
514 "libtest_init_fini_order_child",
515 "libtest_init_fini_order_grand_child",
520 name: "libtest_init_fini_order_root2",
521 defaults: ["bionic_testlib_defaults"],
522 srcs: ["dlopen_check_init_fini_root.cpp"],
524 "libtest_init_fini_order_grand_child",
525 "libtest_init_fini_order_child",
530 name: "libtest_init_fini_order_child",
531 defaults: ["bionic_testlib_defaults"],
532 srcs: ["dlopen_check_init_fini_child.cpp"],
533 shared_libs: ["libtest_init_fini_order_grand_child"],
537 name: "libtest_init_fini_order_grand_child",
538 defaults: ["bionic_testlib_defaults"],
539 srcs: ["dlopen_check_init_fini_grand_child.cpp"],
542 // -----------------------------------------------------------------------------
543 // Library that depends on the library with constructor that calls dlopen() b/7941716
544 // -----------------------------------------------------------------------------
546 name: "libtest_dlopen_from_ctor_main",
547 defaults: ["bionic_testlib_defaults"],
549 shared_libs: ["libtest_dlopen_from_ctor"],
552 // -----------------------------------------------------------------------------
553 // Tool to use to align the shared libraries in a zip file.
554 // -----------------------------------------------------------------------------
556 name: "bionic_tests_zipalign",
557 srcs: ["bionic_tests_zipalign.cpp"],
574 defaults: ["bionic_testlib_defaults"],
575 srcs: ["cfi_test_lib.cpp"],
582 name: "libcfi-test-bad",
583 defaults: ["bionic_testlib_defaults"],
584 srcs: ["cfi_test_bad_lib.cpp"],
591 name: "cfi_test_helper",
592 host_supported: false,
593 defaults: ["bionic_testlib_defaults"],
594 srcs: ["cfi_test_helper.cpp"],
595 ldflags: ["-rdynamic"],
599 name: "cfi_test_helper2",
600 host_supported: false,
601 defaults: ["bionic_testlib_defaults"],
602 srcs: ["cfi_test_helper2.cpp"],
603 shared_libs: ["libcfi-test"],
604 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
608 name: "preinit_getauxval_test_helper",
609 host_supported: false,
610 defaults: ["bionic_testlib_defaults"],
611 srcs: ["preinit_getauxval_test_helper.cpp"],
615 name: "preinit_syscall_test_helper",
616 host_supported: false,
617 defaults: ["bionic_testlib_defaults"],
618 srcs: ["preinit_syscall_test_helper.cpp"],
622 name: "ld_preload_test_helper",
623 host_supported: false,
624 defaults: ["bionic_testlib_defaults"],
625 srcs: ["ld_preload_test_helper.cpp"],
626 shared_libs: ["ld_preload_test_helper_lib1"],
627 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
631 name: "ld_preload_test_helper_lib1",
632 host_supported: false,
633 defaults: ["bionic_testlib_defaults"],
634 srcs: ["ld_preload_test_helper_lib1.cpp"],
638 name: "ld_preload_test_helper_lib2",
639 host_supported: false,
640 defaults: ["bionic_testlib_defaults"],
641 srcs: ["ld_preload_test_helper_lib2.cpp"],
645 name: "ld_config_test_helper",
646 host_supported: false,
647 defaults: ["bionic_testlib_defaults"],
648 srcs: ["ld_config_test_helper.cpp"],
649 shared_libs: ["ld_config_test_helper_lib1"],
650 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
654 name: "ld_config_test_helper_lib1",
655 host_supported: false,
656 defaults: ["bionic_testlib_defaults"],
657 srcs: ["ld_config_test_helper_lib1.cpp"],
658 shared_libs: ["ld_config_test_helper_lib2"],
659 relative_install_path: "/ns2",
663 name: "ld_config_test_helper_lib2",
664 host_supported: false,
665 defaults: ["bionic_testlib_defaults"],
666 srcs: ["ld_config_test_helper_lib2.cpp"],
667 relative_install_path: "/ns2",
671 name: "ld_config_test_helper_lib3",
672 host_supported: false,
673 defaults: ["bionic_testlib_defaults"],
674 srcs: ["ld_config_test_helper_lib3.cpp"],