x86_64: Fix svml_s_hypotf4_core_sse4.S code formatting
[glibc.git] / elf / Makefile
blobc96924e9c2e60acdbbd7c87f3c839bbb80a11ecc
1 # Copyright (C) 1995-2022 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
18 # Makefile for elf subdirectory of GNU C Library.
20 subdir := elf
22 include ../Makeconfig
24 headers = \
25 bits/elfclass.h \
26 bits/link.h \
27 bits/link_lavcurrent.h \
28 elf.h \
29 link.h \
30 # headers
32 routines = \
33 $(all-dl-routines) \
34 dl-addr \
35 dl-addr-obj \
36 dl-error \
37 dl-iteratephdr \
38 dl-libc \
39 dl-origin \
40 dl-profstub \
41 dl-reloc-static-pie \
42 dl-support \
43 dl-sym \
44 dl-sysdep \
45 enbl-secure \
46 libc-dl_find_object \
47 libc_early_init \
48 rtld_static_init \
49 # routines
51 # The core dynamic linking functions are in libc for the static and
52 # profiled libraries.
53 dl-routines = \
54 dl-call-libc-early-init \
55 dl-close \
56 dl-debug \
57 dl-debug-symbols \
58 dl-deps \
59 dl-exception \
60 dl-execstack \
61 dl-find_object \
62 dl-fini \
63 dl-init \
64 dl-load \
65 dl-lookup \
66 dl-lookup-direct \
67 dl-minimal-malloc \
68 dl-misc \
69 dl-object \
70 dl-open \
71 dl-origin \
72 dl-printf \
73 dl-profile \
74 dl-reloc \
75 dl-runtime \
76 dl-scope \
77 dl-setup_hash \
78 dl-sort-maps \
79 dl-thread_gscope_wait \
80 dl-tls \
81 dl-tls_init_tp \
82 dl-trampoline \
83 dl-version \
84 dl-write \
85 # dl-routines
87 ifeq (yes,$(use-ldconfig))
88 dl-routines += dl-cache
89 endif
91 ifneq (no,$(have-tunables))
92 dl-routines += dl-tunables
93 tunables-type = $(addprefix TUNABLES_FRONTEND_,$(have-tunables))
94 CPPFLAGS-dl-tunables.c += -DTUNABLES_FRONTEND=$(tunables-type)
96 ifeq (yesyes,$(build-shared)$(run-built-tests))
97 tests-special += $(objpfx)list-tunables.out
98 endif
100 # Make sure that the compiler does not insert any library calls in tunables
101 # code paths.
102 ifeq (yes,$(have-loop-to-function))
103 CFLAGS-dl-tunables.c += -fno-tree-loop-distribute-patterns
104 endif
105 endif
107 all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
108 # But they are absent from the shared libc, because that code is in ld.so.
109 elide-routines.os = \
110 $(all-dl-routines) \
111 dl-exception \
112 dl-origin \
113 dl-reloc-static-pie \
114 dl-support \
115 dl-sysdep \
116 enbl-secure \
117 rtld_static_init \
118 thread_gscope_wait \
119 # elide-routines.os
121 # These object files are only included in the dynamically-linked libc.
122 shared-only-routines = libc-dl_find_object
124 # ld.so uses those routines, plus some special stuff for being the program
125 # interpreter and operating independent of libc.
126 rtld-routines = \
127 $(all-dl-routines) \
128 dl-audit \
129 dl-compat \
130 dl-diagnostics \
131 dl-diagnostics-cpu \
132 dl-diagnostics-kernel \
133 dl-environ \
134 dl-error-minimal \
135 dl-hwcaps \
136 dl-hwcaps-subdirs \
137 dl-hwcaps_split \
138 dl-libc_freeres \
139 dl-minimal \
140 dl-mutex \
141 dl-sysdep \
142 dl-usage \
143 rtld \
144 # rtld-routines
146 all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines)
148 CFLAGS-dl-runtime.c += -fexceptions -fasynchronous-unwind-tables
149 CFLAGS-dl-lookup.c += -fexceptions -fasynchronous-unwind-tables
150 CFLAGS-dl-iteratephdr.c += $(uses-callbacks)
152 # Called during static library initialization, so turn stack-protection
153 # off for non-shared builds.
154 CFLAGS-dl-minimal-malloc.o = $(no-stack-protector)
155 CFLAGS-dl-minimal-malloc.op = $(no-stack-protector)
157 # On targets without __builtin_memset, rtld.c uses a hand-coded loop
158 # in _dl_start. Make sure this isn't turned into a call to regular memset.
159 ifeq (yes,$(have-loop-to-function))
160 CFLAGS-rtld.c += -fno-tree-loop-distribute-patterns
161 endif
163 ifeq (yes,$(have-loop-to-function))
164 # Likewise, during static library startup, memset is not yet available.
165 CFLAGS-dl-support.c = -fno-tree-loop-distribute-patterns
166 endif
168 # Compile rtld itself without stack protection.
169 # Also compile all routines in the static library that are elided from
170 # the shared libc because they are in libc.a in the same way.
172 CFLAGS-.o += $(call elide-stack-protector,.o,$(elide-routines.os))
173 CFLAGS-.op += $(call elide-stack-protector,.op,$(elide-routines.os))
174 CFLAGS-.os += $(call elide-stack-protector,.os,$(all-rtld-routines))
176 # Add the requested compiler flags to the early startup code.
177 CFLAGS-dl-printf.os += $(rtld-early-cflags)
178 CFLAGS-dl-setup_hash.os += $(rtld-early-cflags)
179 CFLAGS-dl-sysdep.os += $(rtld-early-cflags)
180 CFLAGS-dl-tunables.os += $(rtld-early-cflags)
181 CFLAGS-dl-write.os += $(rtld-early-cflags)
182 CFLAGS-dl-writev.os += $(rtld-early-cflags)
183 CFLAGS-rtld.os += $(rtld-early-cflags)
185 ifeq ($(unwind-find-fde),yes)
186 routines += unwind-dw2-fde-glibc
187 shared-only-routines += unwind-dw2-fde-glibc
188 endif
190 before-compile += $(objpfx)trusted-dirs.h
191 generated += trusted-dirs.h trusted-dirs.st for-renamed/renamed.so
192 generated-dirs += for-renamed
194 ifeq ($(build-shared),yes)
195 ld-map = $(common-objpfx)ld.map
196 endif
198 ifeq (yes,$(build-shared))
199 extra-objs = \
200 $(all-rtld-routines:%=%.os) \
201 sofini.os \
202 interp.os \
203 # extra-objs
204 generated += \
205 dl-allobjs.os \
206 ld.so ldd \
207 librtld.os \
208 # generated
209 install-others = $(inst_rtlddir)/$(rtld-installed-name) $(inst_bindir)/ld.so
210 install-bin-script = ldd
211 endif
213 others = sprof sln
214 install-bin = sprof
215 others-static = sln
216 install-rootsbin = sln
217 sln-modules := static-stubs
218 extra-objs += $(sln-modules:=.o)
220 ifeq (yes,$(use-ldconfig))
221 ifeq (yes,$(build-shared))
222 others-static += ldconfig
223 others += ldconfig
224 install-rootsbin += ldconfig
226 ldconfig-modules := \
227 cache \
228 chroot_canon \
229 readlib \
230 static-stubs \
231 stringtable \
232 xmalloc \
233 xstrdup \
234 # ldconfig-modules
235 extra-objs += $(ldconfig-modules:=.o)
236 others-extras = $(ldconfig-modules)
237 endif
238 endif
240 # To find xmalloc.c and xstrdup.c
241 vpath %.c ../locale/programs
243 ifeq ($(build-shared),yes)
244 extra-objs += sotruss-lib.os sotruss-lib.so
245 install-others += $(inst_auditdir)/sotruss-lib.so
246 install-bin-script += sotruss
247 generated += sotruss
248 libof-sotruss-lib = extramodules
249 LDFLAGS-sotruss-lib.so += $(z-now-$(bind-now))
250 $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os
251 $(build-module-asneeded)
252 $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \
253 $(common-objpfx)libc_nonshared.a
255 $(objpfx)sotruss: sotruss.sh $(common-objpfx)config.make
256 sed -e 's%@VERSION@%$(version)%g' \
257 -e 's%@TEXTDOMAINDIR@%$(localedir)%g' \
258 -e 's%@PREFIX@%$(prefix)%g' \
259 -e 's|@PKGVERSION@|$(PKGVERSION)|g' \
260 -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
261 < $< > $@.new
262 chmod 555 $@.new
263 mv -f $@.new $@
264 $(inst_auditdir)/sotruss-lib.so: $(objpfx)sotruss-lib.so $(+force)
265 $(do-install-program)
266 endif
268 tests-static-normal := \
269 tst-array1-static \
270 tst-array5-static \
271 tst-dl-iter-static \
272 tst-dst-static \
273 tst-env-setuid \
274 tst-env-setuid-tunables \
275 tst-getauxval-static \
276 tst-linkall-static \
277 tst-single_threaded-pthread-static \
278 tst-single_threaded-static \
279 tst-tlsalign-extern-static \
280 tst-tlsalign-static \
281 # tests-static-normal
283 tests-static-internal := \
284 tst-dl_find_object-static \
285 tst-ptrguard1-static \
286 tst-stackguard1-static \
287 tst-tls1-static \
288 tst-tls1-static-non-pie \
289 # tests-static-internal
291 CRT-tst-tls1-static-non-pie := $(csu-objpfx)crt1.o
292 tst-tls1-static-non-pie-no-pie = yes
294 tests-container := \
295 tst-ldconfig-bad-aux-cache \
296 tst-ldconfig-ld_so_conf-update \
297 # tests-container
299 ifeq (no,$(build-hardcoded-path-in-tests))
300 # This is an ld.so.cache test, and RPATH/RUNPATH in the executable
301 # interferes with its test objectives.
302 tests-container += tst-glibc-hwcaps-prepend-cache
303 endif
305 tests := \
306 tst-array1 \
307 tst-array2 \
308 tst-array3 \
309 tst-array4 \
310 tst-array5 \
311 tst-auxv \
312 tst-leaks1 \
313 tst-stringtable \
314 tst-tls9 \
315 # tests
317 tests-internal := \
318 $(tests-static-internal) \
319 tst-tls1 \
320 # tests-internal
322 tests-static := $(tests-static-normal) $(tests-static-internal)
324 ifeq (yes,$(build-shared))
325 tests-static += \
326 tst-single_threaded-static-dlopen \
327 tst-tls9-static \
328 # tests-static
330 static-dlopen-environment = \
331 LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)dlfcn
332 tst-tls9-static-ENV = $(static-dlopen-environment)
333 tst-single_threaded-static-dlopen-ENV = $(static-dlopen-environment)
335 tests += \
336 argv0test \
337 constload1 \
338 dblload \
339 dblunload \
340 filter \
341 global \
342 initfirst \
343 lateglobal \
344 loadfail \
345 multiload \
346 next \
347 nodelete \
348 nodelete2 \
349 nodlopen \
350 nodlopen2 \
351 noload \
352 order \
353 order2 \
354 origtest \
355 preloadtest \
356 reldep \
357 reldep2 \
358 reldep3 \
359 reldep4 \
360 reldep5 \
361 reldep6 \
362 reldep7 \
363 reldep8 \
364 resolvfail \
365 restest1 \
366 restest2 \
367 tst-absolute-sym \
368 tst-absolute-zero \
369 tst-addr1 \
370 tst-align \
371 tst-align2 \
372 tst-align3 \
373 tst-audit1 \
374 tst-audit2 \
375 tst-audit8 \
376 tst-audit9 \
377 tst-audit11 \
378 tst-audit12 \
379 tst-audit13 \
380 tst-audit17 \
381 tst-audit18 \
382 tst-audit19b \
383 tst-audit20 \
384 tst-audit21 \
385 tst-audit22 \
386 tst-audit23 \
387 tst-audit24a \
388 tst-audit24b \
389 tst-audit24c \
390 tst-audit24d \
391 tst-audit25a \
392 tst-audit25b \
393 tst-auditmany \
394 tst-auxobj \
395 tst-auxobj-dlopen \
396 tst-big-note \
397 tst-debug1 \
398 tst-deep1 \
399 tst-dl-is_dso \
400 tst-dlmodcount \
401 tst-dlmopen1 \
402 tst-dlmopen3 \
403 tst-dlmopen4 \
404 tst-dlmopen-dlerror \
405 tst-dlmopen-gethostbyname \
406 tst-dlopenfail \
407 tst-dlopenfail-2 \
408 tst-dlopenrpath \
409 tst-dlopen-self \
410 tst-dlopen-tlsmodid \
411 tst-dlsym-error \
412 tst-filterobj \
413 tst-filterobj-dlopen \
414 tst-glibc-hwcaps \
415 tst-glibc-hwcaps-mask \
416 tst-glibc-hwcaps-prepend \
417 tst-global1 \
418 tst-global2 \
419 tst-initfinilazyfail \
420 tst-initorder \
421 tst-initorder2 \
422 tst-latepthread \
423 tst-main1 \
424 tst-nodelete2 \
425 tst-nodelete-dlclose \
426 tst-nodelete-opened \
427 tst-noload \
428 tst-null-argv \
429 tst-p_align1 \
430 tst-p_align2 \
431 tst-p_align3 \
432 tst-relsort1 \
433 tst-ro-dynamic \
434 tst-rtld-run-static \
435 tst-single_threaded \
436 tst-single_threaded-pthread \
437 tst-sonamemove-dlopen \
438 tst-sonamemove-link \
439 tst-thrlock \
440 tst-tls10 \
441 tst-tls11 \
442 tst-tls12 \
443 tst-tls13 \
444 tst-tls14 \
445 tst-tls15 \
446 tst-tls16 \
447 tst-tls17 \
448 tst-tls18 \
449 tst-tls19 \
450 tst-tls20 \
451 tst-tls21 \
452 tst-tls4 \
453 tst-tls5 \
454 tst-tlsalign \
455 tst-tlsalign-extern \
456 tst-tls-dlinfo \
457 tst-tls-ie \
458 tst-tls-ie-dlmopen \
459 tst-tls-manydynamic \
460 tst-unique1 \
461 tst-unique2 \
462 tst-unwind-ctor \
463 tst-unwind-main \
464 unload3 \
465 unload4 \
466 unload5 \
467 unload6 \
468 unload7 \
469 unload8 \
470 valgrind-test \
471 # tests
472 tests-cxx = \
473 tst-dlopen-nodelete-reloc \
474 tst-nodelete \
475 tst-unique3 \
476 tst-unique4 \
477 # tests-cxx
479 tests += $(if $(CXX),$(tests-cxx))
481 tests-internal += \
482 circleload1 \
483 loadtest \
484 neededtest \
485 neededtest2 \
486 neededtest3 \
487 neededtest4 \
488 tst-audit19a \
489 tst-create_format1 \
490 tst-dl-hwcaps_split \
491 tst-dl_find_object \
492 tst-dl_find_object-threads \
493 tst-dlmopen2 \
494 tst-ptrguard1 \
495 tst-stackguard1 \
496 tst-tls-surplus \
497 tst-tls3 \
498 tst-tls6 \
499 tst-tls7 \
500 tst-tls8 \
501 unload \
502 unload2 \
503 # tests-internal
505 tests-container += \
506 tst-dlopen-self-container \
507 tst-dlopen-tlsmodid-container \
508 tst-pldd \
509 tst-preload-pthread-libc \
510 # tests-container
512 test-srcs = \
513 tst-pathopt \
514 # tests-srcs
516 ifeq (yes,$(have-fpie))
517 tests-pie += tst-align3
518 endif
519 selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)
521 ifneq ($(selinux-enabled),1)
522 tests-execstack-yes = \
523 tst-execstack \
524 tst-execstack-needed \
525 tst-execstack-prog \
526 # tests-execstack-yes
527 endif
528 ifeq ($(have-depaudit),yes)
529 tests += \
530 tst-audit14 \
531 tst-audit14a \
532 tst-audit15 \
533 tst-audit16 \
534 # tests
535 ifeq ($(run-built-tests),yes)
536 tests-special += \
537 $(objpfx)tst-audit14-cmp.out \
538 $(objpfx)tst-audit14a-cmp.out \
539 $(objpfx)tst-audit15-cmp.out \
540 $(objpfx)tst-audit16-cmp.out \
541 # tests-special
542 endif
543 endif
544 endif
546 ifeq ($(run-built-tests),yes)
547 tests-special += $(objpfx)tst-valgrind-smoke.out
548 endif
549 $(objpfx)tst-valgrind-smoke.out: tst-valgrind-smoke.sh $(objpfx)ld.so $(objpfx)valgrind-test
550 $(SHELL) $< $(objpfx)ld.so $(rtlddir)/$(rtld-installed-name) '$(test-wrapper-env)' \
551 '$(run-program-env)' '$(rpath-link)' $(objpfx)valgrind-test > $@; $(evaluate-test)
553 tests += $(tests-execstack-$(have-z-execstack))
554 ifeq ($(run-built-tests),yes)
555 tests-special += \
556 $(objpfx)noload-mem.out \
557 $(objpfx)tst-ldconfig-X.out \
558 $(objpfx)tst-leaks1-mem.out \
559 $(objpfx)tst-rtld-help.out \
560 # tests-special
561 endif
562 tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
563 tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
564 tlsmod17a-modules = $(addprefix tst-tlsmod17a, $(tlsmod17a-suffixes))
565 tlsmod18a-modules = $(addprefix tst-tlsmod18a, $(tlsmod17a-suffixes))
566 one-hundred = $(foreach x,0 1 2 3 4 5 6 7 8 9, \
567 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
568 tst-tls-many-dynamic-modules := \
569 $(foreach n,$(one-hundred),tst-tls-manydynamic$(n)mod)
570 tst-tls-many-dynamic-modules-dep-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 \
571 14 15 16 17 18 19
572 tst-tls-many-dynamic-modules-dep = \
573 $(foreach n,$(tst-tls-many-dynamic-modules-dep-suffixes),tst-tls-manydynamic$(n)mod-dep)
574 tst-tls-many-dynamic-modules-dep-bad-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
575 tst-tls-many-dynamic-modules-dep-bad = \
576 $(foreach n,$(tst-tls-many-dynamic-modules-dep-bad-suffixes),tst-tls-manydynamic$(n)mod-dep-bad)
577 extra-test-objs += \
578 $(tlsmod17a-modules:=.os) \
579 $(tlsmod18a-modules:=.os) \
580 tst-tlsalign-vars.o \
581 # extra-test-objs
582 test-extras += \
583 tst-tlsalign-vars \
584 tst-tlsmod17a \
585 tst-tlsmod18a \
586 # test-extras
587 modules-names = \
588 circlemod1 \
589 circlemod1a \
590 circlemod2 \
591 circlemod2a \
592 circlemod3 \
593 circlemod3a \
594 constload2 \
595 constload3 \
596 dblloadmod1 \
597 dblloadmod2 \
598 dblloadmod3 \
599 dep1 \
600 dep2 \
601 dep3 \
602 dep4 \
603 failobj \
604 filtmod1 \
605 filtmod2 \
606 firstobj \
607 globalmod1 \
608 libmarkermod1-1 \
609 libmarkermod1-2 \
610 libmarkermod1-3 \
611 libmarkermod2-1 \
612 libmarkermod2-2 \
613 libmarkermod3-1 \
614 libmarkermod3-2 \
615 libmarkermod3-3 \
616 libmarkermod4-1 \
617 libmarkermod4-2 \
618 libmarkermod4-3 \
619 libmarkermod4-4 \
620 ltglobmod1 \
621 ltglobmod2 \
622 neededobj1 \
623 neededobj2 \
624 neededobj3 \
625 neededobj4 \
626 neededobj5 \
627 neededobj6 \
628 nextmod1 \
629 nextmod2 \
630 nodel2mod1 \
631 nodel2mod2 \
632 nodel2mod3 \
633 nodelmod1 \
634 nodelmod2 \
635 nodelmod3 \
636 nodelmod4 \
637 nodlopenmod \
638 nodlopenmod2 \
639 order2mod1 \
640 order2mod2 \
641 order2mod3 \
642 order2mod4 \
643 pathoptobj \
644 reldep4mod1 \
645 reldep4mod2 \
646 reldep4mod3 \
647 reldep4mod4 \
648 reldep6mod0 \
649 reldep6mod1 \
650 reldep6mod2 \
651 reldep6mod3 \
652 reldep6mod4 \
653 reldep7mod1 \
654 reldep7mod2 \
655 reldep8mod1 \
656 reldep8mod2 \
657 reldep8mod3 \
658 reldep9mod1 \
659 reldep9mod2 \
660 reldep9mod3 \
661 reldepmod1 \
662 reldepmod2 \
663 reldepmod3 \
664 reldepmod4 \
665 reldepmod5 \
666 reldepmod6 \
667 testobj1 \
668 testobj1_1 \
669 testobj2 \
670 testobj3 \
671 testobj4 \
672 testobj5 \
673 testobj6 \
674 tst-absolute-sym-lib \
675 tst-absolute-zero-lib \
676 tst-alignmod \
677 tst-alignmod2 \
678 tst-alignmod3 \
679 tst-array2dep \
680 tst-array5dep \
681 tst-audit11mod1 \
682 tst-audit11mod2 \
683 tst-audit12mod1 \
684 tst-audit12mod2 \
685 tst-audit12mod3 \
686 tst-audit13mod1 \
687 tst-audit18mod \
688 tst-audit19bmod \
689 tst-audit23mod \
690 tst-audit24amod1 \
691 tst-audit24amod2 \
692 tst-audit24bmod1 \
693 tst-audit24bmod2 \
694 tst-audit24dmod1 \
695 tst-audit24dmod2 \
696 tst-audit24dmod3 \
697 tst-audit24dmod4 \
698 tst-audit25mod1 \
699 tst-audit25mod2 \
700 tst-audit25mod3 \
701 tst-audit25mod4 \
702 tst-auditlogmod-1 \
703 tst-auditlogmod-2 \
704 tst-auditlogmod-3 \
705 tst-auditmanymod1 \
706 tst-auditmanymod2 \
707 tst-auditmanymod3 \
708 tst-auditmanymod4 \
709 tst-auditmanymod5 \
710 tst-auditmanymod6 \
711 tst-auditmanymod7 \
712 tst-auditmanymod8 \
713 tst-auditmanymod9 \
714 tst-auditmod1 \
715 tst-auditmod9a \
716 tst-auditmod9b \
717 tst-auditmod11 \
718 tst-auditmod12 \
719 tst-auditmod18 \
720 tst-auditmod19a \
721 tst-auditmod19b \
722 tst-auditmod20 \
723 tst-auditmod21a \
724 tst-auditmod21b \
725 tst-auditmod22 \
726 tst-auditmod23 \
727 tst-auditmod24a \
728 tst-auditmod24b \
729 tst-auditmod24c \
730 tst-auditmod24d \
731 tst-auditmod25 \
732 tst-auxvalmod \
733 tst-big-note-lib \
734 tst-deep1mod1 \
735 tst-deep1mod2 \
736 tst-deep1mod3 \
737 tst-dl_find_object-mod1 \
738 tst-dl_find_object-mod2 \
739 tst-dl_find_object-mod3 \
740 tst-dl_find_object-mod4 \
741 tst-dl_find_object-mod5 \
742 tst-dl_find_object-mod6 \
743 tst-dl_find_object-mod7 \
744 tst-dl_find_object-mod8 \
745 tst-dl_find_object-mod9 \
746 tst-dlmopen1mod \
747 tst-dlmopen-dlerror-mod \
748 tst-dlmopen-gethostbyname-mod \
749 tst-dlopenfaillinkmod \
750 tst-dlopenfailmod1 \
751 tst-dlopenfailmod2 \
752 tst-dlopenfailmod3 \
753 tst-dlopenfailnodelmod \
754 tst-dlopenrpathmod \
755 tst-filterobj-aux \
756 tst-filterobj-filtee \
757 tst-filterobj-flt \
758 tst-finilazyfailmod \
759 tst-globalmod2 \
760 tst-initlazyfailmod \
761 tst-initorder2a \
762 tst-initorder2b \
763 tst-initorder2c \
764 tst-initorder2d \
765 tst-initordera1 \
766 tst-initordera2 \
767 tst-initordera3 \
768 tst-initordera4 \
769 tst-initorderb1 \
770 tst-initorderb2 \
771 tst-latepthreadmod \
772 tst-ldconfig-ld-mod \
773 tst-main1mod \
774 tst-nodelete2mod \
775 tst-nodelete-dlclose-dso \
776 tst-nodelete-dlclose-plugin \
777 tst-nodelete-opened-lib \
778 tst-null-argv-lib \
779 tst-p_alignmod-base \
780 tst-p_alignmod3 \
781 tst-relsort1mod1 \
782 tst-relsort1mod2 \
783 tst-ro-dynamic-mod \
784 tst-single_threaded-mod1 \
785 tst-single_threaded-mod2 \
786 tst-single_threaded-mod3 \
787 tst-single_threaded-mod4 \
788 tst-sonamemove-linkmod1 \
789 tst-sonamemove-runmod1 \
790 tst-sonamemove-runmod2 \
791 tst-tls19mod1 \
792 tst-tls19mod2 \
793 tst-tls19mod3 \
794 tst-tls20mod-bad \
795 tst-tls21mod \
796 tst-tlsalign-lib \
797 tst-tls-ie-mod0 \
798 tst-tls-ie-mod1 \
799 tst-tls-ie-mod2 \
800 tst-tls-ie-mod3 \
801 tst-tls-ie-mod4 \
802 tst-tls-ie-mod5 \
803 tst-tls-ie-mod6 \
804 tst-tlsmod1 \
805 tst-tlsmod10 \
806 tst-tlsmod11 \
807 tst-tlsmod12 \
808 tst-tlsmod13 \
809 tst-tlsmod13a \
810 tst-tlsmod14a \
811 tst-tlsmod14b \
812 tst-tlsmod15a \
813 tst-tlsmod15b \
814 tst-tlsmod16a \
815 tst-tlsmod16b \
816 tst-tlsmod17b \
817 tst-tlsmod2 \
818 tst-tlsmod3 \
819 tst-tlsmod4 \
820 tst-tlsmod5 \
821 tst-tlsmod6 \
822 tst-tlsmod7 \
823 tst-tlsmod8 \
824 tst-tlsmod9 \
825 tst-unique1mod1 \
826 tst-unique1mod2 \
827 tst-unique2mod1 \
828 tst-unique2mod2 \
829 tst-unwind-ctor-lib \
830 unload2dep \
831 unload2mod \
832 unload3mod1 \
833 unload3mod2 \
834 unload3mod3 \
835 unload3mod4 \
836 unload4mod1 \
837 unload4mod2 \
838 unload4mod3 \
839 unload4mod4 \
840 unload6mod1 \
841 unload6mod2 \
842 unload6mod3 \
843 unload7mod1 \
844 unload7mod2 \
845 unload8mod1 \
846 unload8mod1x \
847 unload8mod2 \
848 unload8mod3 \
849 unloadmod \
850 vismod1 \
851 vismod2 \
852 vismod3 \
853 # modules-names
855 modules-names-cxx = \
856 tst-dlopen-nodelete-reloc-mod1 \
857 tst-dlopen-nodelete-reloc-mod10 \
858 tst-dlopen-nodelete-reloc-mod11 \
859 tst-dlopen-nodelete-reloc-mod12 \
860 tst-dlopen-nodelete-reloc-mod13 \
861 tst-dlopen-nodelete-reloc-mod14 \
862 tst-dlopen-nodelete-reloc-mod15 \
863 tst-dlopen-nodelete-reloc-mod16 \
864 tst-dlopen-nodelete-reloc-mod17 \
865 tst-dlopen-nodelete-reloc-mod2 \
866 tst-dlopen-nodelete-reloc-mod3 \
867 tst-dlopen-nodelete-reloc-mod4 \
868 tst-dlopen-nodelete-reloc-mod5 \
869 tst-dlopen-nodelete-reloc-mod6 \
870 tst-dlopen-nodelete-reloc-mod7 \
871 tst-dlopen-nodelete-reloc-mod8 \
872 tst-dlopen-nodelete-reloc-mod9 \
873 tst-nodelete-rtldmod \
874 tst-nodelete-uniquemod \
875 tst-nodelete-zmod \
876 tst-unique3lib \
877 tst-unique3lib2 \
878 tst-unique4lib \
879 # modules-names-cxx
881 modules-names += \
882 $(if $(CXX),$(modules-names-cxx)) \
883 $(modules-execstack-$(have-z-execstack)) \
884 $(tlsmod17a-modules) \
885 $(tlsmod18a-modules) \
886 $(tst-tls-many-dynamic-modules) \
887 $(tst-tls-many-dynamic-modules-dep) \
888 $(tst-tls-many-dynamic-modules-dep-bad) \
889 # modules-names
891 # Most modules build with _ISOMAC defined, but those filtered out
892 # depend on internal headers.
893 modules-names-tests = $(filter-out ifuncmod% tst-tlsmod%,\
894 $(modules-names))
896 # For +depfiles in Makerules.
897 extra-test-objs += tst-auditmod17.os
899 ifeq (yes,$(have-mtls-dialect-gnu2))
900 tests += tst-gnu2-tls1
901 modules-names += tst-gnu2-tls1mod
902 $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
903 tst-gnu2-tls1mod.so-no-z-defs = yes
904 CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
906 tests += tst-audit-tlsdesc tst-audit-tlsdesc-dlopen
907 modules-names += tst-audit-tlsdesc-mod1 tst-audit-tlsdesc-mod2 tst-auditmod-tlsdesc
908 $(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
909 $(objpfx)tst-audit-tlsdesc-mod2.so \
910 $(shared-thread-library)
911 CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
912 CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
913 $(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
914 $(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
915 $(objpfx)tst-audit-tlsdesc-mod2.so
916 $(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
917 $(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
918 tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
919 $(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
920 tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
921 endif
922 ifeq (yes,$(have-protected-data))
923 modules-names += tst-protected1moda tst-protected1modb
924 tests += tst-protected1a tst-protected1b
925 $(objpfx)tst-protected1a: $(addprefix $(objpfx),tst-protected1moda.so tst-protected1modb.so)
926 $(objpfx)tst-protected1b: $(addprefix $(objpfx),tst-protected1modb.so tst-protected1moda.so)
927 tst-protected1modb.so-no-z-defs = yes
928 # These tests fail with GCC versions prior to 5.1 and with some versions
929 # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
930 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
931 # Perhaps in future we can make these XFAILs conditional on some detection
932 # of compiler/linker behavior/version.
933 test-xfail-tst-protected1a = yes
934 test-xfail-tst-protected1b = yes
935 endif
936 ifeq (yesyes,$(have-fpie)$(build-shared))
937 modules-names += tst-piemod1
938 tests += tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \
939 tst-dlopen-self-pie
940 tests-pie += tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie
941 ifeq (yes,$(have-protected-data))
942 tests += vismain
943 tests-pie += vismain
944 CFLAGS-vismain.c += $(PIE-ccflag)
945 endif
946 endif
947 modules-execstack-yes = tst-execstack-mod
948 extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
950 # filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special
951 # rules.
952 modules-names-nobuild := filtmod1 tst-big-note-lib tst-ro-dynamic-mod \
953 tst-audit24bmod1 tst-audit24bmod2
955 tests += $(tests-static)
957 ifeq (yes,$(have-ifunc))
958 tests-ifuncstatic := \
959 ifuncmain1static \
960 ifuncmain1picstatic \
961 ifuncmain2static \
962 ifuncmain2picstatic \
963 ifuncmain4static \
964 ifuncmain4picstatic \
965 ifuncmain5static \
966 ifuncmain5picstatic \
967 ifuncmain7static \
968 ifuncmain7picstatic \
969 # tests-ifuncstatic
970 ifeq (yes,$(have-gcc-ifunc))
971 tests-ifuncstatic += ifuncmain9static ifuncmain9picstatic
972 endif
973 tests-static += $(tests-ifuncstatic)
974 tests-internal += $(tests-ifuncstatic)
975 ifeq (yes,$(build-shared))
976 tests += \
977 tst-ifunc-fault-bindnow \
978 tst-ifunc-fault-lazy \
979 # tests
980 # Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8.
981 tests-internal += \
982 ifuncmain1pic \
983 ifuncmain1staticpic \
984 ifuncmain1vis \
985 ifuncmain1vispic \
986 ifuncmain2 \
987 ifuncmain2pic \
988 ifuncmain3 \
989 ifuncmain4 \
990 ifuncmain5staticpic \
991 ifuncmain7 \
992 ifuncmain7pic \
993 # tests-internal
994 ifeq (no,$(with-lld))
995 tests-internal += \
996 ifuncmain1 \
997 ifuncmain5 \
998 ifuncmain5pic \
999 # tests-internal
1000 endif
1001 ifeq (yes,$(have-gcc-ifunc))
1002 tests-internal += \
1003 ifuncmain9 \
1004 ifuncmain9pic \
1005 # tests-internal
1006 endif
1007 ifunc-test-modules = \
1008 ifuncdep1 \
1009 ifuncdep1pic \
1010 ifuncdep2 \
1011 ifuncdep2pic \
1012 ifuncdep5 \
1013 ifuncdep5pic \
1014 # ifunc-test-modules
1015 extra-test-objs += $(ifunc-test-modules:=.o)
1016 test-internal-extras += $(ifunc-test-modules)
1017 ifeq (yes,$(have-fpie))
1018 ifunc-pie-tests = \
1019 ifuncmain1pie \
1020 ifuncmain1staticpie \
1021 ifuncmain1vispie \
1022 ifuncmain6pie \
1023 ifuncmain7pie \
1024 # ifunc-pie-tests
1025 ifeq (yes,$(have-gcc-ifunc))
1026 ifunc-pie-tests += ifuncmain9pie
1027 endif
1028 ifeq (no,$(with-lld))
1029 ifunc-pie-tests += ifuncmain5pie
1030 endif
1031 ifeq (yes,$(have-textrel_ifunc))
1032 ifunc-pie-tests += tst-ifunc-textrel
1033 endif
1034 tests-internal += $(ifunc-pie-tests)
1035 tests-pie += $(ifunc-pie-tests)
1036 endif
1037 modules-names += \
1038 ifuncmod1 \
1039 ifuncmod3 \
1040 ifuncmod6 \
1041 # module-names
1042 ifeq (no,$(with-lld))
1043 modules-names += ifuncmod5
1044 endif
1045 endif
1046 endif
1048 ifeq (yes,$(build-shared))
1049 ifeq ($(run-built-tests),yes)
1050 tests-special += \
1051 $(objpfx)argv0test.out \
1052 $(objpfx)tst-pathopt.out \
1053 $(objpfx)tst-rtld-help.out \
1054 $(objpfx)tst-rtld-load-self.out \
1055 $(objpfx)tst-rtld-preload.out \
1056 # tests-special
1057 endif
1058 tests-special += \
1059 $(objpfx)check-execstack.out \
1060 $(objpfx)check-initfini.out \
1061 $(objpfx)check-localplt.out \
1062 $(objpfx)check-textrel.out \
1063 $(objpfx)check-wx-segment.out \
1064 # tests-special
1065 endif
1067 ifeq ($(run-built-tests),yes)
1068 tests-special += \
1069 $(objpfx)order-cmp.out \
1070 $(objpfx)order2-cmp.out \
1071 $(objpfx)tst-array1-cmp.out \
1072 $(objpfx)tst-array1-static-cmp.out \
1073 $(objpfx)tst-array2-cmp.out \
1074 $(objpfx)tst-array3-cmp.out \
1075 $(objpfx)tst-array4-cmp.out \
1076 $(objpfx)tst-array5-cmp.out \
1077 $(objpfx)tst-array5-static-cmp.out \
1078 $(objpfx)tst-initorder-cmp.out \
1079 $(objpfx)tst-initorder2-cmp.out \
1080 $(objpfx)tst-unused-dep-cmp.out \
1081 $(objpfx)tst-unused-dep.out \
1082 # tests-special
1083 endif
1085 ifndef avoid-generated
1086 # DSO sorting tests:
1087 # The dso-ordering-test.py script generates testcase source files in $(objpfx),
1088 # creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a
1089 # Makefile fragment to be included.
1090 define include_dsosort_tests
1091 $(objpfx)$(1).generated-makefile: $(1)
1092 $(PYTHON) $(..)scripts/dso-ordering-test.py \
1093 --description-file $$< --objpfx $(objpfx) --output-makefile $$@T
1094 mv $$@T $$@
1095 -include $(objpfx)$(1).generated-makefile
1096 endef
1097 endif
1099 postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \
1100 $(objpfx)/dso-sort-tests-2.generated-makefile
1102 # Generate from each testcase description file
1103 ifeq (yes,$(have-tunables))
1104 $(eval $(call include_dsosort_tests,dso-sort-tests-1.def))
1105 $(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
1106 endif
1108 check-abi: $(objpfx)check-abi-ld.out
1109 tests-special += $(objpfx)check-abi-ld.out
1110 update-abi: update-abi-ld
1111 update-all-abi: update-all-abi-ld
1113 # The test requires shared _and_ PIE because the executable
1114 # unit test driver must be able to link with the shared object
1115 # that is going to eventually go into an installed DSO.
1116 ifeq (yesyes,$(have-fpie)$(build-shared))
1117 tests-internal += tst-_dl_addr_inside_object
1118 tests-pie += tst-_dl_addr_inside_object
1119 $(objpfx)tst-_dl_addr_inside_object: $(objpfx)dl-addr-obj.os
1120 CFLAGS-tst-_dl_addr_inside_object.c += $(PIE-ccflag)
1121 endif
1123 # We can only test static libcrypt use if libcrypt has been built,
1124 # and either NSS crypto is not in use, or static NSS libraries are
1125 # available.
1126 ifeq ($(build-crypt),no)
1127 CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=0
1128 else
1129 ifeq ($(nss-crypt),no)
1130 CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=1
1131 else
1132 ifeq ($(static-nss-crypt),no)
1133 CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=0
1134 else
1135 CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=1
1136 endif
1137 endif
1138 endif
1140 include ../Rules
1142 ifeq (yes,$(build-shared))
1143 # Make sure these things are built in the `make lib' pass so they can be used
1144 # to run programs during the `make others' pass.
1145 lib-noranlib: $(objpfx)$(rtld-installed-name) \
1146 $(addprefix $(objpfx),$(extra-objs))
1147 endif
1149 # Command to link into a larger single relocatable object.
1150 reloc-link = $(LINK.o) -nostdlib -nostartfiles -r
1152 $(objpfx)sotruss-lib.so: $(shlib-lds)
1154 $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os)
1155 $(reloc-link) -o $@ $^
1157 # Link together the dynamic linker into a single relocatable object.
1158 # First we do a link against libc_pic.a just to get a link map,
1159 # and discard the object produced by that link. From the link map
1160 # we can glean all the libc modules that need to go into the dynamic
1161 # linker. Then we do a recursive make that goes into all the subdirs
1162 # those modules come from and builds special rtld-foo.os versions that
1163 # are compiled with special flags, and puts these modules into rtld-libc.a
1164 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
1166 # These symbols need to be stubbed out during symbol discovery because
1167 # their implementation is provided differently in rtld, and the symbol
1168 # discovery mechanism is not compatible with the libc implementation
1169 # when compiled for libc.
1170 rtld-stubbed-symbols = \
1171 __GI___pthread_disable_asynccancel \
1172 __GI___pthread_enable_asynccancel \
1173 __pthread_disable_asynccancel \
1174 __pthread_enable_asynccancel \
1175 calloc \
1176 free \
1177 malloc \
1178 realloc \
1179 # rtld-stubbed-symbols
1181 ifeq ($(have-ssp),yes)
1182 # rtld is not built with the stack protector, so these references will
1183 # go away in the rebuilds.
1184 rtld-stubbed-symbols += __stack_chk_fail __stack_chk_fail_local
1185 endif
1187 $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
1188 @-rm -f $@T
1189 for symbol in $(rtld-stubbed-symbols); do \
1190 echo ".globl $$symbol"; \
1191 echo "$$symbol:"; \
1192 done | $(CC) -o $@T.o $(ASFLAGS) -c -x assembler -
1193 $(reloc-link) -o $@.o $@T.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T
1194 rm -f %@T.o $@.o
1195 mv -f $@T $@
1197 # For lld, skip preceding addresses and values before matching the archive and the member.
1198 $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
1199 LC_ALL=C \
1200 sed -n 's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
1201 $< | \
1202 while read lib file; do \
1203 case $$lib in \
1204 libc_pic.a) \
1205 LC_ALL=C fgrep -l /$$file \
1206 $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \
1207 LC_ALL=C \
1208 sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
1209 ;; \
1210 */*.a) \
1211 echo rtld-$${lib%%/*} += $$file ;; \
1212 *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \
1213 esac; \
1214 done > $@T
1215 echo rtld-subdirs = `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
1216 | LC_ALL=C sort -u` >> $@T
1217 mv -f $@T $@
1219 $(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE
1220 $(MAKE) -f $< -f rtld-Rules
1222 $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a
1223 $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \
1224 -Wl,-Map,$@.map
1226 generated += librtld.map librtld.mk rtld-libc.a librtld.os.map
1228 z-now-yes = -Wl,-z,now
1230 $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
1231 # Link into a temporary file so that we don't touch $@ at all
1232 # if the sanity check below fails.
1233 $(LINK.o) -nostdlib -nostartfiles -shared -o $@.new \
1234 $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
1235 $(filter-out $(map-file),$^) $(load-map-file) \
1236 -Wl,-soname=$(rtld-installed-name) \
1237 -Wl,-defsym=_begin=0
1238 $(call after-link,$@.new)
1239 $(READELF) -s $@.new \
1240 | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
1241 mv -f $@.new $@
1243 ifeq (yes,$(build-shared))
1244 # interp.c exists just to get the runtime linker path into libc.so.
1245 $(objpfx)interp.os: $(common-objpfx)runtime-linker.h
1246 endif
1248 ifneq (ld.so,$(rtld-installed-name))
1249 # Make sure ld.so.1 exists in the build directory so we can link
1250 # against it.
1251 $(objpfx)$(rtld-installed-name): $(objpfx)ld.so
1252 $(make-link)
1253 generated += $(rtld-installed-name)
1254 endif
1256 # Build a file mentioning all trustworthy directories to look for shared
1257 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
1258 # add directories to the list by defining $(user-defined-trusted-dirs)
1259 # before starting make.
1260 $(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @:
1261 $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig
1262 $(make-target-directory)
1263 echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
1264 | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T};
1265 echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T}
1266 $(move-if-change) ${@:st=T} ${@:st=h}
1267 touch $@
1268 CPPFLAGS-dl-load.c += -I$(objpfx). -I$(csu-objpfx).
1270 ifeq (yes,$(build-shared))
1271 $(inst_rtlddir)/$(rtld-installed-name): $(objpfx)ld.so $(+force)
1272 $(make-target-directory)
1273 $(do-install-program)
1275 # Creates the relative /usr/bin/ld.so symbolic link.
1276 $(inst_bindir)/ld.so: $(inst_rtlddir)/$(rtld-installed-name)
1277 $(make-target-directory)
1278 $(make-link)
1280 # Special target called by parent to install just the dynamic linker.
1281 .PHONY: ldso_install
1282 ldso_install: $(inst_rtlddir)/$(rtld-installed-name)
1283 endif # $(build-shared)
1286 # Workarounds for ${exec_prefix} expansion in configure variables.
1287 # config.status cannot be used directly for processing ldd.bash.in or
1288 # expanding variables such as sysconfdir because the expansion
1289 # contains the literal string ${exec_prefix}, which is not valid in C
1290 # headers or installed shell scripts.
1292 ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
1293 -e 's%@VERSION@%$(version)%g' \
1294 -e 's|@PKGVERSION@|$(PKGVERSION)|g' \
1295 -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
1296 -e 's%@TEXTDOMAINDIR@%$(localedir)%g'
1298 ifeq ($(ldd-rewrite-script),no)
1299 define gen-ldd
1300 LC_ALL=C sed $(ldd-rewrite) < $< > $@.new
1301 endef
1302 else
1303 define gen-ldd
1304 LC_ALL=C sed $(ldd-rewrite) < $< \
1305 | LC_ALL=C sed -f $(patsubst $(..)/%,/%,$(..)$(ldd-rewrite-script)) > $@.new
1306 endef
1307 endif
1309 $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \
1310 $(common-objpfx)config.make
1311 $(gen-ldd)
1312 chmod 555 $@.new
1313 mv -f $@.new $@
1315 $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
1317 $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
1319 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
1320 CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
1321 -D'SLIBDIR="$(slibdir)"'
1322 libof-ldconfig = ldconfig
1323 CFLAGS-dl-cache.c += $(SYSCONF-FLAGS)
1324 CFLAGS-cache.c += $(SYSCONF-FLAGS)
1325 CFLAGS-rtld.c += $(SYSCONF-FLAGS)
1326 CFLAGS-dl-usage.c += $(SYSCONF-FLAGS) \
1327 -D'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1328 CFLAGS-dl-diagnostics.c += $(SYSCONF-FLAGS) \
1329 -D'PREFIX="$(prefix)"' \
1330 -D'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1332 cpp-srcs-left := $(all-rtld-routines:=.os)
1333 lib := rtld
1334 include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
1336 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
1337 generated += $(addsuffix .so,$(strip $(modules-names)))
1339 $(objpfx)testobj1_1.so: $(objpfx)testobj1.so
1340 $(objpfx)testobj2.so: $(objpfx)testobj1.so
1341 $(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so
1342 $(objpfx)failobj.so: $(objpfx)testobj6.so
1343 $(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so
1344 $(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so
1345 $(objpfx)dep4.so: $(objpfx)dep3.so
1346 $(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so
1347 $(objpfx)neededobj2.so: $(objpfx)neededobj1.so
1348 $(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so
1349 $(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
1350 $(objpfx)neededobj3.so
1351 $(objpfx)neededobj6.so: $(objpfx)neededobj5.so
1352 $(objpfx)unload2mod.so: $(objpfx)unload2dep.so
1353 $(objpfx)firstobj.so: $(shared-thread-library)
1354 $(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so
1355 $(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so
1356 $(objpfx)dblloadmod1.so: $(objpfx)dblloadmod3.so
1357 $(objpfx)dblloadmod2.so: $(objpfx)dblloadmod3.so
1358 $(objpfx)reldepmod5.so: $(objpfx)reldepmod2.so
1359 $(objpfx)reldepmod6.so: $(objpfx)reldepmod2.so
1360 $(objpfx)reldep6mod1.so: $(objpfx)reldep6mod0.so
1361 $(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so
1362 $(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so
1363 $(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so
1364 $(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so
1365 $(objpfx)tst-tlsmod8.so: $(objpfx)tst-tlsmod7.so
1366 $(objpfx)tst-tlsmod10.so: $(objpfx)tst-tlsmod9.so
1367 $(objpfx)tst-tlsmod12.so: $(objpfx)tst-tlsmod11.so
1368 $(objpfx)tst-tlsmod13a.so: $(objpfx)tst-tlsmod13.so
1369 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
1370 $(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so
1371 $(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so
1372 $(objpfx)tst-tls19mod1.so: $(objpfx)tst-tls19mod2.so $(objpfx)tst-tls19mod3.so
1373 $(objpfx)tst-tls19mod3.so: $(objpfx)ld.so
1374 $(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so
1375 $(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so
1376 $(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so
1377 $(objpfx)reldep9mod3.so: $(objpfx)reldep9mod1.so $(objpfx)reldep9mod2.so
1378 $(objpfx)unload3mod1.so: $(objpfx)unload3mod3.so
1379 $(objpfx)unload3mod2.so: $(objpfx)unload3mod3.so
1380 $(objpfx)unload3mod3.so: $(objpfx)unload3mod4.so
1381 $(objpfx)unload4mod1.so: $(objpfx)unload4mod2.so $(objpfx)unload4mod3.so
1382 $(objpfx)unload4mod2.so: $(objpfx)unload4mod4.so $(objpfx)unload4mod3.so
1383 $(objpfx)unload7mod2.so: $(objpfx)unload7mod1.so
1384 $(objpfx)unload8mod1.so: $(objpfx)unload8mod2.so
1385 $(objpfx)unload8mod2.so: $(objpfx)unload8mod3.so
1386 $(objpfx)tst-initordera2.so: $(objpfx)tst-initordera1.so
1387 $(objpfx)tst-initorderb2.so: $(objpfx)tst-initorderb1.so $(objpfx)tst-initordera2.so
1388 $(objpfx)tst-initordera3.so: $(objpfx)tst-initorderb2.so $(objpfx)tst-initorderb1.so
1389 $(objpfx)tst-initordera4.so: $(objpfx)tst-initordera3.so
1390 $(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-initorderb2.so
1391 $(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so
1392 $(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so
1393 $(objpfx)tst-nodelete-opened.out: $(objpfx)tst-nodelete-opened-lib.so
1395 $(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o
1396 $(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o
1398 tst-null-argv-ENV = LD_DEBUG=all LD_DEBUG_OUTPUT=$(objpfx)tst-null-argv.debug.out
1399 LDFLAGS-nodel2mod3.so = -Wl,--no-as-needed
1400 LDFLAGS-reldepmod5.so = -Wl,--no-as-needed
1401 LDFLAGS-reldep6mod1.so = -Wl,--no-as-needed
1402 LDFLAGS-reldep6mod4.so = -Wl,--no-as-needed
1403 LDFLAGS-reldep8mod3.so = -Wl,--no-as-needed
1404 LDFLAGS-unload4mod1.so = -Wl,--no-as-needed
1405 LDFLAGS-unload4mod2.so = -Wl,--no-as-needed
1406 LDFLAGS-tst-initorder = -Wl,--no-as-needed
1407 LDFLAGS-tst-initordera2.so = -Wl,--no-as-needed
1408 LDFLAGS-tst-initordera3.so = -Wl,--no-as-needed
1409 LDFLAGS-tst-initordera4.so = -Wl,--no-as-needed
1410 LDFLAGS-tst-initorderb2.so = -Wl,--no-as-needed
1411 LDFLAGS-tst-tlsmod5.so = -nostdlib -Wl,--no-as-needed
1412 LDFLAGS-tst-tlsmod6.so = -nostdlib -Wl,--no-as-needed
1414 testobj1.so-no-z-defs = yes
1415 testobj3.so-no-z-defs = yes
1416 testobj4.so-no-z-defs = yes
1417 testobj5.so-no-z-defs = yes
1418 testobj6.so-no-z-defs = yes
1419 failobj.so-no-z-defs = yes
1420 constload2.so-no-z-defs = yes
1421 constload3.so-no-z-defs = yes
1422 nodelmod1.so-no-z-defs = yes
1423 nodelmod2.so-no-z-defs = yes
1424 nodelmod4.so-no-z-defs = yes
1425 nodel2mod2.so-no-z-defs = yes
1426 reldepmod2.so-no-z-defs = yes
1427 reldepmod3.so-no-z-defs = yes
1428 reldepmod4.so-no-z-defs = yes
1429 reldep4mod4.so-no-z-defs = yes
1430 reldep4mod2.so-no-z-defs = yes
1431 ltglobmod2.so-no-z-defs = yes
1432 dblloadmod3.so-no-z-defs = yes
1433 tst-tlsmod1.so-no-z-defs = yes
1434 tst-tlsmod2.so-no-z-defs = yes
1435 tst-tlsmod3.so-no-z-defs = yes
1436 tst-tlsmod4.so-no-z-defs = yes
1437 tst-tlsmod7.so-no-z-defs = yes
1438 tst-tlsmod8.so-no-z-defs = yes
1439 tst-tlsmod9.so-no-z-defs = yes
1440 tst-tlsmod10.so-no-z-defs = yes
1441 tst-tlsmod12.so-no-z-defs = yes
1442 tst-tlsmod14a.so-no-z-defs = yes
1443 tst-tlsmod14b.so-no-z-defs = yes
1444 tst-tlsmod15a.so-no-z-defs = yes
1445 tst-tlsmod16b.so-no-z-defs = yes
1446 circlemod2.so-no-z-defs = yes
1447 circlemod3.so-no-z-defs = yes
1448 circlemod3a.so-no-z-defs = yes
1449 reldep8mod2.so-no-z-defs = yes
1450 reldep9mod1.so-no-z-defs = yes
1451 unload3mod4.so-no-z-defs = yes
1452 unload4mod1.so-no-z-defs = yes
1453 ifuncmod1.so-no-z-defs = yes
1454 ifuncmod5.so-no-z-defs = yes
1455 ifuncmod6.so-no-z-defs = yes
1456 tst-auditmod9a.so-no-z-defs = yes
1457 tst-auditmod9b.so-no-z-defs = yes
1458 tst-nodelete-uniquemod.so-no-z-defs = yes
1459 tst-nodelete-rtldmod.so-no-z-defs = yes
1460 tst-nodelete-zmod.so-no-z-defs = yes
1461 tst-nodelete2mod.so-no-z-defs = yes
1463 ifeq ($(build-shared),yes)
1464 # Build all the modules even when not actually running test programs.
1465 tests: $(test-modules)
1466 endif
1468 LDFLAGS-loadtest = -rdynamic
1470 $(objpfx)loadtest.out: $(test-modules)
1472 $(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
1473 $(objpfx)neededobj3.so
1475 $(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
1476 $(objpfx)neededobj3.so
1478 $(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
1479 $(objpfx)neededobj3.so $(objpfx)neededobj4.so
1481 $(objpfx)neededtest4: $(objpfx)neededobj1.so
1482 $(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so
1484 $(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so
1485 LDFLAGS-restest1 = -rdynamic
1487 LDFLAGS-restest2 = -rdynamic
1489 $(objpfx)restest1.out: $(test-modules)
1491 preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5
1492 $(objpfx)preloadtest: $(objpfx)testobj6.so
1493 LDFLAGS-preloadtest = -rdynamic
1494 $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so)
1495 preloadtest-ENV = \
1496 LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
1498 LDFLAGS-loadfail = -rdynamic
1500 $(objpfx)loadfail.out: $(objpfx)failobj.so $(objpfx)testobj1.so \
1501 $(objpfx)testobj2.so $(objpfx)testobj3.so \
1502 $(objpfx)testobj4.so $(objpfx)testobj5.so
1504 LDFLAGS-multiload = -rdynamic
1505 CFLAGS-multiload.c += -DOBJDIR=\"$(elf-objpfx)\"
1507 $(objpfx)multiload.out: $(objpfx)testobj1.so
1509 LDFLAGS-origtest = -rdynamic
1510 $(objpfx)origtest.out: $(objpfx)testobj1.so
1512 ifeq ($(have-thread-library),yes)
1513 $(objpfx)resolvfail: $(shared-thread-library)
1514 endif
1516 $(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so
1518 $(objpfx)circleload1.out: $(objpfx)circlemod1.so \
1519 $(objpfx)circlemod1a.so
1521 $(objpfx)circlemod1.so: $(objpfx)circlemod2.so
1522 $(objpfx)circlemod2.so: $(objpfx)circlemod3.so
1523 $(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so
1524 $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so
1526 $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so)
1528 $(objpfx)order-cmp.out: $(objpfx)order.out
1529 (echo "0123456789" | cmp $< -) > $@; \
1530 $(evaluate-test)
1532 $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so)
1533 $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
1534 vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)
1536 $(objpfx)noload: $(objpfx)testobj1.so
1537 LDFLAGS-noload = -rdynamic -Wl,--no-as-needed
1538 $(objpfx)noload.out: $(objpfx)testobj5.so
1540 $(objpfx)noload-mem.out: $(objpfx)noload.out
1541 $(common-objpfx)malloc/mtrace $(objpfx)noload.mtrace > $@; \
1542 $(evaluate-test)
1543 noload-ENV = MALLOC_TRACE=$(objpfx)noload.mtrace \
1544 LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
1546 LDFLAGS-nodelete = -rdynamic
1547 LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete
1548 LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete
1549 $(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \
1550 $(objpfx)nodelmod3.so
1552 LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen
1553 $(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so
1555 $(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so
1556 $(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so
1558 $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so
1559 $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \
1560 -L$(subst :, -L,$(rpath-link)) \
1561 -Wl,-rpath-link=$(rpath-link) \
1562 $< -Wl,-F,$(objpfx)filtmod2.so
1563 $(objpfx)filter: $(objpfx)filtmod1.so
1565 # This does not link against libc.
1566 CFLAGS-filtmod1.c += $(no-stack-protector)
1568 $(objpfx)unload.out: $(objpfx)unloadmod.so
1570 $(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so
1572 $(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so
1574 $(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so
1576 $(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so
1578 $(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so
1579 LDFLAGS-next = -Wl,--no-as-needed
1581 $(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so
1583 $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
1585 $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
1586 $(objpfx)pathoptobj.so
1587 $(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' \
1588 '$(run-program-env)'; \
1589 $(evaluate-test)
1591 $(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so
1592 $(SHELL) $^ '$(test-wrapper)' '$(test-wrapper-env)' > $@; \
1593 $(evaluate-test)
1595 tst-rtld-preload-OBJS = $(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
1596 $(objpfx)tst-rtld-preload.out: tst-rtld-preload.sh $(objpfx)ld.so \
1597 $(objpfx)preloadtest \
1598 $(preloadtest-preloads:%=$(objpfx)%.so)
1599 $(SHELL) $< $(objpfx)ld.so $(objpfx)preloadtest \
1600 '$(test-wrapper-env)' '$(run_program_env)' \
1601 '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@; \
1602 $(evaluate-test)
1604 $(objpfx)initfirst.out: $(objpfx)firstobj.so
1606 $(objpfx)global: $(objpfx)globalmod1.so
1607 $(objpfx)global.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so
1609 $(objpfx)dblload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
1611 $(objpfx)dblunload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
1613 $(objpfx)reldep5.out: $(objpfx)reldepmod5.so $(objpfx)reldepmod6.so
1615 $(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so
1617 $(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so
1619 $(objpfx)reldep8.out: $(objpfx)reldep8mod3.so
1621 LDFLAGS-nodel2mod2.so = -Wl,--enable-new-dtags,-z,nodelete
1622 $(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so
1624 $(objpfx)reldep9.out: $(objpfx)reldep9mod3.so
1626 $(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so
1628 $(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so
1630 $(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so
1632 $(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so
1634 $(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so
1636 $(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so
1638 $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
1640 $(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so
1642 $(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so
1644 $(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so
1646 $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so
1648 $(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so
1649 $(objpfx)tst-tls14.out: $(objpfx)tst-tlsmod14b.so
1651 $(objpfx)tst-tls15.out: $(objpfx)tst-tlsmod15a.so $(objpfx)tst-tlsmod15b.so
1653 $(objpfx)tst-tls-dlinfo.out: $(objpfx)tst-tlsmod2.so
1657 $(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so
1659 $(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so
1660 $(patsubst %,$(objpfx)%.os,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.os: tst-tlsmod17a.c
1661 $(compile-command.c) -DN=$*
1662 $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so
1663 $(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules))
1665 $(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules))
1666 $(patsubst %,$(objpfx)%.os,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c
1667 $(compile-command.c) -DN=$*
1668 $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so
1670 $(objpfx)tst-tls19.out: $(objpfx)tst-tls19mod1.so
1672 CFLAGS-tst-align.c += $(stack-align-test-flags)
1673 CFLAGS-tst-align2.c += $(stack-align-test-flags)
1674 CFLAGS-tst-alignmod.c += $(stack-align-test-flags)
1675 CFLAGS-tst-alignmod2.c += $(stack-align-test-flags)
1676 $(objpfx)tst-align.out: $(objpfx)tst-alignmod.so
1677 $(objpfx)tst-align2: $(objpfx)tst-alignmod2.so
1678 $(objpfx)tst-align3: $(objpfx)tst-alignmod3.so
1679 ifeq (yes,$(have-fpie))
1680 CFLAGS-tst-align3.c += $(PIE-ccflag)
1681 endif
1682 LDFLAGS-tst-align3 += -Wl,-z,max-page-size=0x200000
1683 LDFLAGS-tst-alignmod3.so += -Wl,-z,max-page-size=0x200000
1684 $(objpfx)tst-alignmod3.so: $(libsupport)
1686 $(objpfx)unload3.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \
1687 $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so
1689 $(objpfx)unload4.out: $(objpfx)unload4mod1.so $(objpfx)unload4mod3.so
1691 $(objpfx)unload5.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \
1692 $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so
1694 $(objpfx)unload6.out: $(objpfx)unload6mod1.so $(objpfx)unload6mod2.so \
1695 $(objpfx)unload6mod3.so
1697 $(objpfx)unload7.out: $(objpfx)unload7mod1.so $(objpfx)unload7mod2.so
1698 unload7-ENV = MALLOC_PERTURB_=85
1700 $(objpfx)unload8.out: $(objpfx)unload8mod1.so $(objpfx)unload8mod1x.so
1702 $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
1704 ifeq ($(have-z-execstack),yes)
1705 $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
1706 CPPFLAGS-tst-execstack.c += -DUSE_PTHREADS=0
1707 LDFLAGS-tst-execstack = -Wl,-z,noexecstack
1708 LDFLAGS-tst-execstack-mod.so = -Wl,-z,execstack
1710 $(objpfx)tst-execstack-needed: $(objpfx)tst-execstack-mod.so
1711 LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack
1713 LDFLAGS-tst-execstack-prog = -Wl,-z,execstack
1714 CFLAGS-tst-execstack-prog.c += -Wno-trampolines
1715 CFLAGS-tst-execstack-mod.c += -Wno-trampolines
1716 endif
1718 LDFLAGS-tst-array2 = -Wl,--no-as-needed
1719 LDFLAGS-tst-array5 = -Wl,--no-as-needed
1721 $(objpfx)tst-array1-cmp.out: tst-array1.exp $(objpfx)tst-array1.out
1722 cmp $^ > $@; \
1723 $(evaluate-test)
1725 $(objpfx)tst-array1-static-cmp.out: tst-array1.exp \
1726 $(objpfx)tst-array1-static.out
1727 cmp $^ > $@; \
1728 $(evaluate-test)
1730 $(objpfx)tst-array2: $(objpfx)tst-array2dep.so
1731 $(objpfx)tst-array2-cmp.out: tst-array2.exp $(objpfx)tst-array2.out
1732 cmp $^ > $@; \
1733 $(evaluate-test)
1735 $(objpfx)tst-array3-cmp.out: tst-array1.exp $(objpfx)tst-array3.out
1736 cmp $^ > $@; \
1737 $(evaluate-test)
1739 $(objpfx)tst-array4.out: $(objpfx)tst-array2dep.so
1740 $(objpfx)tst-array4-cmp.out: tst-array4.exp $(objpfx)tst-array4.out
1741 cmp $^ > $@; \
1742 $(evaluate-test)
1744 $(objpfx)tst-array5: $(objpfx)tst-array5dep.so
1745 $(objpfx)tst-array5-cmp.out: tst-array5.exp $(objpfx)tst-array5.out
1746 cmp $^ > $@; \
1747 $(evaluate-test)
1749 $(objpfx)tst-array5-static-cmp.out: tst-array5-static.exp \
1750 $(objpfx)tst-array5-static.out
1751 cmp $^ > $@; \
1752 $(evaluate-test)
1754 CFLAGS-tst-pie1.c += $(pie-ccflag)
1755 CFLAGS-tst-pie2.c += $(pie-ccflag)
1757 $(objpfx)tst-piemod1.so: $(libsupport)
1758 $(objpfx)tst-pie1: $(objpfx)tst-piemod1.so
1759 $(objpfx)tst-dlopen-pie.out: $(objpfx)tst-pie1
1761 ifeq (yes,$(build-shared))
1762 # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with
1763 # all-built-dso here.
1764 all-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
1765 $(filter-out $(common-objpfx)linkobj/libc.so, \
1766 $(sort $(wildcard $(addprefix $(common-objpfx), \
1767 */lib*.so \
1768 iconvdata/*.so))))
1770 $(all-built-dso:=.dyn): %.dyn: %
1771 @rm -f $@T
1772 LC_ALL=C $(READELF) -W -d $< > $@T
1773 test -s $@T
1774 mv -f $@T $@
1775 common-generated += $(all-built-dso:$(common-objpfx)%=%.dyn)
1777 $(objpfx)check-textrel.out: $(..)scripts/check-textrel.awk \
1778 $(all-built-dso:=.dyn)
1779 LC_ALL=C $(AWK) -f $^ > $@; \
1780 $(evaluate-test)
1781 generated += check-textrel.out
1783 $(objpfx)execstack-default: $(first-word $(wildcard $(sysdirs:%=%/stackinfo.h)))
1784 $(make-target-directory)
1785 { echo '#include <elf.h>'; \
1786 echo '#include <stackinfo.h>'; \
1787 echo '#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1788 echo '@@@execstack-no@@@'; \
1789 echo '#else'; \
1790 echo '@@@execstack-yes@@@'; \
1791 echo '#endif'; } | \
1792 $(CC) $(CFLAGS) $(CPPFLAGS) -E -x c-header - | \
1793 sed -n -e 's/^@@@\(.*\)@@@/\1/p' > $@T
1794 mv -f $@T $@
1795 generated += execstack-default
1797 $(all-built-dso:=.phdr): %.phdr: %
1798 @rm -f $@T
1799 LC_ALL=C $(READELF) -W -l $< > $@T
1800 test -s $@T
1801 mv -f $@T $@
1802 common-generated += $(all-built-dso:$(common-objpfx)%=%.phdr)
1804 $(objpfx)check-execstack.out: $(..)scripts/check-execstack.awk \
1805 $(objpfx)execstack-default \
1806 $(all-built-dso:=.phdr)
1807 LC_ALL=C $(AWK) -v "xfail=$(check-execstack-xfail)" -f $^ > $@; \
1808 $(evaluate-test)
1809 generated += check-execstack.out
1811 $(objpfx)check-wx-segment.out: $(..)scripts/check-wx-segment.py \
1812 $(all-built-dso:=.phdr)
1813 $(PYTHON) $^ --xfail="$(check-wx-segment-xfail)" > $@; \
1814 $(evaluate-test)
1815 generated += check-wx-segment.out
1817 $(objpfx)tst-dlmodcount.out: $(test-modules)
1819 $(all-built-dso:=.jmprel): %.jmprel: % Makefile
1820 @rm -f $@T
1821 LC_ALL=C $(READELF) -W -S -d -r $< > $@T
1822 test -s $@T
1823 mv -f $@T $@
1824 common-generated += $(all-built-dso:$(common-objpfx)%=%.jmprel)
1826 localplt-built-dso := $(addprefix $(common-objpfx),\
1827 libc.so \
1828 elf/ld.so \
1829 math/libm.so \
1830 dlfcn/libdl.so \
1831 resolv/libresolv.so \
1833 ifeq ($(build-mathvec),yes)
1834 localplt-built-dso += $(addprefix $(common-objpfx), mathvec/libmvec.so)
1835 endif
1836 ifeq ($(have-thread-library),yes)
1837 localplt-built-dso += $(filter-out %_nonshared.a, $(shared-thread-library))
1838 endif
1839 ifeq ($(build-crypt),yes)
1840 localplt-built-dso += $(addprefix $(common-objpfx), crypt/libcrypt.so)
1841 endif
1842 ifneq ($(pthread-in-libc),yes)
1843 localplt-built-dso += $(addprefix $(common-objpfx), rt/librt.so)
1844 endif
1846 vpath localplt.data $(+sysdep_dirs)
1848 $(objpfx)check-localplt.out: $(..)scripts/check-localplt.awk \
1849 $(..)scripts/localplt.awk \
1850 $(localplt-built-dso:=.jmprel) \
1851 localplt.data
1852 LC_ALL=C $(AWK) -f $(filter-out $< %localplt.data,$^) | \
1853 LC_ALL=C $(AWK) -f $< $(filter %localplt.data,$^) - \
1854 > $@; \
1855 $(evaluate-test)
1856 endif
1858 $(all-built-dso:=.dynsym): %.dynsym: %
1859 @rm -f $@T
1860 LC_ALL=C $(READELF) -W --dyn-syms $< > $@T
1861 test -s $@T
1862 mv -f $@T $@
1863 common-generated += $(all-built-dso:$(common-objpfx)%=%.dynsym)
1865 $(objpfx)check-initfini.out: $(..)scripts/check-initfini.awk \
1866 $(all-built-dso:=.dynsym)
1867 LC_ALL=C $(AWK) -f $^ > $@; \
1868 $(evaluate-test)
1869 generated += check-initfini.out
1871 $(objpfx)tst-dlopenrpath: $(objpfx)tst-dlopenrpathmod.so
1872 CFLAGS-tst-dlopenrpath.c += -DPFX=\"$(objpfx)\"
1873 LDFLAGS-tst-dlopenrpathmod.so += -Wl,-rpath,\$$ORIGIN/test-subdir
1874 $(objpfx)tst-dlopenrpath.out: $(objpfx)firstobj.so
1876 $(objpfx)tst-deep1mod2.so: $(objpfx)tst-deep1mod3.so
1877 $(objpfx)tst-deep1: $(objpfx)tst-deep1mod1.so
1878 $(objpfx)tst-deep1.out: $(objpfx)tst-deep1mod2.so
1879 LDFLAGS-tst-deep1 += -rdynamic
1880 tst-deep1mod3.so-no-z-defs = yes
1882 $(objpfx)tst-dlmopen1.out: $(objpfx)tst-dlmopen1mod.so
1884 $(objpfx)tst-dlmopen2.out: $(objpfx)tst-dlmopen1mod.so
1886 $(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so
1888 $(objpfx)tst-dlmopen4.out: $(objpfx)tst-dlmopen1mod.so
1890 $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so
1891 tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
1893 $(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so $(objpfx)tst-auditmod9b.so
1894 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1895 CFLAGS-tst-audit2.c += -fno-builtin
1896 tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
1898 $(objpfx)tst-audit9.out: $(objpfx)tst-auditmod9a.so $(objpfx)tst-auditmod9b.so
1899 tst-audit9-ENV = LD_AUDIT=$(objpfx)tst-auditmod9a.so
1901 $(objpfx)tst-audit8: $(libm)
1902 $(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so
1903 tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
1905 $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so
1907 $(objpfx)tst-global2: $(objpfx)tst-globalmod2.so
1908 $(objpfx)tst-global2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so
1909 LDFLAGS-tst-global2 = -Wl,--enable-new-dtags
1910 LDFLAGS-tst-globalmod2.so = -Wl,--enable-new-dtags
1912 $(objpfx)order2.out: $(objpfx)order2mod1.so $(objpfx)order2mod2.so
1913 $(objpfx)order2-cmp.out: $(objpfx)order2.out
1914 (echo "12345" | cmp $< -) > $@; \
1915 $(evaluate-test)
1916 $(objpfx)order2mod1.so: $(objpfx)order2mod4.so
1917 $(objpfx)order2mod4.so: $(objpfx)order2mod3.so
1918 $(objpfx)order2mod2.so: $(objpfx)order2mod3.so
1919 order2mod2.so-no-z-defs = yes
1920 LDFLAGS-order2mod1.so = -Wl,--no-as-needed
1921 LDFLAGS-order2mod2.so = -Wl,--no-as-needed
1923 tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
1924 tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
1926 tst-ptrguard1-ARGS = --command "$(host-test-program-cmd) --child"
1927 # When built statically, the pointer guard interface uses
1928 # __pointer_chk_guard_local.
1929 CFLAGS-tst-ptrguard1-static.c += -DPTRGUARD_LOCAL
1930 tst-ptrguard1-static-ARGS = --command "$(objpfx)tst-ptrguard1-static --child"
1932 $(objpfx)tst-leaks1-mem.out: $(objpfx)tst-leaks1.out
1933 $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@; \
1934 $(evaluate-test)
1936 tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace \
1937 LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
1939 $(objpfx)tst-thrlock: $(shared-thread-library)
1940 $(objpfx)tst-thrlock.out: $(libm)
1941 $(objpfx)tst-noload.out: $(libm)
1943 tst-tst-dlopen-tlsmodid-no-pie = yes
1944 $(objpfx)tst-dlopen-tlsmodid: $(shared-thread-library)
1945 $(objpfx)tst-dlopen-tlsmodid.out: $(objpfx)tst-dlopen-self
1946 CFLAGS-tst-dlopen-tlsmodid-pie.c += $(pie-ccflag)
1947 $(objpfx)tst-dlopen-tlsmodid-pie: $(shared-thread-library)
1948 $(objpfx)tst-dlopen-tlsmodid-pie.out: $(objpfx)tst-dlopen-self-pie
1949 $(objpfx)tst-dlopen-tlsmodid-container: $(shared-thread-library)
1950 LDFLAGS-tst-dlopen-tlsmodid-container += -Wl,-rpath,\$$ORIGIN
1952 tst-tst-dlopen-self-no-pie = yes
1953 CFLAGS-tst-dlopen-self-pie.c += $(pie-ccflag)
1954 LDFLAGS-tst-dlopen-self-container += -Wl,-rpath,\$$ORIGIN
1956 CFLAGS-ifuncmain1pic.c += $(pic-ccflag)
1957 CFLAGS-ifuncmain1picstatic.c += $(pic-ccflag)
1958 CFLAGS-ifuncmain1staticpic.c += $(pic-ccflag)
1959 CFLAGS-ifuncdep1pic.c += $(pic-ccflag)
1960 CFLAGS-ifuncmain1vispic.c += $(pic-ccflag)
1961 CFLAGS-ifuncmain2pic.c += $(pic-ccflag)
1962 CFLAGS-ifuncmain2picstatic.c += $(pic-ccflag)
1963 CFLAGS-ifuncdep2pic.c += $(pic-ccflag)
1964 CFLAGS-ifuncmain4picstatic.c += $(pic-ccflag)
1965 CFLAGS-ifuncmain5pic.c += $(pic-ccflag)
1966 CFLAGS-ifuncmain5picstatic.c += $(pic-ccflag)
1967 CFLAGS-ifuncmain5staticpic.c += $(pic-ccflag)
1968 CFLAGS-ifuncdep5pic.c += $(pic-ccflag)
1969 CFLAGS-ifuncmain7pic.c += $(pic-ccflag)
1970 CFLAGS-ifuncmain7picstatic.c += $(pic-ccflag)
1971 CFLAGS-ifuncmain9pic.c += $(pic-ccflag)
1972 CFLAGS-ifuncmain9picstatic.c += $(pic-ccflag)
1974 LDFLAGS-ifuncmain3 = -Wl,-export-dynamic
1976 CFLAGS-ifuncmain1pie.c += $(pie-ccflag)
1977 CFLAGS-ifuncmain1vispie.c += $(pie-ccflag)
1978 CFLAGS-ifuncmain1staticpie.c += $(pie-ccflag)
1979 CFLAGS-ifuncmain5pie.c += $(pie-ccflag)
1980 CFLAGS-ifuncmain6pie.c += $(pie-ccflag)
1981 CFLAGS-ifuncmain7pie.c += $(pie-ccflag)
1982 CFLAGS-ifuncmain9pie.c += $(pie-ccflag)
1983 CFLAGS-tst-ifunc-textrel.c += $(pic-ccflag)
1985 LDFLAGS-ifuncmain6pie = -Wl,-z,lazy
1987 $(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so
1988 $(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o
1989 $(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so
1990 $(objpfx)ifuncmain5pie: $(objpfx)ifuncmod5.so
1991 $(objpfx)ifuncmain6pie: $(objpfx)ifuncmod6.so
1993 $(objpfx)ifuncmain1: $(addprefix $(objpfx),ifuncmod1.so)
1994 $(objpfx)ifuncmain1pic: $(addprefix $(objpfx),ifuncmod1.so)
1995 $(objpfx)ifuncmain1staticpic: $(addprefix $(objpfx),ifuncdep1pic.o)
1996 $(objpfx)ifuncmain1static: $(addprefix $(objpfx),ifuncdep1.o)
1997 $(objpfx)ifuncmain1picstatic: $(addprefix $(objpfx),ifuncdep1pic.o)
1998 $(objpfx)ifuncmain1vis: $(addprefix $(objpfx),ifuncmod1.so)
1999 $(objpfx)ifuncmain1vispic: $(addprefix $(objpfx),ifuncmod1.so)
2000 $(objpfx)ifuncmain2: $(addprefix $(objpfx),ifuncdep2.o)
2001 $(objpfx)ifuncmain2pic: $(addprefix $(objpfx),ifuncdep2pic.o)
2002 $(objpfx)ifuncmain2static: $(addprefix $(objpfx),ifuncdep2.o)
2003 $(objpfx)ifuncmain2picstatic: $(addprefix $(objpfx),ifuncdep2pic.o)
2005 $(objpfx)ifuncmain3.out: $(objpfx)ifuncmod3.so
2007 $(objpfx)ifuncmain5: $(addprefix $(objpfx),ifuncmod5.so)
2008 $(objpfx)ifuncmain5pic: $(addprefix $(objpfx),ifuncmod5.so)
2009 $(objpfx)ifuncmain5static: $(addprefix $(objpfx),ifuncdep5.o)
2010 $(objpfx)ifuncmain5staticpic: $(addprefix $(objpfx),ifuncdep5pic.o)
2011 $(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o)
2013 LDFLAGS-tst-ifunc-fault-lazy = -Wl,-z,lazy
2014 LDFLAGS-tst-ifunc-fault-bindnow = -Wl,-z,now
2015 define tst-ifunc-fault-script
2016 ( $(test-wrapper) $(rtld-prefix) --verify $^ \
2017 && $(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 $(rtld-prefix) $^ \
2018 && $(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 LD_DEBUG=unused \
2019 $(rtld-prefix) $^ \
2020 ) > $@; $(evaluate-test)
2021 endef
2022 $(objpfx)tst-ifunc-fault-lazy.out: $(objpfx)tst-ifunc-fault-lazy $(objpfx)ld.so
2023 $(tst-ifunc-fault-script)
2024 $(objpfx)tst-ifunc-fault-bindnow.out: $(objpfx)tst-ifunc-fault-bindnow \
2025 $(objpfx)ld.so
2026 $(tst-ifunc-fault-script)
2028 $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \
2029 $(objpfx)tst-unique1mod2.so
2031 $(objpfx)tst-unique2: $(objpfx)tst-unique2mod1.so
2032 $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so
2034 $(objpfx)tst-unique3: $(objpfx)tst-unique3lib.so
2035 $(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so
2037 $(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so
2039 $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \
2040 $(objpfx)tst-nodelete-rtldmod.so \
2041 $(objpfx)tst-nodelete-zmod.so
2043 LDFLAGS-tst-nodelete = -rdynamic
2044 LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete
2046 $(objpfx)tst-nodelete2.out: $(objpfx)tst-nodelete2mod.so
2048 LDFLAGS-tst-nodelete2 = -rdynamic
2050 $(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out
2051 cmp $^ > $@; \
2052 $(evaluate-test)
2054 $(objpfx)tst-initorder2: $(objpfx)tst-initorder2a.so $(objpfx)tst-initorder2d.so $(objpfx)tst-initorder2c.so
2055 $(objpfx)tst-initorder2a.so: $(objpfx)tst-initorder2b.so
2056 $(objpfx)tst-initorder2b.so: $(objpfx)tst-initorder2c.so
2057 $(objpfx)tst-initorder2c.so: $(objpfx)tst-initorder2d.so
2058 LDFLAGS-tst-initorder2 = -Wl,--no-as-needed
2059 LDFLAGS-tst-initorder2a.so = -Wl,--no-as-needed
2060 LDFLAGS-tst-initorder2b.so = -Wl,--no-as-needed
2061 LDFLAGS-tst-initorder2c.so = -Wl,--no-as-needed
2062 define o-iterator-doit
2063 $(objpfx)tst-initorder2$o.os: tst-initorder2.c; \
2064 $$(compile-command.c) -DNAME=\"$o\"
2065 endef
2066 object-suffixes-left := a b c d
2067 include $(o-iterator)
2069 $(objpfx)tst-initorder2-cmp.out: tst-initorder2.exp $(objpfx)tst-initorder2.out
2070 cmp $^ > $@; \
2071 $(evaluate-test)
2073 $(objpfx)tst-relsort1mod1.so: $(libm) $(objpfx)tst-relsort1mod2.so
2074 $(objpfx)tst-relsort1mod2.so: $(libm)
2075 $(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \
2076 $(objpfx)tst-relsort1mod2.so
2078 $(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so
2079 $(test-wrapper-env) \
2080 LD_TRACE_LOADED_OBJECTS=1 \
2081 LD_DEBUG=unused \
2082 LD_PRELOAD= \
2083 $(rtld-prefix) \
2084 $< > $@; \
2085 $(evaluate-test)
2087 $(objpfx)tst-unused-dep-cmp.out: $(objpfx)tst-unused-dep.out
2088 cmp $< /dev/null > $@; \
2089 $(evaluate-test)
2091 $(objpfx)tst-audit11.out: $(objpfx)tst-auditmod11.so $(objpfx)tst-audit11mod1.so
2092 tst-audit11-ENV = LD_AUDIT=$(objpfx)tst-auditmod11.so
2093 $(objpfx)tst-audit11mod1.so: $(objpfx)tst-audit11mod2.so
2094 LDFLAGS-tst-audit11mod2.so = -Wl,--version-script=tst-audit11mod2.map,-soname,tst-audit11mod2.so
2096 $(objpfx)tst-audit12.out: $(objpfx)tst-auditmod12.so $(objpfx)tst-audit12mod1.so $(objpfx)tst-audit12mod3.so
2097 tst-audit12-ENV = LD_AUDIT=$(objpfx)tst-auditmod12.so
2098 $(objpfx)tst-audit12mod1.so: $(objpfx)tst-audit12mod2.so
2099 LDFLAGS-tst-audit12mod2.so = -Wl,--version-script=tst-audit12mod2.map
2101 $(objpfx)tst-audit13.out: $(objpfx)tst-audit13mod1.so
2102 LDFLAGS-tst-audit13mod1.so = -Wl,-z,lazy
2103 tst-audit13-ENV = LD_AUDIT=$(objpfx)tst-audit13mod1.so
2105 $(objpfx)tst-auditmany.out: $(objpfx)tst-auditmanymod1.so \
2106 $(objpfx)tst-auditmanymod2.so $(objpfx)tst-auditmanymod3.so \
2107 $(objpfx)tst-auditmanymod4.so $(objpfx)tst-auditmanymod5.so \
2108 $(objpfx)tst-auditmanymod6.so $(objpfx)tst-auditmanymod7.so \
2109 $(objpfx)tst-auditmanymod8.so $(objpfx)tst-auditmanymod9.so
2110 tst-auditmany-ENV = \
2111 LD_AUDIT=tst-auditmanymod1.so:tst-auditmanymod2.so:tst-auditmanymod3.so:tst-auditmanymod4.so:tst-auditmanymod5.so:tst-auditmanymod6.so:tst-auditmanymod7.so:tst-auditmanymod8.so:tst-auditmanymod9.so
2113 LDFLAGS-tst-audit14 = -Wl,--audit=tst-auditlogmod-1.so,--disable-new-dtags
2114 $(objpfx)tst-auditlogmod-1.so: $(libsupport)
2115 $(objpfx)tst-audit14.out: $(objpfx)tst-auditlogmod-1.so
2116 LDFLAGS-tst-audit14a = -Wl,--audit=tst-auditlogmod-1.so,--enable-new-dtags
2117 $(objpfx)tst-audit14a.out: $(objpfx)tst-auditlogmod-1.so
2118 LDFLAGS-tst-audit15 = \
2119 -Wl,--audit=tst-auditlogmod-1.so,--depaudit=tst-auditlogmod-2.so
2120 $(objpfx)tst-auditlogmod-2.so: $(libsupport)
2121 $(objpfx)tst-audit15.out: \
2122 $(objpfx)tst-auditlogmod-1.so $(objpfx)tst-auditlogmod-2.so
2123 LDFLAGS-tst-audit16 = \
2124 -Wl,--audit=tst-auditlogmod-1.so:tst-auditlogmod-2.so \
2125 -Wl,--depaudit=tst-auditlogmod-3.so
2126 $(objpfx)tst-auditlogmod-3.so: $(libsupport)
2127 $(objpfx)tst-audit16.out: \
2128 $(objpfx)tst-auditlogmod-1.so $(objpfx)tst-auditlogmod-2.so \
2129 $(objpfx)tst-auditlogmod-3.so
2130 $(objpfx)tst-audit17.out: $(objpfx)tst-auditmod17.so
2131 # The test check if a audit library without libc.so on DT_NEEDED works as
2132 # intended, so it uses an explicit link rule.
2133 $(objpfx)tst-auditmod17.so: $(objpfx)tst-auditmod17.os
2134 $(CC) -nostdlib -nostartfiles -shared -o $@.new \
2135 $(filter-out $(map-file),$^)
2136 $(call after-link,$@.new)
2137 mv -f $@.new $@
2138 CFLAGS-.os += $(call elide-stack-protector,.os,tst-auditmod17)
2139 tst-audit17-ENV = LD_AUDIT=$(objpfx)tst-auditmod17.so
2141 $(objpfx)tst-audit14-cmp.out: tst-audit14.exp $(objpfx)tst-audit14.out
2142 cmp $^ > $@; \
2143 $(evaluate-test)
2144 $(objpfx)tst-audit14a-cmp.out: tst-audit14.exp $(objpfx)tst-audit14a.out
2145 cmp $^ > $@; \
2146 $(evaluate-test)
2147 $(objpfx)tst-audit15-cmp.out: tst-audit15.exp $(objpfx)tst-audit15.out
2148 cmp $^ > $@; \
2149 $(evaluate-test)
2150 $(objpfx)tst-audit16-cmp.out: tst-audit16.exp $(objpfx)tst-audit16.out
2151 cmp $^ > $@; \
2152 $(evaluate-test)
2154 $(objpfx)tst-audit18.out: $(objpfx)tst-auditmod18.so \
2155 $(objpfx)tst-audit18mod.so
2156 tst-audit18-ARGS = -- $(host-test-program-cmd)
2158 $(objpfx)tst-audit19a.out: $(objpfx)tst-auditmod19a.so
2159 tst-audit19a-ENV = LD_AUDIT=$(objpfx)tst-auditmod19a.so
2161 $(objpfx)tst-audit19b.out: $(objpfx)tst-auditmod19b.so
2162 $(objpfx)tst-audit19b: $(objpfx)tst-audit19bmod.so
2163 tst-audit19b-ARGS = -- $(host-test-program-cmd)
2165 $(objpfx)tst-audit20.out: $(objpfx)tst-auditmod20.so
2166 tst-audit20-ENV = LD_AUDIT=$(objpfx)tst-auditmod20.so
2168 $(objpfx)tst-audit21: $(shared-thread-library)
2169 $(objpfx)tst-audit21.out: $(objpfx)tst-auditmod21a.so
2170 $(objpfx)tst-auditmod21a.so: $(objpfx)tst-auditmod21b.so
2171 tst-audit21-ENV = LD_AUDIT=$(objpfx)tst-auditmod21a.so
2173 $(objpfx)tst-audit22.out: $(objpfx)tst-auditmod22.so
2174 tst-audit22-ARGS = -- $(host-test-program-cmd)
2176 $(objpfx)tst-audit23.out: $(objpfx)tst-auditmod23.so \
2177 $(objpfx)tst-audit23mod.so
2178 tst-audit23-ARGS = -- $(host-test-program-cmd)
2180 $(objpfx)tst-audit24a.out: $(objpfx)tst-auditmod24a.so
2181 $(objpfx)tst-audit24a: $(objpfx)tst-audit24amod1.so \
2182 $(objpfx)tst-audit24amod2.so
2183 tst-audit24a-ENV = LD_AUDIT=$(objpfx)tst-auditmod24a.so
2184 LDFLAGS-tst-audit24a = -Wl,-z,now
2186 $(objpfx)tst-audit24b.out: $(objpfx)tst-auditmod24b.so
2187 $(objpfx)tst-audit24b: $(objpfx)tst-audit24bmod1.so \
2188 $(objpfx)tst-audit24bmod2.so
2189 $(objpfx)tst-audit24bmod1: $(objpfx)tst-audit24bmod2.so
2190 # The test checks if a library without .gnu.version correctly calls the
2191 # audit callbacks. So it uses an explicit link rule to avoid linking
2192 # against libc.so.
2193 $(objpfx)tst-audit24bmod1.so: $(objpfx)tst-audit24bmod1.os
2194 $(CC) -nostdlib -nostartfiles -shared -o $@.new $(objpfx)tst-audit24bmod1.os \
2195 -Wl,-z,now
2196 $(call after-link,$@.new)
2197 mv -f $@.new $@
2198 CFLAGS-.os += $(call elide-stack-protector,.os,tst-audit24bmod1)
2199 $(objpfx)tst-audit24bmod2.so: $(objpfx)tst-audit24bmod2.os
2200 $(CC) -nostdlib -nostartfiles -shared -o $@.new $(objpfx)tst-audit24bmod2.os
2201 $(call after-link,$@.new)
2202 mv -f $@.new $@
2203 CFLAGS-.os += $(call elide-stack-protector,.os,tst-audit24bmod2)
2204 tst-audit24b-ENV = LD_AUDIT=$(objpfx)tst-auditmod24b.so
2205 LDFLAGS-tst-audit24b = -Wl,-z,now
2207 # Same as tst-audit24a, but tests LD_BIND_NOW
2208 $(objpfx)tst-audit24c.out: $(objpfx)tst-auditmod24c.so
2209 $(objpfx)tst-audit24c: $(objpfx)tst-audit24amod1.so \
2210 $(objpfx)tst-audit24amod2.so
2211 tst-audit24c-ENV = LD_BIND_NOW=1 LD_AUDIT=$(objpfx)tst-auditmod24c.so
2212 LDFLAGS-tst-audit24c = -Wl,-z,lazy
2214 $(objpfx)tst-audit24d.out: $(objpfx)tst-auditmod24d.so
2215 $(objpfx)tst-audit24d: $(objpfx)tst-audit24dmod1.so \
2216 $(objpfx)tst-audit24dmod2.so
2217 $(objpfx)tst-audit24dmod1.so: $(objpfx)tst-audit24dmod3.so
2218 LDFLAGS-tst-audit24dmod1.so = -Wl,-z,now
2219 $(objpfx)tst-audit24dmod2.so: $(objpfx)tst-audit24dmod4.so
2220 LDFLAGS-tst-audit24dmod2.so = -Wl,-z,lazy
2221 tst-audit24d-ENV = LD_AUDIT=$(objpfx)tst-auditmod24d.so
2222 LDFLAGS-tst-audit24d = -Wl,-z,lazy
2224 $(objpfx)tst-audit25a.out: $(objpfx)tst-auditmod25.so
2225 $(objpfx)tst-audit25a: $(objpfx)tst-audit25mod1.so \
2226 $(objpfx)tst-audit25mod2.so \
2227 $(objpfx)tst-audit25mod3.so \
2228 $(objpfx)tst-audit25mod4.so
2229 LDFLAGS-tst-audit25a = -Wl,-z,lazy
2230 $(objpfx)tst-audit25mod1.so: $(objpfx)tst-audit25mod3.so
2231 LDFLAGS-tst-audit25mod1.so = -Wl,-z,now
2232 $(objpfx)tst-audit25mod2.so: $(objpfx)tst-audit25mod4.so
2233 LDFLAGS-tst-audit25mod2.so = -Wl,-z,lazy
2234 tst-audit25a-ARGS = -- $(host-test-program-cmd)
2236 $(objpfx)tst-audit25b.out: $(objpfx)tst-auditmod25.so
2237 $(objpfx)tst-audit25b: $(objpfx)tst-audit25mod1.so \
2238 $(objpfx)tst-audit25mod2.so \
2239 $(objpfx)tst-audit25mod3.so \
2240 $(objpfx)tst-audit25mod4.so
2241 LDFLAGS-tst-audit25b = -Wl,-z,now
2242 tst-audit25b-ARGS = -- $(host-test-program-cmd)
2244 # tst-sonamemove links against an older implementation of the library.
2245 LDFLAGS-tst-sonamemove-linkmod1.so = \
2246 -Wl,--version-script=tst-sonamemove-linkmod1.map \
2247 -Wl,-soname,tst-sonamemove-runmod1.so
2248 LDFLAGS-tst-sonamemove-runmod1.so = -Wl,--no-as-needed \
2249 -Wl,--version-script=tst-sonamemove-runmod1.map \
2250 -Wl,-soname,tst-sonamemove-runmod1.so
2251 LDFLAGS-tst-sonamemove-runmod2.so = \
2252 -Wl,--version-script=tst-sonamemove-runmod2.map \
2253 -Wl,-soname,tst-sonamemove-runmod2.so
2254 $(objpfx)tst-sonamemove-runmod1.so: $(objpfx)tst-sonamemove-runmod2.so
2255 # Link against the link module, but depend on the run-time modules
2256 # for execution.
2257 $(objpfx)tst-sonamemove-link: $(objpfx)tst-sonamemove-linkmod1.so
2258 $(objpfx)tst-sonamemove-link.out: \
2259 $(objpfx)tst-sonamemove-runmod1.so \
2260 $(objpfx)tst-sonamemove-runmod2.so
2261 $(objpfx)tst-sonamemove-dlopen.out: \
2262 $(objpfx)tst-sonamemove-runmod1.so \
2263 $(objpfx)tst-sonamemove-runmod2.so
2265 $(objpfx)tst-dlmopen-dlerror-mod.so: $(libsupport)
2266 $(objpfx)tst-dlmopen-dlerror.out: $(objpfx)tst-dlmopen-dlerror-mod.so
2268 # Override -z defs, so that we can reference an undefined symbol.
2269 # Force lazy binding for the same reason.
2270 LDFLAGS-tst-latepthreadmod.so = \
2271 -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all
2272 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
2273 # function this_function_is_not_defined.
2274 CFLAGS-tst-latepthreadmod.c += -fno-optimize-sibling-calls
2275 $(objpfx)tst-latepthreadmod.so: $(shared-thread-library)
2276 $(objpfx)tst-latepthread.out: $(objpfx)tst-latepthreadmod.so
2278 # The test modules are parameterized by preprocessor macros.
2279 $(patsubst %,$(objpfx)%.os,$(tst-tls-many-dynamic-modules)): \
2280 $(objpfx)tst-tls-manydynamic%mod.os : tst-tls-manydynamicmod.c
2281 $(compile-command.c) \
2282 -DNAME=tls_global_$* -DSETTER=set_value_$* -DGETTER=get_value_$*
2283 $(objpfx)tst-tls-manydynamic: $(shared-thread-library)
2284 $(objpfx)tst-tls-manydynamic.out: \
2285 $(patsubst %,$(objpfx)%.so,$(tst-tls-many-dynamic-modules))
2287 $(objpfx)tst-ldconfig-X.out : tst-ldconfig-X.sh $(objpfx)ldconfig
2288 $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' \
2289 '$(run-program-env)' > $@; \
2290 $(evaluate-test)
2292 # Test static linking of all the libraries we can possibly link
2293 # together. Note that in some configurations this may be less than the
2294 # complete list of libraries we build but we try to maxmimize this list.
2295 ifeq ($(pthread-in-libc),no)
2296 $(objpfx)tst-linkall-static: \
2297 $(common-objpfx)resolv/libanl.a
2298 endif
2299 $(objpfx)tst-linkall-static: \
2300 $(common-objpfx)math/libm.a \
2301 $(common-objpfx)resolv/libresolv.a \
2302 $(common-objpfx)login/libutil.a \
2303 $(common-objpfx)rt/librt.a \
2304 $(static-thread-library)
2306 ifeq ($(build-crypt),yes)
2307 # If we are using NSS crypto and we have the ability to link statically
2308 # then we include libcrypt.a, otherwise we leave out libcrypt.a and
2309 # link as much as we can into the tst-linkall-static test. This assumes
2310 # that linking with libcrypt.a does everything required to include the
2311 # static NSS crypto library.
2312 ifeq (yesyes,$(nss-crypt)$(static-nss-crypt))
2313 $(objpfx)tst-linkall-static: \
2314 $(common-objpfx)crypt/libcrypt.a
2315 endif
2316 # If we are not using NSS crypto then we always have the ability to link
2317 # with libcrypt.a.
2318 ifeq (no,$(nss-crypt))
2319 $(objpfx)tst-linkall-static: \
2320 $(common-objpfx)crypt/libcrypt.a
2321 endif
2322 endif
2324 # The application depends on the DSO, and the DSO loads the plugin.
2325 # The plugin also depends on the DSO. This creates the circular
2326 # dependency via dlopen that we're testing to make sure works.
2327 $(objpfx)tst-nodelete-dlclose-plugin.so: $(objpfx)tst-nodelete-dlclose-dso.so
2328 $(objpfx)tst-nodelete-dlclose: $(objpfx)tst-nodelete-dlclose-dso.so
2329 $(objpfx)tst-nodelete-dlclose.out: $(objpfx)tst-nodelete-dlclose-dso.so \
2330 $(objpfx)tst-nodelete-dlclose-plugin.so
2332 tst-env-setuid-ENV = MALLOC_CHECK_=2 MALLOC_MMAP_THRESHOLD_=4096 \
2333 LD_HWCAP_MASK=0x1
2335 $(objpfx)tst-debug1.out: $(objpfx)tst-debug1mod1.so
2337 $(objpfx)tst-debug1mod1.so: $(objpfx)testobj1.so
2338 $(OBJCOPY) --only-keep-debug $< $@
2340 $(objpfx)tst-main1: $(objpfx)tst-main1mod.so
2341 CRT-tst-main1 := $(csu-objpfx)crt1.o
2342 tst-main1-no-pie = yes
2343 LDLIBS-tst-main1 = $(libsupport)
2344 tst-main1mod.so-no-z-defs = yes
2346 LDLIBS-tst-absolute-sym-lib.so = tst-absolute-sym-lib.lds
2347 $(objpfx)tst-absolute-sym-lib.so: $(LDLIBS-tst-absolute-sym-lib.so)
2348 $(objpfx)tst-absolute-sym: $(objpfx)tst-absolute-sym-lib.so
2350 LDLIBS-tst-absolute-zero-lib.so = tst-absolute-zero-lib.lds
2351 $(objpfx)tst-absolute-zero-lib.so: $(LDLIBS-tst-absolute-zero-lib.so)
2352 $(objpfx)tst-absolute-zero: $(objpfx)tst-absolute-zero-lib.so
2354 $(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so
2355 # Avoid creating an ABI tag note, which may come before the
2356 # artificial, large note in tst-big-note-lib.o and invalidate the
2357 # test.
2358 $(objpfx)tst-big-note-lib.so: $(objpfx)tst-big-note-lib.o
2359 $(LINK.o) -shared -o $@ $(LDFLAGS.so) $<
2361 $(objpfx)tst-unwind-ctor: $(objpfx)tst-unwind-ctor-lib.so
2363 CFLAGS-tst-unwind-main.c += -funwind-tables -DUSE_PTHREADS=0
2365 $(objpfx)tst-initfinilazyfail.out: \
2366 $(objpfx)tst-initlazyfailmod.so $(objpfx)tst-finilazyfailmod.so
2367 # Override -z defs, so that we can reference an undefined symbol.
2368 # Force lazy binding for the same reason.
2369 LDFLAGS-tst-initlazyfailmod.so = \
2370 -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all
2371 LDFLAGS-tst-finilazyfailmod.so = \
2372 -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all
2374 $(objpfx)tst-dlopenfail.out: \
2375 $(objpfx)tst-dlopenfailmod1.so $(objpfx)tst-dlopenfailmod2.so
2376 # Order matters here. tst-dlopenfaillinkmod.so's soname ensures a
2377 # run-time loader failure. --as-needed breaks this test because
2378 # nothing actually references tst-dlopenfailmod2.so (with its soname
2379 # tst-dlopenfail-missingmod.so).
2380 LDFLAGS-tst-dlopenfailmod1.so = -Wl,--no-as-needed
2381 $(objpfx)tst-dlopenfailmod1.so: \
2382 $(shared-thread-library) $(objpfx)tst-dlopenfaillinkmod.so
2383 LDFLAGS-tst-dlopenfaillinkmod.so = -Wl,-soname,tst-dlopenfail-missingmod.so
2384 $(objpfx)tst-dlopenfailmod2.so: $(objpfx)tst-dlopenfailnodelmod.so
2385 $(objpfx)tst-dlopenfail-2.out: \
2386 $(objpfx)tst-dlopenfailmod1.so $(objpfx)tst-dlopenfailmod2.so \
2387 $(objpfx)tst-dlopenfailmod3.so
2388 # tst-dlopenfailnodelmod.so emulates how libpthread was linked.
2389 $(objpfx)tst-dlopenfailnodelmod.so: $(libsupport)
2390 LDFLAGS-tst-dlopenfailnodelmod.so = \
2391 -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
2392 # tst-dlopenfail should export the libsupport symbols, so that
2393 # tst-dlopenfailnodelmod.so uses them for error reporting.
2394 LDFLAGS-tst-dlopenfail = -Wl,-E
2396 $(objpfx)tst-dlopen-nodelete-reloc.out: \
2397 $(objpfx)tst-dlopen-nodelete-reloc-mod1.so \
2398 $(objpfx)tst-dlopen-nodelete-reloc-mod2.so \
2399 $(objpfx)tst-dlopen-nodelete-reloc-mod3.so \
2400 $(objpfx)tst-dlopen-nodelete-reloc-mod4.so \
2401 $(objpfx)tst-dlopen-nodelete-reloc-mod5.so \
2402 $(objpfx)tst-dlopen-nodelete-reloc-mod6.so \
2403 $(objpfx)tst-dlopen-nodelete-reloc-mod7.so \
2404 $(objpfx)tst-dlopen-nodelete-reloc-mod8.so \
2405 $(objpfx)tst-dlopen-nodelete-reloc-mod9.so \
2406 $(objpfx)tst-dlopen-nodelete-reloc-mod10.so \
2407 $(objpfx)tst-dlopen-nodelete-reloc-mod11.so \
2408 $(objpfx)tst-dlopen-nodelete-reloc-mod12.so \
2409 $(objpfx)tst-dlopen-nodelete-reloc-mod13.so \
2410 $(objpfx)tst-dlopen-nodelete-reloc-mod14.so \
2411 $(objpfx)tst-dlopen-nodelete-reloc-mod15.so \
2412 $(objpfx)tst-dlopen-nodelete-reloc-mod16.so \
2413 $(objpfx)tst-dlopen-nodelete-reloc-mod17.so
2414 tst-dlopen-nodelete-reloc-mod2.so-no-z-defs = yes
2415 LDFLAGS-tst-dlopen-nodelete-reloc-mod2.so = -Wl,-z,nodelete
2416 $(objpfx)tst-dlopen-nodelete-reloc-mod4.so: \
2417 $(objpfx)tst-dlopen-nodelete-reloc-mod3.so
2418 LDFLAGS-tst-dlopen-nodelete-reloc-mod4.so = -Wl,--no-as-needed
2419 $(objpfx)tst-dlopen-nodelete-reloc-mod5.so: \
2420 $(objpfx)tst-dlopen-nodelete-reloc-mod4.so
2421 LDFLAGS-tst-dlopen-nodelete-reloc-mod5.so = -Wl,-z,nodelete,--no-as-needed
2422 tst-dlopen-nodelete-reloc-mod5.so-no-z-defs = yes
2423 tst-dlopen-nodelete-reloc-mod7.so-no-z-defs = yes
2424 tst-dlopen-nodelete-reloc-mod11.so-no-z-defs = yes
2425 $(objpfx)tst-dlopen-nodelete-reloc-mod13.so: \
2426 $(objpfx)tst-dlopen-nodelete-reloc-mod12.so
2427 $(objpfx)tst-dlopen-nodelete-reloc-mod15.so: \
2428 $(objpfx)tst-dlopen-nodelete-reloc-mod14.so
2429 tst-dlopen-nodelete-reloc-mod16.so-no-z-defs = yes
2430 $(objpfx)tst-dlopen-nodelete-reloc-mod16.so: \
2431 $(objpfx)tst-dlopen-nodelete-reloc-mod15.so
2432 LDFLAGS-tst-dlopen-nodelete-reloc-mod16.so = -Wl,--no-as-needed
2433 $(objpfx)tst-dlopen-nodelete-reloc-mod17.so: \
2434 $(objpfx)tst-dlopen-nodelete-reloc-mod15.so \
2435 $(objpfx)tst-dlopen-nodelete-reloc-mod16.so
2436 LDFLAGS-tst-dlopen-nodelete-reloc-mod17.so = -Wl,--no-as-needed
2438 $(objpfx)tst-ldconfig-ld_so_conf-update.out: $(objpfx)tst-ldconfig-ld-mod.so
2440 LDFLAGS-tst-filterobj-flt.so = -Wl,--filter=$(objpfx)tst-filterobj-filtee.so
2441 $(objpfx)tst-filterobj: $(objpfx)tst-filterobj-flt.so
2442 $(objpfx)tst-filterobj.out: $(objpfx)tst-filterobj-filtee.so
2443 $(objpfx)tst-filterobj-dlopen.out: $(objpfx)tst-filterobj-filtee.so
2445 LDFLAGS-tst-filterobj-aux.so = -Wl,--auxiliary=$(objpfx)tst-filterobj-filtee.so
2446 $(objpfx)tst-auxobj: $(objpfx)tst-filterobj-aux.so
2447 $(objpfx)tst-auxobj.out: $(objpfx)tst-filterobj-filtee.so
2448 $(objpfx)tst-auxobj-dlopen.out: $(objpfx)tst-filterobj-filtee.so
2450 $(objpfx)tst-single_threaded: $(objpfx)tst-single_threaded-mod1.so
2451 $(objpfx)tst-single_threaded.out: \
2452 $(objpfx)tst-single_threaded-mod2.so $(objpfx)tst-single_threaded-mod3.so
2453 $(objpfx)tst-single_threaded-static-dlopen: \
2454 $(objpfx)tst-single_threaded-mod1.o
2455 $(objpfx)tst-single_threaded-static-dlopen.out: \
2456 $(objpfx)tst-single_threaded-mod2.so
2457 $(objpfx)tst-single_threaded-pthread: \
2458 $(objpfx)tst-single_threaded-mod1.so $(shared-thread-library)
2459 $(objpfx)tst-single_threaded-pthread.out: \
2460 $(objpfx)tst-single_threaded-mod2.so $(objpfx)tst-single_threaded-mod3.so \
2461 $(objpfx)tst-single_threaded-mod4.so
2462 $(objpfx)tst-single_threaded-pthread-static: $(static-thread-library)
2464 $(objpfx)tst-tls-ie: $(shared-thread-library)
2465 $(objpfx)tst-tls-ie.out: \
2466 $(objpfx)tst-tls-ie-mod0.so \
2467 $(objpfx)tst-tls-ie-mod1.so \
2468 $(objpfx)tst-tls-ie-mod2.so \
2469 $(objpfx)tst-tls-ie-mod3.so \
2470 $(objpfx)tst-tls-ie-mod4.so \
2471 $(objpfx)tst-tls-ie-mod5.so \
2472 $(objpfx)tst-tls-ie-mod6.so
2474 $(objpfx)tst-tls-ie-dlmopen: $(shared-thread-library)
2475 $(objpfx)tst-tls-ie-dlmopen.out: \
2476 $(objpfx)tst-tls-ie-mod0.so \
2477 $(objpfx)tst-tls-ie-mod1.so \
2478 $(objpfx)tst-tls-ie-mod2.so \
2479 $(objpfx)tst-tls-ie-mod3.so \
2480 $(objpfx)tst-tls-ie-mod4.so \
2481 $(objpfx)tst-tls-ie-mod5.so \
2482 $(objpfx)tst-tls-ie-mod6.so
2484 $(objpfx)argv0test.out: tst-rtld-argv0.sh $(objpfx)ld.so \
2485 $(objpfx)argv0test
2486 $(SHELL) $< $(objpfx)ld.so $(objpfx)argv0test \
2487 '$(test-wrapper-env)' '$(run_program_env)' \
2488 '$(rpath-link)' 'test-argv0' > $@; \
2489 $(evaluate-test)
2491 # A list containing the name of the most likely searched subdirectory
2492 # of the glibc-hwcaps directory, for each supported architecture (in
2493 # other words, the oldest hardware level recognized by the
2494 # glibc-hwcaps mechanism for this architecture). Used to obtain test
2495 # coverage for some glibc-hwcaps tests for the widest possible range
2496 # of systems.
2497 glibc-hwcaps-first-subdirs-for-tests = power9 x86-64-v2 z13
2499 # The test modules are parameterized by preprocessor macros.
2500 LDFLAGS-libmarkermod1-1.so += -Wl,-soname,libmarkermod1.so
2501 LDFLAGS-libmarkermod2-1.so += -Wl,-soname,libmarkermod2.so
2502 LDFLAGS-libmarkermod3-1.so += -Wl,-soname,libmarkermod3.so
2503 LDFLAGS-libmarkermod4-1.so += -Wl,-soname,libmarkermod4.so
2504 $(objpfx)libmarkermod%.os : markermodMARKER-VALUE.c
2505 $(compile-command.c) \
2506 -DMARKER=marker$(firstword $(subst -, ,$*)) \
2507 -DVALUE=$(lastword $(subst -, ,$*))
2508 $(objpfx)libmarkermod1.so: $(objpfx)libmarkermod1-1.so
2509 cp $< $@
2510 $(objpfx)libmarkermod2.so: $(objpfx)libmarkermod2-1.so
2511 cp $< $@
2512 $(objpfx)libmarkermod3.so: $(objpfx)libmarkermod3-1.so
2513 cp $< $@
2514 $(objpfx)libmarkermod4.so: $(objpfx)libmarkermod4-1.so
2515 cp $< $@
2517 # tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is
2518 # preferred over auto-detected subdirectories.
2519 $(objpfx)tst-glibc-hwcaps-prepend: $(objpfx)libmarkermod1-1.so
2520 $(objpfx)glibc-hwcaps/prepend-markermod1/libmarkermod1.so: \
2521 $(objpfx)libmarkermod1-2.so
2522 $(make-target-directory)
2523 cp $< $@
2524 $(objpfx)glibc-hwcaps/%/libmarkermod1.so: $(objpfx)libmarkermod1-3.so
2525 $(make-target-directory)
2526 cp $< $@
2527 $(objpfx)tst-glibc-hwcaps-prepend.out: \
2528 $(objpfx)tst-glibc-hwcaps-prepend $(objpfx)libmarkermod1.so \
2529 $(patsubst %,$(objpfx)glibc-hwcaps/%/libmarkermod1.so,prepend-markermod1 \
2530 $(glibc-hwcaps-first-subdirs-for-tests))
2531 $(test-wrapper) $(rtld-prefix) \
2532 --glibc-hwcaps-prepend prepend-markermod1 \
2533 $< > $@; \
2534 $(evaluate-test)
2536 # Like tst-glibc-hwcaps-prepend, but uses a container and loads the
2537 # library via ld.so.cache. Test setup is contained in the test
2538 # itself.
2539 $(objpfx)tst-glibc-hwcaps-prepend-cache.out: \
2540 $(objpfx)tst-glibc-hwcaps-prepend-cache $(objpfx)libmarkermod1-1.so \
2541 $(objpfx)libmarkermod1-2.so $(objpfx)libmarkermod1-3.so
2543 # tst-glibc-hwcaps-mask checks that --glibc-hwcaps-mask can be used to
2544 # suppress all auto-detected subdirectories.
2545 $(objpfx)tst-glibc-hwcaps-mask: $(objpfx)libmarkermod1-1.so
2546 $(objpfx)tst-glibc-hwcaps-mask.out: \
2547 $(objpfx)tst-glibc-hwcaps-mask $(objpfx)libmarkermod1.so \
2548 $(patsubst %,$(objpfx)glibc-hwcaps/%/libmarkermod1.so,\
2549 $(glibc-hwcaps-first-subdirs-for-tests))
2550 $(test-wrapper) $(rtld-prefix) \
2551 --glibc-hwcaps-mask does-not-exist \
2552 $< > $@; \
2553 $(evaluate-test)
2555 # Generic dependency for sysdeps implementation of
2556 # tst-glibc-hwcaps-cache.
2557 $(objpfx)tst-glibc-hwcaps-cache.out: $(objpfx)tst-glibc-hwcaps
2559 $(objpfx)list-tunables.out: tst-rtld-list-tunables.sh $(objpfx)ld.so
2560 $(SHELL) $< $(objpfx)ld.so '$(test-wrapper-env)' \
2561 '$(run_program_env)' > $(objpfx)/tst-rtld-list-tunables.out
2562 cmp tst-rtld-list-tunables.exp \
2563 $(objpfx)/tst-rtld-list-tunables.out > $@; \
2564 $(evaluate-test)
2566 tst-dst-static-ENV = LD_LIBRARY_PATH='$$ORIGIN'
2568 $(objpfx)tst-rtld-help.out: $(objpfx)ld.so
2569 $(test-wrapper) $(rtld-prefix) --help > $@; \
2570 status=$$?; \
2571 echo "info: ld.so exit status: $$status" >> $@; \
2572 if ! grep -q 'Legacy HWCAP subdirectories under library search path directories' $@; then \
2573 echo "error: missing subdirectory pattern" >> $@; \
2574 if test $$status -eq 0; then \
2575 status=1; \
2576 fi; \
2577 fi; \
2578 (exit $$status); \
2579 $(evaluate-test)
2581 # Reuses tst-tls-many-dynamic-modules
2582 $(patsubst %,$(objpfx)%.os,$(tst-tls-many-dynamic-modules-dep)): \
2583 $(objpfx)tst-tls-manydynamic%mod-dep.os : tst-tls-manydynamicmod.c
2584 $(compile-command.c) \
2585 -DNAME=tls_global_$* -DSETTER=set_value_$* -DGETTER=get_value_$*
2586 $(patsubst %,$(objpfx)%.os,$(tst-tls-many-dynamic-modules-dep-bad)): \
2587 $(objpfx)tst-tls-manydynamic%mod-dep-bad.os : tst-tls-manydynamicmod.c
2588 $(compile-command.c) \
2589 -DNAME=tls_global_$* -DSETTER=set_value_$* -DGETTER=get_value_$*
2590 tst-tls20mod-bad.so-no-z-defs = yes
2591 # Single dependency.
2592 $(objpfx)tst-tls-manydynamic0mod-dep.so: $(objpfx)tst-tls-manydynamic1mod-dep.so
2593 # Double dependencies.
2594 $(objpfx)tst-tls-manydynamic2mod-dep.so: $(objpfx)tst-tls-manydynamic3mod-dep.so \
2595 $(objpfx)tst-tls-manydynamic4mod-dep.so
2596 # Double dependencies with each dependency depent of another module.
2597 $(objpfx)tst-tls-manydynamic5mod-dep.so: $(objpfx)tst-tls-manydynamic6mod-dep.so \
2598 $(objpfx)tst-tls-manydynamic7mod-dep.so
2599 $(objpfx)tst-tls-manydynamic6mod-dep.so: $(objpfx)tst-tls-manydynamic8mod-dep.so
2600 $(objpfx)tst-tls-manydynamic7mod-dep.so: $(objpfx)tst-tls-manydynamic8mod-dep.so
2601 # Long chain with one double dependency in the middle
2602 $(objpfx)tst-tls-manydynamic9mod-dep.so: $(objpfx)tst-tls-manydynamic10mod-dep.so \
2603 $(objpfx)tst-tls-manydynamic11mod-dep.so
2604 $(objpfx)tst-tls-manydynamic10mod-dep.so: $(objpfx)tst-tls-manydynamic12mod-dep.so
2605 $(objpfx)tst-tls-manydynamic12mod-dep.so: $(objpfx)tst-tls-manydynamic13mod-dep.so
2606 # Long chain with two double depedencies in the middle
2607 $(objpfx)tst-tls-manydynamic14mod-dep.so: $(objpfx)tst-tls-manydynamic15mod-dep.so
2608 $(objpfx)tst-tls-manydynamic15mod-dep.so: $(objpfx)tst-tls-manydynamic16mod-dep.so \
2609 $(objpfx)tst-tls-manydynamic17mod-dep.so
2610 $(objpfx)tst-tls-manydynamic16mod-dep.so: $(objpfx)tst-tls-manydynamic18mod-dep.so \
2611 $(objpfx)tst-tls-manydynamic19mod-dep.so
2612 # Same but with an invalid module.
2613 # Single dependency.
2614 $(objpfx)tst-tls-manydynamic0mod-dep-bad.so: $(objpfx)tst-tls20mod-bad.so
2615 LDFLAGS-tst-tls-manydynamic0mod-dep-bad.so = -Wl,--no-as-needed
2616 # Double dependencies.
2617 $(objpfx)tst-tls-manydynamic1mod-dep-bad.so: $(objpfx)tst-tls-manydynamic2mod-dep-bad.so \
2618 $(objpfx)tst-tls20mod-bad.so
2619 LDFLAGS-tst-tls-manydynamic1mod-dep-bad.so = -Wl,--no-as-needed
2620 # Double dependencies with each dependency depent of another module.
2621 $(objpfx)tst-tls-manydynamic3mod-dep-bad.so: $(objpfx)tst-tls-manydynamic4mod-dep-bad.so \
2622 $(objpfx)tst-tls-manydynamic5mod-dep-bad.so
2623 LDFLAGS-tst-tls-manydynamic3mod-dep-bad.so = -Wl,--no-as-needed
2624 $(objpfx)tst-tls-manydynamic4mod-dep-bad.so: $(objpfx)tst-tls20mod-bad.so
2625 LDFLAGS-tst-tls-manydynamic4mod-dep-bad.so = -Wl,--no-as-needed
2626 $(objpfx)tst-tls-manydynamic5mod-dep-bad.so: $(objpfx)tst-tls20mod-bad.so
2627 LDFLAGS-tst-tls-manydynamic5mod-dep-bad.so = -Wl,--no-as-needed
2628 # Long chain with one double dependency in the middle
2629 $(objpfx)tst-tls-manydynamic6mod-dep-bad.so: $(objpfx)tst-tls-manydynamic7mod-dep-bad.so \
2630 $(objpfx)tst-tls-manydynamic8mod-dep-bad.so
2631 LDFLAGS-tst-tls-manydynamic6mod-dep-bad.so = -Wl,--no-as-needed
2632 $(objpfx)tst-tls-manydynamic7mod-dep-bad.so: $(objpfx)tst-tls-manydynamic9mod-dep-bad.so
2633 LDFLAGS-tst-tls-manydynamic7mod-dep-bad.so = -Wl,--no-as-needed
2634 $(objpfx)tst-tls-manydynamic9mod-dep-bad.so: $(objpfx)tst-tls20mod-bad.so
2635 LDFLAGS-tst-tls-manydynamic9mod-dep-bad.so = -Wl,--no-as-needed
2636 # Long chain with two double depedencies in the middle
2637 $(objpfx)tst-tls-manydynamic10mod-dep-bad.so: $(objpfx)tst-tls-manydynamic11mod-dep-bad.so
2638 LDFLAGS-tst-tls-manydynamic10mod-dep-bad.so = -Wl,--no-as-needed
2639 $(objpfx)tst-tls-manydynamic11mod-dep-bad.so: $(objpfx)tst-tls-manydynamic12mod-dep-bad.so \
2640 $(objpfx)tst-tls-manydynamic13mod-dep-bad.so
2641 LDFLAGS-tst-tls-manydynamic11mod-dep-bad.so = -Wl,--no-as-needed
2642 $(objpfx)tst-tls-manydynamic12mod-dep-bad.so: $(objpfx)tst-tls-manydynamic14mod-dep-bad.so \
2643 $(objpfx)tst-tls20mod-bad.so
2644 LDFLAGS-tst-tls-manydynamic12mod-dep-bad.so = -Wl,--no-as-needed
2645 $(objpfx)tst-tls20: $(shared-thread-library)
2646 $(objpfx)tst-tls20.out: $(objpfx)tst-tls20mod-bad.so \
2647 $(tst-tls-many-dynamic-modules:%=$(objpfx)%.so) \
2648 $(tst-tls-many-dynamic-modules-dep:%=$(objpfx)%.so) \
2649 $(tst-tls-many-dynamic-modules-dep-bad:%=$(objpfx)%.so) \
2651 # Reuses tst-tls-many-dynamic-modules
2652 $(objpfx)tst-tls21: $(shared-thread-library)
2653 $(objpfx)tst-tls21.out: $(objpfx)tst-tls21mod.so
2654 $(objpfx)tst-tls21mod.so: $(tst-tls-many-dynamic-modules:%=$(objpfx)%.so)
2656 $(objpfx)tst-getauxval-static.out: $(objpfx)tst-auxvalmod.so
2657 tst-getauxval-static-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx)
2659 $(objpfx)tst-dlmopen-gethostbyname.out: $(objpfx)tst-dlmopen-gethostbyname-mod.so
2661 $(objpfx)tst-ro-dynamic: $(objpfx)tst-ro-dynamic-mod.so
2662 $(objpfx)tst-ro-dynamic-mod.so: $(objpfx)tst-ro-dynamic-mod.os \
2663 tst-ro-dynamic-mod.map
2664 $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
2665 -Wl,--script=tst-ro-dynamic-mod.map \
2666 $(objpfx)tst-ro-dynamic-mod.os
2668 $(objpfx)tst-rtld-run-static.out: $(objpfx)/ldconfig
2670 $(objpfx)tst-dl_find_object.out: \
2671 $(objpfx)tst-dl_find_object-mod1.so $(objpfx)tst-dl_find_object-mod2.so
2672 $(objpfx)tst-dl_find_object-static.out: \
2673 $(objpfx)tst-dl_find_object-mod1.so $(objpfx)tst-dl_find_object-mod2.so
2674 tst-dl_find_object-static-ENV = $(static-dlopen-environment)
2675 CFLAGS-tst-dl_find_object.c += -funwind-tables
2676 CFLAGS-tst-dl_find_object-static.c += -funwind-tables
2677 LDFLAGS-tst-dl_find_object-static += -Wl,--eh-frame-hdr
2678 CFLAGS-tst-dl_find_object-mod1.c += -funwind-tables
2679 CFLAGS-tst-dl_find_object-mod2.c += -funwind-tables
2680 LDFLAGS-tst-dl_find_object-mod2.so += -Wl,--enable-new-dtags,-z,nodelete
2681 $(objpfx)tst-dl_find_object-threads: $(shared-thread-library)
2682 CFLAGS-tst-dl_find_object-threads.c += -funwind-tables
2683 $(objpfx)tst-dl_find_object-threads.out: \
2684 $(objpfx)tst-dl_find_object-mod1.so \
2685 $(objpfx)tst-dl_find_object-mod2.so \
2686 $(objpfx)tst-dl_find_object-mod3.so \
2687 $(objpfx)tst-dl_find_object-mod4.so \
2688 $(objpfx)tst-dl_find_object-mod5.so \
2689 $(objpfx)tst-dl_find_object-mod6.so \
2690 $(objpfx)tst-dl_find_object-mod7.so \
2691 $(objpfx)tst-dl_find_object-mod8.so \
2692 $(objpfx)tst-dl_find_object-mod9.so
2693 CFLAGS-tst-dl_find_object-mod3.c += -funwind-tables
2694 CFLAGS-tst-dl_find_object-mod4.c += -funwind-tables
2695 CFLAGS-tst-dl_find_object-mod5.c += -funwind-tables
2696 CFLAGS-tst-dl_find_object-mod6.c += -funwind-tables
2697 CFLAGS-tst-dl_find_object-mod7.c += -funwind-tables
2698 CFLAGS-tst-dl_find_object-mod8.c += -funwind-tables
2699 CFLAGS-tst-dl_find_object-mod9.c += -funwind-tables
2701 $(objpfx)tst-p_alignmod-base.so: $(libsupport)
2702 LDFLAGS-tst-p_alignmod-base.so += -Wl,-z,max-page-size=0x200000
2704 $(objpfx)tst-p_align1: $(objpfx)tst-p_alignmod1.so
2706 # Make a copy of tst-p_alignmod-base.so and lower p_align of the first
2707 # PT_LOAD segment.
2708 $(objpfx)tst-p_alignmod1.so: $(objpfx)tst-p_alignmod-base.so
2709 rm -f $@
2710 cp $(objpfx)tst-p_alignmod-base.so $@
2711 $(PYTHON) $(..)scripts/tst-elf-edit.py -a half $@
2713 $(objpfx)tst-p_align2: $(objpfx)tst-p_alignmod2.so
2715 # Make a copy of tst-p_alignmod-base.so and update p_align of the first
2716 # PT_LOAD segment.
2717 $(objpfx)tst-p_alignmod2.so: $(objpfx)tst-p_alignmod-base.so
2718 rm -f $@
2719 cp $(objpfx)tst-p_alignmod-base.so $@
2720 $(PYTHON) $(..)scripts/tst-elf-edit.py -a 1 $@
2722 LDFLAGS-tst-p_alignmod3.so += -Wl,-z,max-page-size=0x100,-z,common-page-size=0x100
2724 $(objpfx)tst-p_align3: $(objpfx)tst-p_alignmod3.so
2725 $(objpfx)tst-p_align3.out: tst-p_align3.sh $(objpfx)tst-p_align3
2726 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
2727 $(evaluate-test)