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.c"],
277 // TODO(dimitry): clang does not support ifunc attribute
289 // -----------------------------------------------------------------------------
290 // Library used by atexit tests
291 // -----------------------------------------------------------------------------
294 name: "libtest_atexit",
295 defaults: ["bionic_testlib_defaults"],
296 srcs: ["atexit_testlib.cpp"],
299 // -----------------------------------------------------------------------------
300 // This library is used by dl_load test to check symbol preempting
301 // by main executable
302 // -----------------------------------------------------------------------------
304 name: "libdl_preempt_test_1",
305 defaults: ["bionic_testlib_defaults"],
306 srcs: ["dl_preempt_library_1.cpp"],
309 // -----------------------------------------------------------------------------
310 // This library is used by dl_load test to check symbol preempting
311 // by libdl_preempt_test_1.so
312 // -----------------------------------------------------------------------------
314 name: "libdl_preempt_test_2",
315 defaults: ["bionic_testlib_defaults"],
316 srcs: ["dl_preempt_library_2.cpp"],
319 // -----------------------------------------------------------------------------
320 // Library with DF_1_GLOBAL
321 // -----------------------------------------------------------------------------
323 name: "libdl_test_df_1_global",
324 defaults: ["bionic_testlib_defaults"],
325 srcs: ["dl_df_1_global.cpp"],
326 ldflags: ["-Wl,-z,global"],
330 // TODO (dimitry): host ld.gold does not yet support -z global
331 // remove this line once it is updated.
332 ldflags: ["-fuse-ld=bfd"],
337 // -----------------------------------------------------------------------------
338 // Library using symbol from libdl_test_df_1_global
339 // -----------------------------------------------------------------------------
341 name: "libtest_dlsym_df_1_global",
342 defaults: ["bionic_testlib_defaults"],
343 srcs: ["dl_df_1_use_global.cpp"],
346 // -----------------------------------------------------------------------------
347 // Library with weak function
348 // -----------------------------------------------------------------------------
350 name: "libtest_dlsym_weak_func",
351 defaults: ["bionic_testlib_defaults"],
352 srcs: ["dlsym_weak_function.cpp"],
355 // -----------------------------------------------------------------------------
356 // Library to check RTLD_LOCAL with dlsym in 'this'
357 // -----------------------------------------------------------------------------
359 name: "libtest_dlsym_from_this",
360 defaults: ["bionic_testlib_defaults"],
361 srcs: ["dlsym_from_this_symbol.cpp"],
362 shared_libs: ["libtest_dlsym_from_this_child"],
366 shared_libs: ["libdl"],
369 host_ldlibs: ["-ldl"],
374 // -----------------------------------------------------------------------------
376 name: "libtest_dlsym_from_this_child",
377 defaults: ["bionic_testlib_defaults"],
378 srcs: ["dlsym_from_this_functions.cpp"],
379 shared_libs: ["libtest_dlsym_from_this_grandchild"],
382 shared_libs: ["libdl"],
385 host_ldlibs: ["-ldl"],
390 // -----------------------------------------------------------------------------
392 name: "libtest_dlsym_from_this_grandchild",
393 defaults: ["bionic_testlib_defaults"],
394 srcs: ["dlsym_from_this_symbol2.cpp"],
397 // -----------------------------------------------------------------------------
399 // -----------------------------------------------------------------------------
401 name: "libtest_empty",
402 defaults: ["bionic_testlib_defaults"],
406 // -----------------------------------------------------------------------------
407 // Library with weak undefined function
408 // -----------------------------------------------------------------------------
410 name: "libtest_dlopen_weak_undefined_func",
411 defaults: ["bionic_testlib_defaults"],
412 srcs: ["dlopen_weak_undefined.cpp"],
415 // -----------------------------------------------------------------------------
416 // Check that RTLD_NEXT of a libc symbol works in dlopened library
417 // -----------------------------------------------------------------------------
419 name: "libtest_check_rtld_next_from_library",
420 defaults: ["bionic_testlib_defaults"],
421 srcs: ["check_rtld_next_from_library.cpp"],
425 shared_libs: ["libdl"],
428 host_ldlibs: ["-ldl"],
433 // -----------------------------------------------------------------------------
434 // Library with constructor that calls dlopen() b/7941716
435 // -----------------------------------------------------------------------------
437 name: "libtest_dlopen_from_ctor",
438 defaults: ["bionic_testlib_defaults"],
439 srcs: ["dlopen_testlib_dlopen_from_ctor.cpp"],
442 shared_libs: ["libdl"],
445 host_ldlibs: ["-ldl"],
450 // -----------------------------------------------------------------------------
451 // Libraries used to check init/fini call order
452 // -----------------------------------------------------------------------------
454 name: "libtest_init_fini_order_root",
455 defaults: ["bionic_testlib_defaults"],
456 srcs: ["dlopen_check_init_fini_root.cpp"],
458 "libtest_init_fini_order_child",
459 "libtest_init_fini_order_grand_child",
464 name: "libtest_init_fini_order_root2",
465 defaults: ["bionic_testlib_defaults"],
466 srcs: ["dlopen_check_init_fini_root.cpp"],
468 "libtest_init_fini_order_grand_child",
469 "libtest_init_fini_order_child",
474 name: "libtest_init_fini_order_child",
475 defaults: ["bionic_testlib_defaults"],
476 srcs: ["dlopen_check_init_fini_child.cpp"],
477 shared_libs: ["libtest_init_fini_order_grand_child"],
481 name: "libtest_init_fini_order_grand_child",
482 defaults: ["bionic_testlib_defaults"],
483 srcs: ["dlopen_check_init_fini_grand_child.cpp"],
486 // -----------------------------------------------------------------------------
487 // Library that depends on the library with constructor that calls dlopen() b/7941716
488 // -----------------------------------------------------------------------------
490 name: "libtest_dlopen_from_ctor_main",
491 defaults: ["bionic_testlib_defaults"],
493 shared_libs: ["libtest_dlopen_from_ctor"],
496 // -----------------------------------------------------------------------------
497 // Tool to use to align the shared libraries in a zip file.
498 // -----------------------------------------------------------------------------
500 name: "bionic_tests_zipalign",
501 srcs: ["bionic_tests_zipalign.cpp"],
518 defaults: ["bionic_testlib_defaults"],
519 srcs: ["cfi_test_lib.cpp"],
526 name: "libcfi-test-bad",
527 defaults: ["bionic_testlib_defaults"],
528 srcs: ["cfi_test_bad_lib.cpp"],
535 name: "cfi_test_helper",
536 host_supported: false,
537 defaults: ["bionic_testlib_defaults"],
538 srcs: ["cfi_test_helper.cpp"],
539 ldflags: ["-rdynamic"],
543 name: "cfi_test_helper2",
544 host_supported: false,
545 defaults: ["bionic_testlib_defaults"],
546 srcs: ["cfi_test_helper2.cpp"],
547 shared_libs: ["libcfi-test"],
548 ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
552 name: "preinit_getauxval_test_helper",
553 host_supported: false,
554 defaults: ["bionic_testlib_defaults"],
555 srcs: ["preinit_getauxval_test_helper.cpp"],
559 name: "preinit_syscall_test_helper",
560 host_supported: false,
561 defaults: ["bionic_testlib_defaults"],
562 srcs: ["preinit_syscall_test_helper.cpp"],