1 # Copyright (C) 1995-2023 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.
27 bits
/link_lavcurrent.h \
51 # The core dynamic linking functions are in libc for the static and
54 dl-call-libc-early-init \
81 dl-thread_gscope_wait \
89 ifeq (yes
,$(use-ldconfig
))
90 dl-routines
+= dl-cache
93 ifneq (no
,$(have-tunables
))
94 dl-routines
+= dl-tunables
95 tunables-type
= $(addprefix TUNABLES_FRONTEND_
,$(have-tunables
))
96 CPPFLAGS-dl-tunables.c
+= -DTUNABLES_FRONTEND
=$(tunables-type
)
98 ifeq (yesyes
,$(build-shared
)$(run-built-tests
))
99 tests-special
+= $(objpfx
)list-tunables.out
102 # Make sure that the compiler does not insert any library calls in tunables
104 ifeq (yes
,$(have-loop-to-function
))
105 CFLAGS-dl-tunables.c
+= -fno-tree-loop-distribute-patterns
109 all-dl-routines
= $(dl-routines
) $(sysdep-dl-routines
)
110 # But they are absent from the shared libc, because that code is in ld.so.
111 elide-routines.os
= \
116 dl-reloc-static-pie \
124 # These object files are only included in the dynamically-linked libc.
125 shared-only-routines
= libc-dl_find_object
127 # ld.so uses those routines, plus some special stuff for being the program
128 # interpreter and operating independent of libc.
135 dl-diagnostics-kernel \
148 all-rtld-routines
= $(rtld-routines
) $(sysdep-rtld-routines
)
150 CFLAGS-dl-runtime.c
+= -fexceptions
-fasynchronous-unwind-tables
151 CFLAGS-dl-lookup.c
+= -fexceptions
-fasynchronous-unwind-tables
152 CFLAGS-dl-iteratephdr.c
+= $(uses-callbacks
)
154 # Called during static library initialization, so turn stack-protection
155 # off for non-shared builds.
156 CFLAGS-dl-minimal-malloc.o
= $(no-stack-protector
)
157 CFLAGS-dl-minimal-malloc.op
= $(no-stack-protector
)
159 # On targets without __builtin_memset, rtld.c uses a hand-coded loop
160 # in _dl_start. Make sure this isn't turned into a call to regular memset.
161 ifeq (yes
,$(have-loop-to-function
))
162 CFLAGS-rtld.c
+= -fno-tree-loop-distribute-patterns
165 # Compile rtld itself without stack protection.
166 # Also compile all routines in the static library that are elided from
167 # the shared libc because they are in libc.a in the same way.
169 CFLAGS-.o
+= $(call elide-stack-protector
,.o
,$(elide-routines.os
))
170 CFLAGS-.op
+= $(call elide-stack-protector
,.op
,$(elide-routines.os
))
171 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,$(all-rtld-routines
))
173 # Add the requested compiler flags to the early startup code.
174 CFLAGS-dl-printf.os
+= $(rtld-early-cflags
)
175 CFLAGS-dl-setup_hash.os
+= $(rtld-early-cflags
)
176 CFLAGS-dl-sysdep.os
+= $(rtld-early-cflags
)
177 CFLAGS-dl-tunables.os
+= $(rtld-early-cflags
)
178 CFLAGS-dl-write.os
+= $(rtld-early-cflags
)
179 CFLAGS-dl-writev.os
+= $(rtld-early-cflags
)
180 CFLAGS-rtld.os
+= $(rtld-early-cflags
)
182 ifeq ($(unwind-find-fde
),yes
)
183 routines
+= unwind-dw2-fde-glibc
184 shared-only-routines
+= unwind-dw2-fde-glibc
187 before-compile
+= $(objpfx
)trusted-dirs.h
188 generated
+= trusted-dirs.h trusted-dirs.st for-renamed
/renamed.so
189 generated-dirs
+= for-renamed
191 ifeq ($(build-shared
),yes
)
192 ld-map
= $(common-objpfx
)ld.map
195 ifeq (yes
,$(build-shared
))
197 $(all-rtld-routines
:%=%.os
) \
206 install-others
= $(inst_rtlddir
)/$(rtld-installed-name
) $(inst_bindir
)/ld.so
207 install-bin-script
= ldd
213 install-rootsbin
= sln
214 sln-modules
:= static-stubs
215 extra-objs
+= $(sln-modules
:=.o
)
217 ifeq (yes
,$(use-ldconfig
))
218 ifeq (yes
,$(build-shared
))
219 others-static
+= ldconfig
221 install-rootsbin
+= ldconfig
223 ldconfig-modules
:= \
232 extra-objs
+= $(ldconfig-modules
:=.o
)
233 others-extras
= $(ldconfig-modules
)
237 # To find xmalloc.c and xstrdup.c
238 vpath
%.c ..
/locale
/programs
240 ifeq ($(build-shared
),yes
)
241 extra-objs
+= sotruss-lib.os sotruss-lib.so
242 install-others
+= $(inst_auditdir
)/sotruss-lib.so
243 install-bin-script
+= sotruss
245 libof-sotruss-lib
= extramodules
246 LDFLAGS-sotruss-lib.so
+= $(z-now-
$(bind-now
))
247 $(objpfx
)sotruss-lib.so
: $(objpfx
)sotruss-lib.os
248 $(build-module-asneeded
)
249 $(objpfx
)sotruss-lib.so
: $(common-objpfx
)libc.so
$(objpfx
)ld.so \
250 $(common-objpfx
)libc_nonshared.a
252 $(objpfx
)sotruss
: sotruss.sh
$(common-objpfx
)config.make
253 sed
-e
's%@VERSION@%$(version)%g' \
254 -e
's%@TEXTDOMAINDIR@%$(localedir)%g' \
255 -e
's%@PREFIX@%$(prefix)%g' \
256 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
257 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
261 $(inst_auditdir
)/sotruss-lib.so
: $(objpfx
)sotruss-lib.so
$(+force)
262 $(do-install-program
)
265 tests-static-normal
:= \
271 tst-env-setuid-tunables \
272 tst-getauxval-static \
274 tst-single_threaded-pthread-static \
275 tst-single_threaded-static \
276 tst-tls-allocation-failure-static \
277 tst-tlsalign-extern-static \
278 tst-tlsalign-static \
279 # tests-static-normal
281 tests-static-internal
:= \
282 tst-dl_find_object-static \
283 tst-ptrguard1-static \
284 tst-stackguard1-static \
286 tst-tls1-static-non-pie \
287 # tests-static-internal
289 CRT-tst-tls1-static-non-pie
:= $(csu-objpfx
)crt1.o
290 tst-tls1-static-non-pie-no-pie
= yes
293 tst-ldconfig-bad-aux-cache \
294 tst-ldconfig-ld_so_conf-update \
297 ifeq (no
,$(build-hardcoded-path-in-tests
))
298 # This is an ld.so.cache test, and RPATH/RUNPATH in the executable
299 # interferes with its test objectives.
300 tests-container
+= tst-glibc-hwcaps-prepend-cache
317 $(tests-static-internal
) \
321 tests-static
:= $(tests-static-normal
) $(tests-static-internal
)
323 ifeq (yes
,$(build-shared
))
325 tst-single_threaded-static-dlopen \
329 static-dlopen-environment
= \
330 LD_LIBRARY_PATH
=$(ld-library-path
):$(common-objpfx
)dlfcn
331 tst-tls9-static-ENV
= $(static-dlopen-environment
)
332 tst-single_threaded-static-dlopen-ENV
= $(static-dlopen-environment
)
373 tst-audit-tlsdesc-dlopen \
406 tst-dlmopen-dlerror \
407 tst-dlmopen-gethostbyname \
413 tst-dlopen-tlsmodid \
416 tst-filterobj-dlopen \
418 tst-glibc-hwcaps-mask \
419 tst-glibc-hwcaps-prepend \
422 tst-initfinilazyfail \
429 tst-nodelete-dlclose \
430 tst-nodelete-opened \
438 tst-rtld-run-static \
439 tst-single_threaded \
440 tst-single_threaded-pthread \
441 tst-sonamemove-dlopen \
442 tst-sonamemove-link \
459 tst-tlsalign-extern \
463 tst-tls-manydynamic \
477 tst-dlopen-nodelete-reloc \
483 tests
+= $(if
$(CXX
),$(tests-cxx
))
494 tst-dl-hwcaps_split \
496 tst-dl_find_object-threads \
510 tst-dlopen-self-container \
511 tst-dlopen-tlsmodid-container \
513 tst-preload-pthread-libc \
520 ifeq (yes
,$(have-fpie
))
521 tests-pie
+= tst-align3
523 selinux-enabled
:= $(shell cat
/selinux
/enforce
2> /dev
/null
)
525 ifneq ($(selinux-enabled
),1)
526 tests-execstack-yes
= \
528 tst-execstack-needed \
530 # tests-execstack-yes
532 ifeq ($(have-depaudit
),yes
)
539 ifeq ($(run-built-tests
),yes
)
541 $(objpfx
)tst-audit14-cmp.out \
542 $(objpfx
)tst-audit14a-cmp.out \
543 $(objpfx
)tst-audit15-cmp.out \
544 $(objpfx
)tst-audit16-cmp.out \
548 ifeq ($(have-dt-relr
),yes
)
555 modules-names-dt-relr
= \
561 # modules-names-dt-relr
562 modules-names
+= $(modules-names-dt-relr
)
563 # These shared libraries have special build rules.
564 modules-names-nobuild
+= $(modules-names-dt-relr
)
565 ifeq ($(have-fpie
),yes
)
573 $(objpfx
)check-tst-relr-pie.out \
576 CFLAGS-tst-relr-pie.c
+= $(pie-ccflag
)
577 LDFLAGS-tst-relr
+= -Wl
,-z
,pack-relative-relocs
578 LDFLAGS-tst-relr-pie
+= -Wl
,-z
,pack-relative-relocs
579 CFLAGS-tst-relr-mod2.c
+= $(no-stack-protector
)
580 CFLAGS-tst-relr-mod3a.c
+= $(no-stack-protector
)
581 CFLAGS-tst-relr-mod3b.c
+= $(no-stack-protector
)
582 CFLAGS-tst-relr-mod4a.c
+= $(no-stack-protector
)
583 CFLAGS-tst-relr-mod4b.c
+= $(no-stack-protector
)
587 tests-special
+= $(objpfx
)tst-relro-ldso.out
$(objpfx
)tst-relro-libc.out
588 $(objpfx
)tst-relro-ldso.out
: tst-relro-symbols.py
$(..
)/scripts
/glibcelf.py \
590 $(PYTHON
) tst-relro-symbols.py
$(objpfx
)ld.so \
591 --required
=_rtld_global_ro \
592 > $@
2>&1; $(evaluate-test
)
593 # The optional symbols are present in libc only if the architecture has
594 # the GLIBC_2.0 symbol set in libc.
595 $(objpfx
)tst-relro-libc.out
: tst-relro-symbols.py
$(..
)/scripts
/glibcelf.py \
596 $(common-objpfx
)libc.so
597 $(PYTHON
) tst-relro-symbols.py
$(common-objpfx
)libc.so \
598 --required
=_IO_cookie_jumps \
599 --required
=_IO_file_jumps \
600 --required
=_IO_file_jumps_maybe_mmap \
601 --required
=_IO_file_jumps_mmap \
602 --required
=_IO_mem_jumps \
603 --required
=_IO_printf_buffer_as_file_jumps \
604 --required
=_IO_proc_jumps \
605 --required
=_IO_str_jumps \
606 --required
=_IO_wfile_jumps \
607 --required
=_IO_wfile_jumps_maybe_mmap \
608 --required
=_IO_wfile_jumps_mmap \
609 --required
=_IO_wmem_jumps \
610 --required
=_IO_wprintf_buffer_as_file_jumps \
611 --required
=_IO_wstr_jumps \
612 --optional
=_IO_old_cookie_jumps \
613 --optional
=_IO_old_file_jumps \
614 --optional
=_IO_old_proc_jumps \
615 > $@
2>&1; $(evaluate-test
)
617 ifeq ($(run-built-tests
),yes
)
618 tests-special
+= $(objpfx
)tst-valgrind-smoke.out
620 $(objpfx
)tst-valgrind-smoke.out
: tst-valgrind-smoke.sh
$(objpfx
)ld.so
$(objpfx
)valgrind-test
621 $(SHELL
) $< $(objpfx
)ld.so
$(rtlddir
)/$(rtld-installed-name
) '$(test-wrapper-env)' \
622 '$(run-program-env)' '$(rpath-link)' $(objpfx
)valgrind-test
> $@
; $(evaluate-test
)
624 tests
+= $(tests-execstack-
$(have-z-execstack
))
625 ifeq ($(run-built-tests
),yes
)
627 $(objpfx
)noload-mem.out \
628 $(objpfx
)tst-ldconfig-X.out \
629 $(objpfx
)tst-leaks1-mem.out \
630 $(objpfx
)tst-rtld-help.out \
633 tlsmod17a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
634 tlsmod18a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
635 tlsmod17a-modules
= $(addprefix tst-tlsmod17a
, $(tlsmod17a-suffixes
))
636 tlsmod18a-modules
= $(addprefix tst-tlsmod18a
, $(tlsmod17a-suffixes
))
637 one-hundred
= $(foreach x
,0 1 2 3 4 5 6 7 8 9, \
638 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
639 tst-tls-many-dynamic-modules
:= \
640 $(foreach n
,$(one-hundred
),tst-tls-manydynamic
$(n
)mod
)
641 tst-tls-many-dynamic-modules-dep-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 \
643 tst-tls-many-dynamic-modules-dep
= \
644 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-suffixes
),tst-tls-manydynamic
$(n
)mod-dep
)
645 tst-tls-many-dynamic-modules-dep-bad-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
646 tst-tls-many-dynamic-modules-dep-bad
= \
647 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-bad-suffixes
),tst-tls-manydynamic
$(n
)mod-dep-bad
)
649 $(tlsmod17a-modules
:=.os
) \
650 $(tlsmod18a-modules
:=.os
) \
651 tst-tlsalign-vars.o \
756 tst-absolute-sym-lib \
757 tst-absolute-zero-lib \
763 tst-audit-tlsdesc-mod1 \
764 tst-audit-tlsdesc-mod2 \
798 tst-auditmod-tlsdesc \
823 tst-dl_find_object-mod1 \
824 tst-dl_find_object-mod2 \
825 tst-dl_find_object-mod3 \
826 tst-dl_find_object-mod4 \
827 tst-dl_find_object-mod5 \
828 tst-dl_find_object-mod6 \
829 tst-dl_find_object-mod7 \
830 tst-dl_find_object-mod8 \
831 tst-dl_find_object-mod9 \
833 tst-dlmopen-dlerror-mod \
834 tst-dlmopen-gethostbyname-mod \
835 tst-dlmopen-twice-mod1 \
836 tst-dlmopen-twice-mod2 \
837 tst-dlopenfaillinkmod \
841 tst-dlopenfailnodelmod \
844 tst-filterobj-filtee \
846 tst-finilazyfailmod \
848 tst-initlazyfailmod \
860 tst-ldconfig-ld-mod \
863 tst-nodelete-dlclose-dso \
864 tst-nodelete-dlclose-plugin \
865 tst-nodelete-opened-lib \
867 tst-p_alignmod-base \
872 tst-single_threaded-mod1 \
873 tst-single_threaded-mod2 \
874 tst-single_threaded-mod3 \
875 tst-single_threaded-mod4 \
876 tst-sonamemove-linkmod1 \
877 tst-sonamemove-runmod1 \
878 tst-sonamemove-runmod2 \
917 tst-unwind-ctor-lib \
943 modules-names-cxx
= \
944 tst-dlopen-nodelete-reloc-mod1 \
945 tst-dlopen-nodelete-reloc-mod10 \
946 tst-dlopen-nodelete-reloc-mod11 \
947 tst-dlopen-nodelete-reloc-mod12 \
948 tst-dlopen-nodelete-reloc-mod13 \
949 tst-dlopen-nodelete-reloc-mod14 \
950 tst-dlopen-nodelete-reloc-mod15 \
951 tst-dlopen-nodelete-reloc-mod16 \
952 tst-dlopen-nodelete-reloc-mod17 \
953 tst-dlopen-nodelete-reloc-mod2 \
954 tst-dlopen-nodelete-reloc-mod3 \
955 tst-dlopen-nodelete-reloc-mod4 \
956 tst-dlopen-nodelete-reloc-mod5 \
957 tst-dlopen-nodelete-reloc-mod6 \
958 tst-dlopen-nodelete-reloc-mod7 \
959 tst-dlopen-nodelete-reloc-mod8 \
960 tst-dlopen-nodelete-reloc-mod9 \
961 tst-nodelete-rtldmod \
962 tst-nodelete-uniquemod \
970 $(if
$(CXX
),$(modules-names-cxx
)) \
971 $(modules-execstack-
$(have-z-execstack
)) \
972 $(tlsmod17a-modules
) \
973 $(tlsmod18a-modules
) \
974 $(tst-tls-many-dynamic-modules
) \
975 $(tst-tls-many-dynamic-modules-dep
) \
976 $(tst-tls-many-dynamic-modules-dep-bad
) \
979 # Most modules build with _ISOMAC defined, but those filtered out
980 # depend on internal headers.
981 modules-names-tests
= $(filter-out ifuncmod
% tst-tlsmod
%,\
984 # For +depfiles in Makerules.
985 extra-test-objs
+= tst-auditmod17.os
987 ifeq (yes
,$(have-mtls-dialect-gnu2
))
988 tests
+= tst-gnu2-tls1
989 modules-names
+= tst-gnu2-tls1mod
990 $(objpfx
)tst-gnu2-tls1
: $(objpfx
)tst-gnu2-tls1mod.so
991 tst-gnu2-tls1mod.so-no-z-defs
= yes
992 CFLAGS-tst-gnu2-tls1mod.c
+= -mtls-dialect
=gnu2
993 endif # $(have-mtls-dialect-gnu2)
995 ifeq (yes
,$(have-protected-data
))
996 modules-names
+= tst-protected1moda tst-protected1modb
997 tests
+= tst-protected1a tst-protected1b
998 $(objpfx
)tst-protected1a
: $(addprefix $(objpfx
),tst-protected1moda.so tst-protected1modb.so
)
999 $(objpfx
)tst-protected1b
: $(addprefix $(objpfx
),tst-protected1modb.so tst-protected1moda.so
)
1000 tst-protected1modb.so-no-z-defs
= yes
1001 # These tests fail with GCC versions prior to 5.1 and with some versions
1002 # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
1003 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
1004 # Perhaps in future we can make these XFAILs conditional on some detection
1005 # of compiler/linker behavior/version.
1006 test-xfail-tst-protected1a
= yes
1007 test-xfail-tst-protected1b
= yes
1009 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1010 modules-names
+= tst-piemod1
1011 tests
+= tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \
1013 tests-pie
+= tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie
1014 ifeq (yes
,$(have-protected-data
))
1016 tests-pie
+= vismain
1017 CFLAGS-vismain.c
+= $(PIE-ccflag
)
1020 modules-execstack-yes
= tst-execstack-mod
1021 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
1023 # filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special
1025 modules-names-nobuild
+= \
1030 tst-ro-dynamic-mod \
1031 # modules-names-nobuild
1033 tests
+= $(tests-static
)
1035 ifeq (yes
,$(have-ifunc
))
1036 tests-ifuncstatic
:= \
1038 ifuncmain1picstatic \
1040 ifuncmain2picstatic \
1042 ifuncmain4picstatic \
1044 ifuncmain5picstatic \
1046 ifuncmain7picstatic \
1048 ifeq (yes
,$(have-gcc-ifunc
))
1049 tests-ifuncstatic
+= ifuncmain9static ifuncmain9picstatic
1051 tests-static
+= $(tests-ifuncstatic
)
1052 tests-internal
+= $(tests-ifuncstatic
)
1053 ifeq (yes
,$(build-shared
))
1055 tst-ifunc-fault-bindnow \
1056 tst-ifunc-fault-lazy \
1058 # Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8.
1061 ifuncmain1staticpic \
1068 ifuncmain5staticpic \
1072 ifeq (no
,$(with-lld
))
1079 ifeq (yes
,$(have-gcc-ifunc
))
1085 ifunc-test-modules
= \
1092 # ifunc-test-modules
1093 extra-test-objs
+= $(ifunc-test-modules
:=.o
)
1094 test-internal-extras
+= $(ifunc-test-modules
)
1095 ifeq (yes
,$(have-fpie
))
1098 ifuncmain1staticpie \
1103 ifeq (yes
,$(have-gcc-ifunc
))
1104 ifunc-pie-tests
+= ifuncmain9pie
1106 ifeq (no
,$(with-lld
))
1107 ifunc-pie-tests
+= ifuncmain5pie
1109 ifeq (yes
,$(have-textrel_ifunc
))
1110 ifunc-pie-tests
+= tst-ifunc-textrel
1112 tests-internal
+= $(ifunc-pie-tests
)
1113 tests-pie
+= $(ifunc-pie-tests
)
1120 ifeq (no
,$(with-lld
))
1121 modules-names
+= ifuncmod5
1126 ifeq (yes
,$(build-shared
))
1127 ifeq ($(run-built-tests
),yes
)
1129 $(objpfx
)argv0test.out \
1130 $(objpfx
)tst-pathopt.out \
1131 $(objpfx
)tst-rtld-help.out \
1132 $(objpfx
)tst-rtld-load-self.out \
1133 $(objpfx
)tst-rtld-preload.out \
1137 $(objpfx
)check-execstack.out \
1138 $(objpfx
)check-initfini.out \
1139 $(objpfx
)check-localplt.out \
1140 $(objpfx
)check-textrel.out \
1141 $(objpfx
)check-wx-segment.out \
1145 ifeq ($(run-built-tests
),yes
)
1147 $(objpfx
)order-cmp.out \
1148 $(objpfx
)order2-cmp.out \
1149 $(objpfx
)tst-array1-cmp.out \
1150 $(objpfx
)tst-array1-static-cmp.out \
1151 $(objpfx
)tst-array2-cmp.out \
1152 $(objpfx
)tst-array3-cmp.out \
1153 $(objpfx
)tst-array4-cmp.out \
1154 $(objpfx
)tst-array5-cmp.out \
1155 $(objpfx
)tst-array5-static-cmp.out \
1156 $(objpfx
)tst-initorder-cmp.out \
1157 $(objpfx
)tst-initorder2-cmp.out \
1158 $(objpfx
)tst-unused-dep-cmp.out \
1159 $(objpfx
)tst-unused-dep.out \
1160 $(objpfx
)tst-trace1.out \
1161 $(objpfx
)tst-trace2.out \
1162 $(objpfx
)tst-trace3.out \
1163 $(objpfx
)tst-trace4.out \
1164 $(objpfx
)tst-trace5.out \
1168 ifndef avoid-generated
1169 # DSO sorting tests:
1170 # The dso-ordering-test.py script generates testcase source files in $(objpfx),
1171 # creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a
1172 # Makefile fragment to be included.
1173 define include_dsosort_tests
1174 $(objpfx
)$(1).generated-makefile
: $(1)
1175 $(PYTHON
) $(..
)scripts
/dso-ordering-test.py \
1176 --description-file
$$< --objpfx
$(objpfx
) --output-makefile
$$@T
1178 -include $(objpfx
)$(1).generated-makefile
1182 postclean-generated
+= $(objpfx
)/dso-sort-tests-2.generated-makefile \
1183 $(objpfx
)/dso-sort-tests-2.generated-makefile
1185 # Generate from each testcase description file
1186 ifeq (yes
,$(have-tunables
))
1187 $(eval
$(call include_dsosort_tests
,dso-sort-tests-1.def
))
1188 $(eval
$(call include_dsosort_tests
,dso-sort-tests-2.def
))
1191 check-abi
: $(objpfx
)check-abi-ld.out \
1192 $(objpfx
)check-abi-version-libc.out
1194 $(objpfx
)check-abi-ld.out \
1195 $(objpfx
)check-abi-version-libc.out \
1197 update-abi
: update-abi-ld
1198 update-all-abi
: update-all-abi-ld
1200 tests-special
+= $(objpfx
)tst-glibcelf.out
1201 $(objpfx
)tst-glibcelf.out
: tst-glibcelf.py elf.h
$(..
)/scripts
/glibcelf.py \
1202 $(..
)/scripts
/glibcextract.py
1203 PYTHONPATH
=$(..
)scripts
$(PYTHON
) tst-glibcelf.py \
1204 --cc="$(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS))" \
1205 < /dev
/null
> $@
2>&1; $(evaluate-test
)
1207 ifeq ($(run-built-tests
),yes
)
1208 tests-special
+= $(objpfx
)tst-tls-allocation-failure-static-patched.out
1211 # The test requires shared _and_ PIE because the executable
1212 # unit test driver must be able to link with the shared object
1213 # that is going to eventually go into an installed DSO.
1214 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1215 tests-internal
+= tst-_dl_addr_inside_object
1216 tests-pie
+= tst-_dl_addr_inside_object
1217 $(objpfx
)tst-_dl_addr_inside_object
: $(objpfx
)dl-addr-obj.os
1218 CFLAGS-tst-_dl_addr_inside_object.c
+= $(PIE-ccflag
)
1221 # We can only test static libcrypt use if libcrypt has been built,
1222 # and either NSS crypto is not in use, or static NSS libraries are
1224 ifeq ($(build-crypt
),no
)
1225 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=0
1227 ifeq ($(nss-crypt
),no
)
1228 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=1
1230 ifeq ($(static-nss-crypt
),no
)
1231 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=0
1233 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=1
1240 ifeq (yes
,$(build-shared
))
1241 # Make sure these things are built in the `make lib' pass so they can be used
1242 # to run programs during the `make others' pass.
1243 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
1244 $(addprefix $(objpfx
),$(extra-objs
))
1247 # Command to link into a larger single relocatable object.
1248 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
1250 $(objpfx
)sotruss-lib.so
: $(shlib-lds
)
1252 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
1253 $(reloc-link
) -o
$@
$^
1255 # Link together the dynamic linker into a single relocatable object.
1256 # First we do a link against libc_pic.a just to get a link map,
1257 # and discard the object produced by that link. From the link map
1258 # we can glean all the libc modules that need to go into the dynamic
1259 # linker. Then we do a recursive make that goes into all the subdirs
1260 # those modules come from and builds special rtld-foo.os versions that
1261 # are compiled with special flags, and puts these modules into rtld-libc.a
1262 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
1264 # These symbols need to be stubbed out during symbol discovery because
1265 # their implementation is provided differently in rtld, and the symbol
1266 # discovery mechanism is not compatible with the libc implementation
1267 # when compiled for libc.
1268 rtld-stubbed-symbols
= \
1269 __GI___pthread_disable_asynccancel \
1270 __GI___pthread_enable_asynccancel \
1271 __libc_assert_fail \
1272 __pthread_disable_asynccancel \
1273 __pthread_enable_asynccancel \
1278 # rtld-stubbed-symbols
1280 ifeq ($(have-ssp
),yes
)
1281 # rtld is not built with the stack protector, so these references will
1282 # go away in the rebuilds.
1283 rtld-stubbed-symbols
+= __stack_chk_fail __stack_chk_fail_local
1286 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
1288 for symbol in
$(rtld-stubbed-symbols
); do \
1289 echo
".globl $$symbol"; \
1291 done |
$(CC
) -o
$@T.o
$(ASFLAGS
) -c
-x assembler
-
1292 $(reloc-link
) -o
$@.o
$@T.o
'-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
1296 # For lld, skip preceding addresses and values before matching the archive and the member.
1297 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
1299 sed
-n
's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
1301 while read lib file
; do \
1304 LC_ALL
=C grep
-F
-l
/$$file \
1305 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
1307 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
1310 echo rtld-
$${lib
%%/*} += $$file ;; \
1311 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
1314 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
1315 | LC_ALL=C sort -u` >> $@T
1318 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
1319 $(MAKE
) -f
$< -f rtld-Rules
1321 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
1322 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
1325 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
1327 z-now-yes
= -Wl
,-z
,now
1329 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
1330 # Link into a temporary file so that we don't touch $@ at all
1331 # if the sanity check below fails.
1332 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
1333 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
1335 $(filter-out $(map-file
),$^
) $(load-map-file
) \
1336 -Wl
,-soname
=$(rtld-installed-name
)
1337 $(call after-link
,$@.new
)
1338 $(READELF
) -s
$@.new \
1339 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
1342 ifeq (yes
,$(build-shared
))
1343 # interp.c exists just to get the runtime linker path into libc.so.
1344 $(objpfx
)interp.os
: $(common-objpfx
)runtime-linker.h
1347 ifneq (ld.so
,$(rtld-installed-name
))
1348 # Make sure ld.so.1 exists in the build directory so we can link
1350 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
1352 generated
+= $(rtld-installed-name
)
1355 # Build a file mentioning all trustworthy directories to look for shared
1356 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
1357 # add directories to the list by defining $(user-defined-trusted-dirs)
1358 # before starting make.
1359 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
1360 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
1361 $(make-target-directory
)
1362 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
1363 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
1364 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
1365 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
1367 CPPFLAGS-dl-load.c
+= -I
$(objpfx
).
-I
$(csu-objpfx
).
1369 ifeq (yes
,$(build-shared
))
1370 $(inst_rtlddir
)/$(rtld-installed-name
): $(objpfx
)ld.so
$(+force)
1371 $(make-target-directory
)
1372 $(do-install-program
)
1374 # Creates the relative /usr/bin/ld.so symbolic link.
1375 $(inst_bindir
)/ld.so
: $(inst_rtlddir
)/$(rtld-installed-name
)
1376 $(make-target-directory
)
1379 # Special target called by parent to install just the dynamic linker.
1380 .PHONY
: ldso_install
1381 ldso_install
: $(inst_rtlddir
)/$(rtld-installed-name
)
1382 endif # $(build-shared)
1385 # Workarounds for ${exec_prefix} expansion in configure variables.
1386 # config.status cannot be used directly for processing ldd.bash.in or
1387 # expanding variables such as sysconfdir because the expansion
1388 # contains the literal string ${exec_prefix}, which is not valid in C
1389 # headers or installed shell scripts.
1391 ldd-rewrite
= -e
's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
1392 -e
's%@VERSION@%$(version)%g' \
1393 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
1394 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
1395 -e
's%@TEXTDOMAINDIR@%$(localedir)%g'
1397 ifeq ($(ldd-rewrite-script
),no
)
1399 LC_ALL
=C sed
$(ldd-rewrite
) < $< > $@.new
1403 LC_ALL
=C sed
$(ldd-rewrite
) < $< \
1404 | LC_ALL
=C sed
-f
$(patsubst $(..
)/%,/%,$(..
)$(ldd-rewrite-script
)) > $@.new
1408 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
1409 $(common-objpfx
)config.make
1414 $(objpfx
)sln
: $(sln-modules
:%=$(objpfx
)%.o
)
1416 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
1418 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
1419 CFLAGS-ldconfig.c
+= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
1420 -D
'SLIBDIR="$(slibdir)"'
1421 libof-ldconfig
= ldconfig
1422 CFLAGS-dl-cache.c
+= $(SYSCONF-FLAGS
)
1423 CFLAGS-cache.c
+= $(SYSCONF-FLAGS
)
1424 CFLAGS-rtld.c
+= $(SYSCONF-FLAGS
)
1425 CFLAGS-dl-usage.c
+= $(SYSCONF-FLAGS
) \
1426 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1427 CFLAGS-dl-diagnostics.c
+= $(SYSCONF-FLAGS
) \
1428 -D
'PREFIX="$(prefix)"' \
1429 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1431 cpp-srcs-left
:= $(all-rtld-routines
:=.os
)
1433 include $(patsubst %,$(..
)libof-iterator.mk
,$(cpp-srcs-left
))
1435 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
1436 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
1438 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
1439 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
1440 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
1441 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
1442 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
1443 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
1444 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
1445 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
1446 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
1447 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
1448 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1449 $(objpfx
)neededobj3.so
1450 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
1451 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
1452 $(objpfx
)firstobj.so
: $(shared-thread-library
)
1453 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
1454 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
1455 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
1456 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
1457 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
1458 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
1459 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
1460 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
1461 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
1462 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
1463 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
1464 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
1465 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
1466 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
1467 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
1468 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
1469 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
1470 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
1471 $(objpfx
)tst-tls19mod1.so
: $(objpfx
)tst-tls19mod2.so
$(objpfx
)tst-tls19mod3.so
1472 $(objpfx
)tst-tls19mod3.so
: $(objpfx
)ld.so
1473 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
1474 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
1475 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
1476 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
1477 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
1478 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
1479 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
1480 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
1481 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
1482 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
1483 $(objpfx
)unload8mod1.so
: $(objpfx
)unload8mod2.so
1484 $(objpfx
)unload8mod2.so
: $(objpfx
)unload8mod3.so
1485 $(objpfx
)tst-initordera2.so
: $(objpfx
)tst-initordera1.so
1486 $(objpfx
)tst-initorderb2.so
: $(objpfx
)tst-initorderb1.so
$(objpfx
)tst-initordera2.so
1487 $(objpfx
)tst-initordera3.so
: $(objpfx
)tst-initorderb2.so
$(objpfx
)tst-initorderb1.so
1488 $(objpfx
)tst-initordera4.so
: $(objpfx
)tst-initordera3.so
1489 $(objpfx
)tst-initorder
: $(objpfx
)tst-initordera4.so
$(objpfx
)tst-initordera1.so
$(objpfx
)tst-initorderb2.so
1490 $(objpfx
)tst-null-argv
: $(objpfx
)tst-null-argv-lib.so
1491 $(objpfx
)tst-tlsalign
: $(objpfx
)tst-tlsalign-lib.so
1492 $(objpfx
)tst-nodelete-opened.out
: $(objpfx
)tst-nodelete-opened-lib.so
1494 $(objpfx
)tst-tlsalign-extern
: $(objpfx
)tst-tlsalign-vars.o
1495 $(objpfx
)tst-tlsalign-extern-static
: $(objpfx
)tst-tlsalign-vars.o
1497 tst-null-argv-ENV
= LD_DEBUG
=all LD_DEBUG_OUTPUT
=$(objpfx
)tst-null-argv.debug.out
1498 LDFLAGS-nodel2mod3.so
= -Wl
,--no-as-needed
1499 LDFLAGS-reldepmod5.so
= -Wl
,--no-as-needed
1500 LDFLAGS-reldep6mod1.so
= -Wl
,--no-as-needed
1501 LDFLAGS-reldep6mod4.so
= -Wl
,--no-as-needed
1502 LDFLAGS-reldep8mod3.so
= -Wl
,--no-as-needed
1503 LDFLAGS-unload4mod1.so
= -Wl
,--no-as-needed
1504 LDFLAGS-unload4mod2.so
= -Wl
,--no-as-needed
1505 LDFLAGS-tst-initorder
= -Wl
,--no-as-needed
1506 LDFLAGS-tst-initordera2.so
= -Wl
,--no-as-needed
1507 LDFLAGS-tst-initordera3.so
= -Wl
,--no-as-needed
1508 LDFLAGS-tst-initordera4.so
= -Wl
,--no-as-needed
1509 LDFLAGS-tst-initorderb2.so
= -Wl
,--no-as-needed
1510 LDFLAGS-tst-tlsmod5.so
= -nostdlib
-Wl
,--no-as-needed
1511 LDFLAGS-tst-tlsmod6.so
= -nostdlib
-Wl
,--no-as-needed
1513 testobj1.so-no-z-defs
= yes
1514 testobj3.so-no-z-defs
= yes
1515 testobj4.so-no-z-defs
= yes
1516 testobj5.so-no-z-defs
= yes
1517 testobj6.so-no-z-defs
= yes
1518 failobj.so-no-z-defs
= yes
1519 constload2.so-no-z-defs
= yes
1520 constload3.so-no-z-defs
= yes
1521 nodelmod1.so-no-z-defs
= yes
1522 nodelmod2.so-no-z-defs
= yes
1523 nodelmod4.so-no-z-defs
= yes
1524 nodel2mod2.so-no-z-defs
= yes
1525 reldepmod2.so-no-z-defs
= yes
1526 reldepmod3.so-no-z-defs
= yes
1527 reldepmod4.so-no-z-defs
= yes
1528 reldep4mod4.so-no-z-defs
= yes
1529 reldep4mod2.so-no-z-defs
= yes
1530 ltglobmod2.so-no-z-defs
= yes
1531 dblloadmod3.so-no-z-defs
= yes
1532 tst-tlsmod1.so-no-z-defs
= yes
1533 tst-tlsmod2.so-no-z-defs
= yes
1534 tst-tlsmod3.so-no-z-defs
= yes
1535 tst-tlsmod4.so-no-z-defs
= yes
1536 tst-tlsmod7.so-no-z-defs
= yes
1537 tst-tlsmod8.so-no-z-defs
= yes
1538 tst-tlsmod9.so-no-z-defs
= yes
1539 tst-tlsmod10.so-no-z-defs
= yes
1540 tst-tlsmod12.so-no-z-defs
= yes
1541 tst-tlsmod14a.so-no-z-defs
= yes
1542 tst-tlsmod14b.so-no-z-defs
= yes
1543 tst-tlsmod15a.so-no-z-defs
= yes
1544 tst-tlsmod16b.so-no-z-defs
= yes
1545 circlemod2.so-no-z-defs
= yes
1546 circlemod3.so-no-z-defs
= yes
1547 circlemod3a.so-no-z-defs
= yes
1548 reldep8mod2.so-no-z-defs
= yes
1549 reldep9mod1.so-no-z-defs
= yes
1550 unload3mod4.so-no-z-defs
= yes
1551 unload4mod1.so-no-z-defs
= yes
1552 ifuncmod1.so-no-z-defs
= yes
1553 ifuncmod5.so-no-z-defs
= yes
1554 ifuncmod6.so-no-z-defs
= yes
1555 tst-auditmod9a.so-no-z-defs
= yes
1556 tst-auditmod9b.so-no-z-defs
= yes
1557 tst-nodelete-uniquemod.so-no-z-defs
= yes
1558 tst-nodelete-rtldmod.so-no-z-defs
= yes
1559 tst-nodelete-zmod.so-no-z-defs
= yes
1560 tst-nodelete2mod.so-no-z-defs
= yes
1562 ifeq ($(build-shared
),yes
)
1563 # Build all the modules even when not actually running test programs.
1564 tests
: $(test-modules
)
1567 LDFLAGS-loadtest
= -rdynamic
1569 $(objpfx
)loadtest.out
: $(test-modules
)
1571 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1572 $(objpfx
)neededobj3.so
1574 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1575 $(objpfx
)neededobj3.so
1577 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1578 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
1580 $(objpfx
)neededtest4
: $(objpfx
)neededobj1.so
1581 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
1583 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
1584 LDFLAGS-restest1
= -rdynamic
1586 LDFLAGS-restest2
= -rdynamic
1588 $(objpfx
)restest1.out
: $(test-modules
)
1590 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
1591 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
1592 LDFLAGS-preloadtest
= -rdynamic
1593 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1595 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1597 LDFLAGS-loadfail
= -rdynamic
1599 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
$(objpfx
)testobj1.so \
1600 $(objpfx
)testobj2.so
$(objpfx
)testobj3.so \
1601 $(objpfx
)testobj4.so
$(objpfx
)testobj5.so
1603 LDFLAGS-multiload
= -rdynamic
1604 CFLAGS-multiload.c
+= -DOBJDIR
=\"$(elf-objpfx
)\"
1606 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
1608 LDFLAGS-origtest
= -rdynamic
1609 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
1611 ifeq ($(have-thread-library
),yes
)
1612 $(objpfx
)resolvfail
: $(shared-thread-library
)
1615 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
1617 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
1618 $(objpfx
)circlemod1a.so
1620 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
1621 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
1622 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
1623 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
1625 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
1627 $(objpfx
)order-cmp.out
: $(objpfx
)order.out
1628 (echo
"0123456789" | cmp
$< -) > $@
; \
1631 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
1632 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
1633 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
1635 $(objpfx
)noload
: $(objpfx
)testobj1.so
1636 LDFLAGS-noload
= -rdynamic
-Wl
,--no-as-needed
1637 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
1639 $(objpfx
)noload-mem.out
: $(objpfx
)noload.out
1640 $(common-objpfx
)malloc
/mtrace
$(objpfx
)noload.mtrace
> $@
; \
1642 noload-ENV
= MALLOC_TRACE
=$(objpfx
)noload.mtrace \
1643 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
1645 LDFLAGS-nodelete
= -rdynamic
1646 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1647 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1648 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
1649 $(objpfx
)nodelmod3.so
1651 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
1652 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
1654 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
1655 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
1657 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
1658 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
1660 -L
$(subst :, -L
,$(rpath-link
)) \
1661 -Wl
,-rpath-link
=$(rpath-link
) \
1662 $< -Wl
,-F
,$(objpfx
)filtmod2.so
1663 $(objpfx
)filter: $(objpfx
)filtmod1.so
1665 # This does not link against libc.
1666 CFLAGS-filtmod1.c
+= $(no-stack-protector
)
1668 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
1670 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
1672 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
1674 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1676 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
1678 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
1679 LDFLAGS-next
= -Wl
,--no-as-needed
1681 $(objpfx
)tst-next-ver
: $(objpfx
)nextmod3.so
1682 LDFLAGS-tst-next-ver
= -Wl
,--no-as-needed
1684 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
1686 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
1688 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
1689 $(objpfx
)pathoptobj.so
1690 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
1691 '$(run-program-env)'; \
1694 $(objpfx
)tst-rtld-load-self.out
: tst-rtld-load-self.sh
$(objpfx
)ld.so
1695 $(SHELL
) $^
'$(test-wrapper)' '$(test-wrapper-env)' > $@
; \
1698 tst-rtld-preload-OBJS
= $(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1699 $(objpfx
)tst-rtld-preload.out
: tst-rtld-preload.sh
$(objpfx
)ld.so \
1700 $(objpfx
)preloadtest \
1701 $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1702 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)preloadtest \
1703 '$(test-wrapper-env)' '$(run_program_env)' \
1704 '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@
; \
1707 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
1709 $(objpfx
)global
: $(objpfx
)globalmod1.so
1710 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1712 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1714 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1716 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
1718 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
1720 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
1722 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
1724 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1725 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
1727 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
1729 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
1731 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
1733 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
1735 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
1737 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
1739 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
1741 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1743 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
$(objpfx
)tst-tlsmod7.so
1745 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
$(objpfx
)tst-tlsmod9.so
1747 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
$(objpfx
)tst-tlsmod11.so
1749 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
1751 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
1752 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
1754 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
1756 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
1760 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
1762 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
1763 $(patsubst %,$(objpfx
)%.os
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
1764 $(compile-command.c
) -DN
=$*
1765 $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
1766 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
))
1768 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
))
1769 $(patsubst %,$(objpfx
)%.os
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
1770 $(compile-command.c
) -DN
=$*
1771 $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
1773 $(objpfx
)tst-tls19.out
: $(objpfx
)tst-tls19mod1.so
1775 CFLAGS-tst-align.c
+= $(stack-align-test-flags
)
1776 CFLAGS-tst-align2.c
+= $(stack-align-test-flags
)
1777 CFLAGS-tst-alignmod.c
+= $(stack-align-test-flags
)
1778 CFLAGS-tst-alignmod2.c
+= $(stack-align-test-flags
)
1779 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
1780 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
1781 $(objpfx
)tst-align3
: $(objpfx
)tst-alignmod3.so
1782 ifeq (yes
,$(have-fpie
))
1783 CFLAGS-tst-align3.c
+= $(PIE-ccflag
)
1785 LDFLAGS-tst-align3
+= -Wl
,-z
,max-page-size
=0x200000
1786 LDFLAGS-tst-alignmod3.so
+= -Wl
,-z
,max-page-size
=0x200000
1787 $(objpfx
)tst-alignmod3.so
: $(libsupport
)
1789 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1790 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1792 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
1794 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1795 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1797 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
1798 $(objpfx
)unload6mod3.so
1800 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
1801 unload7-ENV
= MALLOC_PERTURB_
=85
1803 $(objpfx
)unload8.out
: $(objpfx
)unload8mod1.so
$(objpfx
)unload8mod1x.so
1805 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1807 ifeq ($(have-z-execstack
),yes
)
1808 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
1809 CPPFLAGS-tst-execstack.c
+= -DUSE_PTHREADS
=0
1810 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
1811 LDFLAGS-tst-execstack-mod.so
= -Wl
,-z
,execstack
1813 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
1814 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
1816 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
1817 CFLAGS-tst-execstack-prog.c
+= -Wno-trampolines
1818 CFLAGS-tst-execstack-mod.c
+= -Wno-trampolines
1821 LDFLAGS-tst-array2
= -Wl
,--no-as-needed
1822 LDFLAGS-tst-array5
= -Wl
,--no-as-needed
1824 $(objpfx
)tst-array1-cmp.out
: tst-array1.exp
$(objpfx
)tst-array1.out
1828 $(objpfx
)tst-array1-static-cmp.out
: tst-array1.exp \
1829 $(objpfx
)tst-array1-static.out
1833 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
1834 $(objpfx
)tst-array2-cmp.out
: tst-array2.exp
$(objpfx
)tst-array2.out
1838 $(objpfx
)tst-array3-cmp.out
: tst-array1.exp
$(objpfx
)tst-array3.out
1842 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array2dep.so
1843 $(objpfx
)tst-array4-cmp.out
: tst-array4.exp
$(objpfx
)tst-array4.out
1847 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
1848 $(objpfx
)tst-array5-cmp.out
: tst-array5.exp
$(objpfx
)tst-array5.out
1852 $(objpfx
)tst-array5-static-cmp.out
: tst-array5-static.exp \
1853 $(objpfx
)tst-array5-static.out
1857 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
1858 CFLAGS-tst-pie2.c
+= $(pie-ccflag
)
1860 $(objpfx
)tst-piemod1.so
: $(libsupport
)
1861 $(objpfx
)tst-pie1
: $(objpfx
)tst-piemod1.so
1862 $(objpfx
)tst-dlopen-pie.out
: $(objpfx
)tst-pie1
1864 ifeq (yes
,$(build-shared
))
1865 # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with
1866 # all-built-dso here.
1867 all-built-dso
:= $(common-objpfx
)elf
/ld.so
$(common-objpfx
)libc.so \
1868 $(filter-out $(common-objpfx
)linkobj
/libc.so
, \
1869 $(sort $(wildcard $(addprefix $(common-objpfx
), \
1873 $(all-built-dso
:=.dyn
): %.dyn
: %
1875 LC_ALL
=C
$(READELF
) -W
-d
$< > $@T
1878 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dyn
)
1880 $(objpfx
)check-textrel.out
: $(..
)scripts
/check-textrel.awk \
1881 $(all-built-dso
:=.dyn
)
1882 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1884 generated
+= check-textrel.out
1886 $(objpfx
)execstack-default
: $(first-word
$(wildcard $(sysdirs
:%=%/stackinfo.h
)))
1887 $(make-target-directory
)
1888 { echo
'#include <elf.h>'; \
1889 echo
'#include <stackinfo.h>'; \
1890 echo
'#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1891 echo
'@@@execstack-no@@@'; \
1893 echo
'@@@execstack-yes@@@'; \
1894 echo
'#endif'; } | \
1895 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -E
-x c-header
- | \
1896 sed
-n
-e
's/^@@@\(.*\)@@@/\1/p' > $@T
1898 generated
+= execstack-default
1900 $(all-built-dso
:=.phdr
): %.phdr
: %
1902 LC_ALL
=C
$(READELF
) -W
-l
$< > $@T
1905 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.phdr
)
1907 $(objpfx
)check-execstack.out
: $(..
)scripts
/check-execstack.awk \
1908 $(objpfx
)execstack-default \
1909 $(all-built-dso
:=.phdr
)
1910 LC_ALL
=C
$(AWK
) -v
"xfail=$(check-execstack-xfail)" -f
$^
> $@
; \
1912 generated
+= check-execstack.out
1914 $(objpfx
)check-wx-segment.out
: $(..
)scripts
/check-wx-segment.py \
1915 $(all-built-dso
:=.phdr
)
1916 $(PYTHON
) $^
--xfail
="$(check-wx-segment-xfail)" > $@
; \
1918 generated
+= check-wx-segment.out
1920 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
1922 $(all-built-dso
:=.jmprel
): %.jmprel
: % Makefile
1924 LC_ALL
=C
$(READELF
) -W
-S
-d
-r
$< > $@T
1927 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.jmprel
)
1929 localplt-built-dso
:= $(addprefix $(common-objpfx
),\
1934 resolv
/libresolv.so \
1936 ifeq ($(build-mathvec
),yes
)
1937 localplt-built-dso
+= $(addprefix $(common-objpfx
), mathvec
/libmvec.so
)
1939 ifeq ($(have-thread-library
),yes
)
1940 localplt-built-dso
+= $(filter-out %_nonshared.a
, $(shared-thread-library
))
1942 ifeq ($(build-crypt
),yes
)
1943 localplt-built-dso
+= $(addprefix $(common-objpfx
), crypt
/libcrypt.so
)
1945 ifneq ($(pthread-in-libc
),yes
)
1946 localplt-built-dso
+= $(addprefix $(common-objpfx
), rt
/librt.so
)
1949 vpath localplt.data
$(+sysdep_dirs
)
1951 $(objpfx
)check-localplt.out
: $(..
)scripts
/check-localplt.awk \
1952 $(..
)scripts
/localplt.awk \
1953 $(localplt-built-dso
:=.jmprel
) \
1955 LC_ALL
=C
$(AWK
) -f
$(filter-out $< %localplt.data
,$^
) | \
1956 LC_ALL
=C
$(AWK
) -f
$< $(filter %localplt.data
,$^
) - \
1961 $(all-built-dso
:=.dynsym
): %.dynsym
: %
1963 LC_ALL
=C
$(READELF
) -W
--dyn-syms
$< > $@T
1966 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dynsym
)
1968 $(objpfx
)check-initfini.out
: $(..
)scripts
/check-initfini.awk \
1969 $(all-built-dso
:=.dynsym
)
1970 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1972 generated
+= check-initfini.out
1974 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
1975 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
1976 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
1977 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
1979 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
1980 $(objpfx
)tst-deep1
: $(objpfx
)tst-deep1mod1.so
1981 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
1982 LDFLAGS-tst-deep1
+= -rdynamic
1983 tst-deep1mod3.so-no-z-defs
= yes
1985 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
1987 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
1989 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
1991 $(objpfx
)tst-dlmopen4.out
: $(objpfx
)tst-dlmopen1mod.so
1993 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
1994 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1996 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
$(objpfx
)tst-auditmod9b.so
1997 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1998 CFLAGS-tst-audit2.c
+= -fno-builtin
1999 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
2001 $(objpfx
)tst-audit9.out
: $(objpfx
)tst-auditmod9a.so
$(objpfx
)tst-auditmod9b.so
2002 tst-audit9-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod9a.so
2004 $(objpfx
)tst-audit8
: $(libm
)
2005 $(objpfx
)tst-audit8.out
: $(objpfx
)tst-auditmod1.so
2006 tst-audit8-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
2008 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
2010 $(objpfx
)tst-global2
: $(objpfx
)tst-globalmod2.so
2011 $(objpfx
)tst-global2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
2012 LDFLAGS-tst-global2
= -Wl
,--enable-new-dtags
2013 LDFLAGS-tst-globalmod2.so
= -Wl
,--enable-new-dtags
2015 $(objpfx
)order2.out
: $(objpfx
)order2mod1.so
$(objpfx
)order2mod2.so
2016 $(objpfx
)order2-cmp.out
: $(objpfx
)order2.out
2017 (echo
"12345" | cmp
$< -) > $@
; \
2019 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
2020 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
2021 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
2022 order2mod2.so-no-z-defs
= yes
2023 LDFLAGS-order2mod1.so
= -Wl
,--no-as-needed
2024 LDFLAGS-order2mod2.so
= -Wl
,--no-as-needed
2026 tst-stackguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
2027 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
2029 tst-ptrguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
2030 # When built statically, the pointer guard interface uses
2031 # __pointer_chk_guard_local.
2032 CFLAGS-tst-ptrguard1-static.c
+= -DPTRGUARD_LOCAL
2033 tst-ptrguard1-static-ARGS
= --command
"$(objpfx)tst-ptrguard1-static --child"
2035 $(objpfx
)tst-leaks1-mem.out
: $(objpfx
)tst-leaks1.out
2036 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
; \
2039 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace \
2040 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
2042 $(objpfx
)tst-thrlock
: $(shared-thread-library
)
2043 $(objpfx
)tst-thrlock.out
: $(libm
)
2044 $(objpfx
)tst-noload.out
: $(libm
)
2046 tst-tst-dlopen-tlsmodid-no-pie
= yes
2047 $(objpfx
)tst-dlopen-tlsmodid
: $(shared-thread-library
)
2048 $(objpfx
)tst-dlopen-tlsmodid.out
: $(objpfx
)tst-dlopen-self
2049 CFLAGS-tst-dlopen-tlsmodid-pie.c
+= $(pie-ccflag
)
2050 $(objpfx
)tst-dlopen-tlsmodid-pie
: $(shared-thread-library
)
2051 $(objpfx
)tst-dlopen-tlsmodid-pie.out
: $(objpfx
)tst-dlopen-self-pie
2052 $(objpfx
)tst-dlopen-tlsmodid-container
: $(shared-thread-library
)
2053 LDFLAGS-tst-dlopen-tlsmodid-container
+= -Wl
,-rpath
,\
$$ORIGIN
2055 tst-tst-dlopen-self-no-pie
= yes
2056 CFLAGS-tst-dlopen-self-pie.c
+= $(pie-ccflag
)
2057 LDFLAGS-tst-dlopen-self-container
+= -Wl
,-rpath
,\
$$ORIGIN
2059 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
2060 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
2061 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
2062 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
2063 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
2064 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
2065 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
2066 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
2067 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
2068 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
2069 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
2070 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
2071 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
2072 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
2073 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
2074 CFLAGS-ifuncmain9pic.c
+= $(pic-ccflag
)
2075 CFLAGS-ifuncmain9picstatic.c
+= $(pic-ccflag
)
2077 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
2079 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
2080 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
2081 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
2082 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
2083 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
2084 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
2085 CFLAGS-ifuncmain9pie.c
+= $(pie-ccflag
)
2086 CFLAGS-tst-ifunc-textrel.c
+= $(pic-ccflag
)
2088 LDFLAGS-ifuncmain6pie
= -Wl
,-z
,lazy
2090 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmod1.so
2091 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncdep1pic.o
2092 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmod1.so
2093 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmod5.so
2094 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmod6.so
2096 $(objpfx
)ifuncmain1
: $(addprefix $(objpfx
),ifuncmod1.so
)
2097 $(objpfx
)ifuncmain1pic
: $(addprefix $(objpfx
),ifuncmod1.so
)
2098 $(objpfx
)ifuncmain1staticpic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
2099 $(objpfx
)ifuncmain1static
: $(addprefix $(objpfx
),ifuncdep1.o
)
2100 $(objpfx
)ifuncmain1picstatic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
2101 $(objpfx
)ifuncmain1vis
: $(addprefix $(objpfx
),ifuncmod1.so
)
2102 $(objpfx
)ifuncmain1vispic
: $(addprefix $(objpfx
),ifuncmod1.so
)
2103 $(objpfx
)ifuncmain2
: $(addprefix $(objpfx
),ifuncdep2.o
)
2104 $(objpfx
)ifuncmain2pic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2105 $(objpfx
)ifuncmain2static
: $(addprefix $(objpfx
),ifuncdep2.o
)
2106 $(objpfx
)ifuncmain2picstatic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2108 $(objpfx
)ifuncmain3.out
: $(objpfx
)ifuncmod3.so
2110 $(objpfx
)ifuncmain5
: $(addprefix $(objpfx
),ifuncmod5.so
)
2111 $(objpfx
)ifuncmain5pic
: $(addprefix $(objpfx
),ifuncmod5.so
)
2112 $(objpfx
)ifuncmain5static
: $(addprefix $(objpfx
),ifuncdep5.o
)
2113 $(objpfx
)ifuncmain5staticpic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2114 $(objpfx
)ifuncmain5picstatic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2116 LDFLAGS-tst-ifunc-fault-lazy
= -Wl
,-z
,lazy
2117 LDFLAGS-tst-ifunc-fault-bindnow
= -Wl
,-z
,now
2118 define tst-ifunc-fault-script
2119 ( $(test-wrapper
) $(rtld-prefix
) --verify
$^ \
2120 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 $(rtld-prefix
) $^ \
2121 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 LD_DEBUG
=unused \
2123 ) > $@
; $(evaluate-test
)
2125 $(objpfx
)tst-ifunc-fault-lazy.out
: $(objpfx
)tst-ifunc-fault-lazy
$(objpfx
)ld.so
2126 $(tst-ifunc-fault-script
)
2127 $(objpfx
)tst-ifunc-fault-bindnow.out
: $(objpfx
)tst-ifunc-fault-bindnow \
2129 $(tst-ifunc-fault-script
)
2131 $(objpfx
)tst-unique1.out
: $(objpfx
)tst-unique1mod1.so \
2132 $(objpfx
)tst-unique1mod2.so
2134 $(objpfx
)tst-unique2
: $(objpfx
)tst-unique2mod1.so
2135 $(objpfx
)tst-unique2.out
: $(objpfx
)tst-unique2mod2.so
2137 $(objpfx
)tst-unique3
: $(objpfx
)tst-unique3lib.so
2138 $(objpfx
)tst-unique3.out
: $(objpfx
)tst-unique3lib2.so
2140 $(objpfx
)tst-unique4
: $(objpfx
)tst-unique4lib.so
2142 $(objpfx
)tst-nodelete.out
: $(objpfx
)tst-nodelete-uniquemod.so \
2143 $(objpfx
)tst-nodelete-rtldmod.so \
2144 $(objpfx
)tst-nodelete-zmod.so
2146 LDFLAGS-tst-nodelete
= -rdynamic
2147 LDFLAGS-tst-nodelete-zmod.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
2149 $(objpfx
)tst-nodelete2.out
: $(objpfx
)tst-nodelete2mod.so
2151 LDFLAGS-tst-nodelete2
= -rdynamic
2153 $(objpfx
)tst-initorder-cmp.out
: tst-initorder.exp
$(objpfx
)tst-initorder.out
2157 $(objpfx
)tst-initorder2
: $(objpfx
)tst-initorder2a.so
$(objpfx
)tst-initorder2d.so
$(objpfx
)tst-initorder2c.so
2158 $(objpfx
)tst-initorder2a.so
: $(objpfx
)tst-initorder2b.so
2159 $(objpfx
)tst-initorder2b.so
: $(objpfx
)tst-initorder2c.so
2160 $(objpfx
)tst-initorder2c.so
: $(objpfx
)tst-initorder2d.so
2161 LDFLAGS-tst-initorder2
= -Wl
,--no-as-needed
2162 LDFLAGS-tst-initorder2a.so
= -Wl
,--no-as-needed
2163 LDFLAGS-tst-initorder2b.so
= -Wl
,--no-as-needed
2164 LDFLAGS-tst-initorder2c.so
= -Wl
,--no-as-needed
2165 define o-iterator-doit
2166 $(objpfx
)tst-initorder2
$o.os
: tst-initorder2.c
; \
2167 $$(compile-command.c
) -DNAME
=\"$o\"
2169 object-suffixes-left
:= a b c d
2170 include $(o-iterator
)
2172 $(objpfx
)tst-initorder2-cmp.out
: tst-initorder2.exp
$(objpfx
)tst-initorder2.out
2176 $(objpfx
)tst-relsort1mod1.so
: $(libm
) $(objpfx
)tst-relsort1mod2.so
2177 $(objpfx
)tst-relsort1mod2.so
: $(libm
)
2178 $(objpfx
)tst-relsort1.out
: $(objpfx
)tst-relsort1mod1.so \
2179 $(objpfx
)tst-relsort1mod2.so
2181 $(objpfx
)tst-unused-dep.out
: $(objpfx
)testobj1.so
2182 $(test-wrapper-env
) \
2183 LD_TRACE_LOADED_OBJECTS
=1 \
2190 $(objpfx
)tst-unused-dep-cmp.out
: $(objpfx
)tst-unused-dep.out
2191 cmp
$< /dev
/null
> $@
; \
2194 $(objpfx
)tst-audit11.out
: $(objpfx
)tst-auditmod11.so
$(objpfx
)tst-audit11mod1.so
2195 tst-audit11-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod11.so
2196 $(objpfx
)tst-audit11mod1.so
: $(objpfx
)tst-audit11mod2.so
2197 LDFLAGS-tst-audit11mod2.so
= -Wl
,--version-script
=tst-audit11mod2.map
,-soname
,tst-audit11mod2.so
2199 $(objpfx
)tst-audit12.out
: $(objpfx
)tst-auditmod12.so
$(objpfx
)tst-audit12mod1.so
$(objpfx
)tst-audit12mod3.so
2200 tst-audit12-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod12.so
2201 $(objpfx
)tst-audit12mod1.so
: $(objpfx
)tst-audit12mod2.so
2202 LDFLAGS-tst-audit12mod2.so
= -Wl
,--version-script
=tst-audit12mod2.map
2204 $(objpfx
)tst-audit13.out
: $(objpfx
)tst-audit13mod1.so
2205 LDFLAGS-tst-audit13mod1.so
= -Wl
,-z
,lazy
2206 tst-audit13-ENV
= LD_AUDIT
=$(objpfx
)tst-audit13mod1.so
2208 $(objpfx
)tst-auditmany.out
: $(objpfx
)tst-auditmanymod1.so \
2209 $(objpfx
)tst-auditmanymod2.so
$(objpfx
)tst-auditmanymod3.so \
2210 $(objpfx
)tst-auditmanymod4.so
$(objpfx
)tst-auditmanymod5.so \
2211 $(objpfx
)tst-auditmanymod6.so
$(objpfx
)tst-auditmanymod7.so \
2212 $(objpfx
)tst-auditmanymod8.so
$(objpfx
)tst-auditmanymod9.so
2213 tst-auditmany-ENV
= \
2214 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
2216 LDFLAGS-tst-audit14
= -Wl
,--audit
=tst-auditlogmod-1.so
,--disable-new-dtags
2217 $(objpfx
)tst-auditlogmod-1.so
: $(libsupport
)
2218 $(objpfx
)tst-audit14.out
: $(objpfx
)tst-auditlogmod-1.so
2219 LDFLAGS-tst-audit14a
= -Wl
,--audit
=tst-auditlogmod-1.so
,--enable-new-dtags
2220 $(objpfx
)tst-audit14a.out
: $(objpfx
)tst-auditlogmod-1.so
2221 LDFLAGS-tst-audit15
= \
2222 -Wl
,--audit
=tst-auditlogmod-1.so
,--depaudit
=tst-auditlogmod-2.so
2223 $(objpfx
)tst-auditlogmod-2.so
: $(libsupport
)
2224 $(objpfx
)tst-audit15.out
: \
2225 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so
2226 LDFLAGS-tst-audit16
= \
2227 -Wl
,--audit
=tst-auditlogmod-1.so
:tst-auditlogmod-2.so \
2228 -Wl
,--depaudit
=tst-auditlogmod-3.so
2229 $(objpfx
)tst-auditlogmod-3.so
: $(libsupport
)
2230 $(objpfx
)tst-audit16.out
: \
2231 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so \
2232 $(objpfx
)tst-auditlogmod-3.so
2233 $(objpfx
)tst-audit17.out
: $(objpfx
)tst-auditmod17.so
2234 # The test check if a audit library without libc.so on DT_NEEDED works as
2235 # intended, so it uses an explicit link rule.
2236 $(objpfx
)tst-auditmod17.so
: $(objpfx
)tst-auditmod17.os
2237 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
2238 $(filter-out $(map-file
),$^
)
2239 $(call after-link
,$@.new
)
2241 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-auditmod17
)
2242 tst-audit17-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod17.so
2244 $(objpfx
)tst-audit14-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14.out
2247 $(objpfx
)tst-audit14a-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14a.out
2250 $(objpfx
)tst-audit15-cmp.out
: tst-audit15.exp
$(objpfx
)tst-audit15.out
2253 $(objpfx
)tst-audit16-cmp.out
: tst-audit16.exp
$(objpfx
)tst-audit16.out
2257 $(objpfx
)tst-audit18.out
: $(objpfx
)tst-auditmod18.so \
2258 $(objpfx
)tst-audit18mod.so
2259 tst-audit18-ARGS
= -- $(host-test-program-cmd
)
2261 $(objpfx
)tst-audit19a.out
: $(objpfx
)tst-auditmod19a.so
2262 tst-audit19a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod19a.so
2264 $(objpfx
)tst-audit19b.out
: $(objpfx
)tst-auditmod19b.so
2265 $(objpfx
)tst-audit19b
: $(objpfx
)tst-audit19bmod.so
2266 tst-audit19b-ARGS
= -- $(host-test-program-cmd
)
2268 $(objpfx
)tst-audit20.out
: $(objpfx
)tst-auditmod20.so
2269 tst-audit20-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod20.so
2271 $(objpfx
)tst-audit21
: $(shared-thread-library
)
2272 $(objpfx
)tst-audit21.out
: $(objpfx
)tst-auditmod21a.so
2273 $(objpfx
)tst-auditmod21a.so
: $(objpfx
)tst-auditmod21b.so
2274 tst-audit21-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod21a.so
2276 $(objpfx
)tst-audit22.out
: $(objpfx
)tst-auditmod22.so
2277 tst-audit22-ARGS
= -- $(host-test-program-cmd
)
2279 $(objpfx
)tst-audit23.out
: $(objpfx
)tst-auditmod23.so \
2280 $(objpfx
)tst-audit23mod.so
2281 tst-audit23-ARGS
= -- $(host-test-program-cmd
)
2283 $(objpfx
)tst-audit24a.out
: $(objpfx
)tst-auditmod24a.so
2284 $(objpfx
)tst-audit24a
: $(objpfx
)tst-audit24amod1.so \
2285 $(objpfx
)tst-audit24amod2.so
2286 tst-audit24a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24a.so
2287 LDFLAGS-tst-audit24a
= -Wl
,-z
,now
2289 $(objpfx
)tst-audit24b.out
: $(objpfx
)tst-auditmod24b.so
2290 $(objpfx
)tst-audit24b
: $(objpfx
)tst-audit24bmod1.so \
2291 $(objpfx
)tst-audit24bmod2.so
2292 $(objpfx
)tst-audit24bmod1
: $(objpfx
)tst-audit24bmod2.so
2293 # The test checks if a library without .gnu.version correctly calls the
2294 # audit callbacks. So it uses an explicit link rule to avoid linking
2296 $(objpfx
)tst-audit24bmod1.so
: $(objpfx
)tst-audit24bmod1.os
2297 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod1.os \
2299 $(call after-link
,$@.new
)
2301 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod1
)
2302 $(objpfx
)tst-audit24bmod2.so
: $(objpfx
)tst-audit24bmod2.os
2303 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod2.os
2304 $(call after-link
,$@.new
)
2306 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod2
)
2307 tst-audit24b-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24b.so
2308 LDFLAGS-tst-audit24b
= -Wl
,-z
,now
2310 # Same as tst-audit24a, but tests LD_BIND_NOW
2311 $(objpfx
)tst-audit24c.out
: $(objpfx
)tst-auditmod24c.so
2312 $(objpfx
)tst-audit24c
: $(objpfx
)tst-audit24amod1.so \
2313 $(objpfx
)tst-audit24amod2.so
2314 tst-audit24c-ENV
= LD_BIND_NOW
=1 LD_AUDIT
=$(objpfx
)tst-auditmod24c.so
2315 LDFLAGS-tst-audit24c
= -Wl
,-z
,lazy
2317 $(objpfx
)tst-audit24d.out
: $(objpfx
)tst-auditmod24d.so
2318 $(objpfx
)tst-audit24d
: $(objpfx
)tst-audit24dmod1.so \
2319 $(objpfx
)tst-audit24dmod2.so
2320 $(objpfx
)tst-audit24dmod1.so
: $(objpfx
)tst-audit24dmod3.so
2321 LDFLAGS-tst-audit24dmod1.so
= -Wl
,-z
,now
2322 $(objpfx
)tst-audit24dmod2.so
: $(objpfx
)tst-audit24dmod4.so
2323 LDFLAGS-tst-audit24dmod2.so
= -Wl
,-z
,lazy
2324 tst-audit24d-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24d.so
2325 LDFLAGS-tst-audit24d
= -Wl
,-z
,lazy
2327 $(objpfx
)tst-audit25a.out
: $(objpfx
)tst-auditmod25.so
2328 $(objpfx
)tst-audit25a
: $(objpfx
)tst-audit25mod1.so \
2329 $(objpfx
)tst-audit25mod2.so \
2330 $(objpfx
)tst-audit25mod3.so \
2331 $(objpfx
)tst-audit25mod4.so
2332 LDFLAGS-tst-audit25a
= -Wl
,-z
,lazy
2333 $(objpfx
)tst-audit25mod1.so
: $(objpfx
)tst-audit25mod3.so
2334 LDFLAGS-tst-audit25mod1.so
= -Wl
,-z
,now
2335 $(objpfx
)tst-audit25mod2.so
: $(objpfx
)tst-audit25mod4.so
2336 LDFLAGS-tst-audit25mod2.so
= -Wl
,-z
,lazy
2337 tst-audit25a-ARGS
= -- $(host-test-program-cmd
)
2339 $(objpfx
)tst-audit25b.out
: $(objpfx
)tst-auditmod25.so
2340 $(objpfx
)tst-audit25b
: $(objpfx
)tst-audit25mod1.so \
2341 $(objpfx
)tst-audit25mod2.so \
2342 $(objpfx
)tst-audit25mod3.so \
2343 $(objpfx
)tst-audit25mod4.so
2344 LDFLAGS-tst-audit25b
= -Wl
,-z
,now
2345 tst-audit25b-ARGS
= -- $(host-test-program-cmd
)
2347 $(objpfx
)tst-audit28.out
: $(objpfx
)tst-auditmod28.so
2348 $(objpfx
)tst-auditmod28.so
: $(libsupport
)
2349 tst-audit28-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod28.so
2351 # tst-sonamemove links against an older implementation of the library.
2352 LDFLAGS-tst-sonamemove-linkmod1.so
= \
2353 -Wl
,--version-script
=tst-sonamemove-linkmod1.map \
2354 -Wl
,-soname
,tst-sonamemove-runmod1.so
2355 LDFLAGS-tst-sonamemove-runmod1.so
= -Wl
,--no-as-needed \
2356 -Wl
,--version-script
=tst-sonamemove-runmod1.map \
2357 -Wl
,-soname
,tst-sonamemove-runmod1.so
2358 LDFLAGS-tst-sonamemove-runmod2.so
= \
2359 -Wl
,--version-script
=tst-sonamemove-runmod2.map \
2360 -Wl
,-soname
,tst-sonamemove-runmod2.so
2361 $(objpfx
)tst-sonamemove-runmod1.so
: $(objpfx
)tst-sonamemove-runmod2.so
2362 # Link against the link module, but depend on the run-time modules
2364 $(objpfx
)tst-sonamemove-link
: $(objpfx
)tst-sonamemove-linkmod1.so
2365 $(objpfx
)tst-sonamemove-link.out
: \
2366 $(objpfx
)tst-sonamemove-runmod1.so \
2367 $(objpfx
)tst-sonamemove-runmod2.so
2368 $(objpfx
)tst-sonamemove-dlopen.out
: \
2369 $(objpfx
)tst-sonamemove-runmod1.so \
2370 $(objpfx
)tst-sonamemove-runmod2.so
2372 $(objpfx
)tst-dlmopen-dlerror-mod.so
: $(libsupport
)
2373 $(objpfx
)tst-dlmopen-dlerror.out
: $(objpfx
)tst-dlmopen-dlerror-mod.so
2375 # Override -z defs, so that we can reference an undefined symbol.
2376 # Force lazy binding for the same reason.
2377 LDFLAGS-tst-latepthreadmod.so
= \
2378 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2379 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
2380 # function this_function_is_not_defined.
2381 CFLAGS-tst-latepthreadmod.c
+= -fno-optimize-sibling-calls
2382 $(objpfx
)tst-latepthreadmod.so
: $(shared-thread-library
)
2383 $(objpfx
)tst-latepthread.out
: $(objpfx
)tst-latepthreadmod.so
2385 # The test modules are parameterized by preprocessor macros.
2386 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules
)): \
2387 $(objpfx
)tst-tls-manydynamic
%mod.os
: tst-tls-manydynamicmod.c
2388 $(compile-command.c
) \
2389 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2390 $(objpfx
)tst-tls-manydynamic
: $(shared-thread-library
)
2391 $(objpfx
)tst-tls-manydynamic.out
: \
2392 $(patsubst %,$(objpfx
)%.so
,$(tst-tls-many-dynamic-modules
))
2394 $(objpfx
)tst-ldconfig-X.out
: tst-ldconfig-X.sh
$(objpfx
)ldconfig
2395 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
2396 '$(run-program-env)' > $@
; \
2399 # Test static linking of all the libraries we can possibly link
2400 # together. Note that in some configurations this may be less than the
2401 # complete list of libraries we build but we try to maxmimize this list.
2402 ifeq ($(pthread-in-libc
),no
)
2403 $(objpfx
)tst-linkall-static
: \
2404 $(common-objpfx
)resolv
/libanl.a
2406 $(objpfx
)tst-linkall-static
: \
2407 $(common-objpfx
)math
/libm.a \
2408 $(common-objpfx
)resolv
/libresolv.a \
2409 $(common-objpfx
)login
/libutil.a \
2410 $(common-objpfx
)rt
/librt.a \
2411 $(static-thread-library
)
2413 ifeq ($(build-crypt
),yes
)
2414 # If we are using NSS crypto and we have the ability to link statically
2415 # then we include libcrypt.a, otherwise we leave out libcrypt.a and
2416 # link as much as we can into the tst-linkall-static test. This assumes
2417 # that linking with libcrypt.a does everything required to include the
2418 # static NSS crypto library.
2419 ifeq (yesyes
,$(nss-crypt
)$(static-nss-crypt
))
2420 $(objpfx
)tst-linkall-static
: \
2421 $(common-objpfx
)crypt
/libcrypt.a
2423 # If we are not using NSS crypto then we always have the ability to link
2425 ifeq (no
,$(nss-crypt
))
2426 $(objpfx
)tst-linkall-static
: \
2427 $(common-objpfx
)crypt
/libcrypt.a
2431 LDFLAGS-nextmod3.so
= -Wl
,--version-script
=nextmod3.map
2433 # The application depends on the DSO, and the DSO loads the plugin.
2434 # The plugin also depends on the DSO. This creates the circular
2435 # dependency via dlopen that we're testing to make sure works.
2436 $(objpfx
)tst-nodelete-dlclose-plugin.so
: $(objpfx
)tst-nodelete-dlclose-dso.so
2437 $(objpfx
)tst-nodelete-dlclose
: $(objpfx
)tst-nodelete-dlclose-dso.so
2438 $(objpfx
)tst-nodelete-dlclose.out
: $(objpfx
)tst-nodelete-dlclose-dso.so \
2439 $(objpfx
)tst-nodelete-dlclose-plugin.so
2441 tst-env-setuid-ENV
= MALLOC_CHECK_
=2 MALLOC_MMAP_THRESHOLD_
=4096 \
2444 $(objpfx
)tst-debug1.out
: $(objpfx
)tst-debug1mod1.so
2446 $(objpfx
)tst-debug1mod1.so
: $(objpfx
)testobj1.so
2447 $(OBJCOPY
) --only-keep-debug
$< $@
2449 $(objpfx
)tst-main1
: $(objpfx
)tst-main1mod.so
2450 CRT-tst-main1
:= $(csu-objpfx
)crt1.o
2451 tst-main1-no-pie
= yes
2452 LDLIBS-tst-main1
= $(libsupport
)
2453 tst-main1mod.so-no-z-defs
= yes
2455 LDLIBS-tst-absolute-sym-lib.so
= tst-absolute-sym-lib.lds
2456 $(objpfx
)tst-absolute-sym-lib.so
: $(LDLIBS-tst-absolute-sym-lib.so
)
2457 $(objpfx
)tst-absolute-sym
: $(objpfx
)tst-absolute-sym-lib.so
2459 LDLIBS-tst-absolute-zero-lib.so
= tst-absolute-zero-lib.lds
2460 $(objpfx
)tst-absolute-zero-lib.so
: $(LDLIBS-tst-absolute-zero-lib.so
)
2461 $(objpfx
)tst-absolute-zero
: $(objpfx
)tst-absolute-zero-lib.so
2463 $(objpfx
)tst-big-note
: $(objpfx
)tst-big-note-lib.so
2464 # Avoid creating an ABI tag note, which may come before the
2465 # artificial, large note in tst-big-note-lib.o and invalidate the
2467 $(objpfx
)tst-big-note-lib.so
: $(objpfx
)tst-big-note-lib.o
2468 $(LINK.o
) -shared
-o
$@
$(LDFLAGS.so
) $(dt-relr-ldflag
) $<
2470 $(objpfx
)tst-unwind-ctor
: $(objpfx
)tst-unwind-ctor-lib.so
2472 CFLAGS-tst-unwind-main.c
+= -funwind-tables
-DUSE_PTHREADS
=0
2474 $(objpfx
)tst-initfinilazyfail.out
: \
2475 $(objpfx
)tst-initlazyfailmod.so
$(objpfx
)tst-finilazyfailmod.so
2476 # Override -z defs, so that we can reference an undefined symbol.
2477 # Force lazy binding for the same reason.
2478 LDFLAGS-tst-initlazyfailmod.so
= \
2479 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2480 LDFLAGS-tst-finilazyfailmod.so
= \
2481 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2483 $(objpfx
)tst-dlopenfail.out
: \
2484 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so
2485 # Order matters here. tst-dlopenfaillinkmod.so's soname ensures a
2486 # run-time loader failure. --as-needed breaks this test because
2487 # nothing actually references tst-dlopenfailmod2.so (with its soname
2488 # tst-dlopenfail-missingmod.so).
2489 LDFLAGS-tst-dlopenfailmod1.so
= -Wl
,--no-as-needed
2490 $(objpfx
)tst-dlopenfailmod1.so
: \
2491 $(shared-thread-library
) $(objpfx
)tst-dlopenfaillinkmod.so
2492 LDFLAGS-tst-dlopenfaillinkmod.so
= -Wl
,-soname
,tst-dlopenfail-missingmod.so
2493 $(objpfx
)tst-dlopenfailmod2.so
: $(objpfx
)tst-dlopenfailnodelmod.so
2494 $(objpfx
)tst-dlopenfail-2.out
: \
2495 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so \
2496 $(objpfx
)tst-dlopenfailmod3.so
2497 # tst-dlopenfailnodelmod.so emulates how libpthread was linked.
2498 $(objpfx
)tst-dlopenfailnodelmod.so
: $(libsupport
)
2499 LDFLAGS-tst-dlopenfailnodelmod.so
= \
2500 -Wl
,--enable-new-dtags
,-z
,nodelete
,-z
,initfirst
2501 # tst-dlopenfail should export the libsupport symbols, so that
2502 # tst-dlopenfailnodelmod.so uses them for error reporting.
2503 LDFLAGS-tst-dlopenfail
= -Wl
,-E
2505 $(objpfx
)tst-dlopen-nodelete-reloc.out
: \
2506 $(objpfx
)tst-dlopen-nodelete-reloc-mod1.so \
2507 $(objpfx
)tst-dlopen-nodelete-reloc-mod2.so \
2508 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so \
2509 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so \
2510 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so \
2511 $(objpfx
)tst-dlopen-nodelete-reloc-mod6.so \
2512 $(objpfx
)tst-dlopen-nodelete-reloc-mod7.so \
2513 $(objpfx
)tst-dlopen-nodelete-reloc-mod8.so \
2514 $(objpfx
)tst-dlopen-nodelete-reloc-mod9.so \
2515 $(objpfx
)tst-dlopen-nodelete-reloc-mod10.so \
2516 $(objpfx
)tst-dlopen-nodelete-reloc-mod11.so \
2517 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so \
2518 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so \
2519 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so \
2520 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2521 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so \
2522 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
2523 tst-dlopen-nodelete-reloc-mod2.so-no-z-defs
= yes
2524 LDFLAGS-tst-dlopen-nodelete-reloc-mod2.so
= -Wl
,-z
,nodelete
2525 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
: \
2526 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so
2527 LDFLAGS-tst-dlopen-nodelete-reloc-mod4.so
= -Wl
,--no-as-needed
2528 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so
: \
2529 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
2530 LDFLAGS-tst-dlopen-nodelete-reloc-mod5.so
= -Wl
,-z
,nodelete
,--no-as-needed
2531 tst-dlopen-nodelete-reloc-mod5.so-no-z-defs
= yes
2532 tst-dlopen-nodelete-reloc-mod7.so-no-z-defs
= yes
2533 tst-dlopen-nodelete-reloc-mod11.so-no-z-defs
= yes
2534 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so
: \
2535 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so
2536 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
: \
2537 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so
2538 tst-dlopen-nodelete-reloc-mod16.so-no-z-defs
= yes
2539 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
: \
2540 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
2541 LDFLAGS-tst-dlopen-nodelete-reloc-mod16.so
= -Wl
,--no-as-needed
2542 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
: \
2543 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2544 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
2545 LDFLAGS-tst-dlopen-nodelete-reloc-mod17.so
= -Wl
,--no-as-needed
2547 $(objpfx
)tst-ldconfig-ld_so_conf-update.out
: $(objpfx
)tst-ldconfig-ld-mod.so
2549 LDFLAGS-tst-filterobj-flt.so
= -Wl
,--filter=$(objpfx
)tst-filterobj-filtee.so
2550 $(objpfx
)tst-filterobj
: $(objpfx
)tst-filterobj-flt.so
2551 $(objpfx
)tst-filterobj.out
: $(objpfx
)tst-filterobj-filtee.so
2552 $(objpfx
)tst-filterobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2554 LDFLAGS-tst-filterobj-aux.so
= -Wl
,--auxiliary
=$(objpfx
)tst-filterobj-filtee.so
2555 $(objpfx
)tst-auxobj
: $(objpfx
)tst-filterobj-aux.so
2556 $(objpfx
)tst-auxobj.out
: $(objpfx
)tst-filterobj-filtee.so
2557 $(objpfx
)tst-auxobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2559 $(objpfx
)tst-single_threaded
: $(objpfx
)tst-single_threaded-mod1.so
2560 $(objpfx
)tst-single_threaded.out
: \
2561 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so
2562 $(objpfx
)tst-single_threaded-static-dlopen
: \
2563 $(objpfx
)tst-single_threaded-mod1.o
2564 $(objpfx
)tst-single_threaded-static-dlopen.out
: \
2565 $(objpfx
)tst-single_threaded-mod2.so
2566 $(objpfx
)tst-single_threaded-pthread
: \
2567 $(objpfx
)tst-single_threaded-mod1.so
$(shared-thread-library
)
2568 $(objpfx
)tst-single_threaded-pthread.out
: \
2569 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so \
2570 $(objpfx
)tst-single_threaded-mod4.so
2571 $(objpfx
)tst-single_threaded-pthread-static
: $(static-thread-library
)
2573 $(objpfx
)tst-tls-ie
: $(shared-thread-library
)
2574 $(objpfx
)tst-tls-ie.out
: \
2575 $(objpfx
)tst-tls-ie-mod0.so \
2576 $(objpfx
)tst-tls-ie-mod1.so \
2577 $(objpfx
)tst-tls-ie-mod2.so \
2578 $(objpfx
)tst-tls-ie-mod3.so \
2579 $(objpfx
)tst-tls-ie-mod4.so \
2580 $(objpfx
)tst-tls-ie-mod5.so \
2581 $(objpfx
)tst-tls-ie-mod6.so
2583 $(objpfx
)tst-tls-ie-dlmopen
: $(shared-thread-library
)
2584 $(objpfx
)tst-tls-ie-dlmopen.out
: \
2585 $(objpfx
)tst-tls-ie-mod0.so \
2586 $(objpfx
)tst-tls-ie-mod1.so \
2587 $(objpfx
)tst-tls-ie-mod2.so \
2588 $(objpfx
)tst-tls-ie-mod3.so \
2589 $(objpfx
)tst-tls-ie-mod4.so \
2590 $(objpfx
)tst-tls-ie-mod5.so \
2591 $(objpfx
)tst-tls-ie-mod6.so
2593 $(objpfx
)argv0test.out
: tst-rtld-argv0.sh
$(objpfx
)ld.so \
2595 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)argv0test \
2596 '$(test-wrapper-env)' '$(run_program_env)' \
2597 '$(rpath-link)' 'test-argv0' > $@
; \
2600 # A list containing the name of the most likely searched subdirectory
2601 # of the glibc-hwcaps directory, for each supported architecture (in
2602 # other words, the oldest hardware level recognized by the
2603 # glibc-hwcaps mechanism for this architecture). Used to obtain test
2604 # coverage for some glibc-hwcaps tests for the widest possible range
2606 glibc-hwcaps-first-subdirs-for-tests
= power9 x86-64-v2 z13
2608 # The test modules are parameterized by preprocessor macros.
2609 LDFLAGS-libmarkermod1-1.so
+= -Wl
,-soname
,libmarkermod1.so
2610 LDFLAGS-libmarkermod2-1.so
+= -Wl
,-soname
,libmarkermod2.so
2611 LDFLAGS-libmarkermod3-1.so
+= -Wl
,-soname
,libmarkermod3.so
2612 LDFLAGS-libmarkermod4-1.so
+= -Wl
,-soname
,libmarkermod4.so
2613 LDFLAGS-libmarkermod5-1.so
+= -Wl
,-soname
,libmarkermod5.so
2614 $(objpfx
)libmarkermod
%.os
: markermodMARKER-VALUE.c
2615 $(compile-command.c
) \
2616 -DMARKER
=marker
$(firstword $(subst -, ,$*)) \
2617 -DVALUE
=$(lastword
$(subst -, ,$*))
2618 $(objpfx
)libmarkermod1.so
: $(objpfx
)libmarkermod1-1.so
2620 $(objpfx
)libmarkermod2.so
: $(objpfx
)libmarkermod2-1.so
2622 $(objpfx
)libmarkermod3.so
: $(objpfx
)libmarkermod3-1.so
2624 $(objpfx
)libmarkermod4.so
: $(objpfx
)libmarkermod4-1.so
2626 $(objpfx
)libmarkermod5.so
: $(objpfx
)libmarkermod5-1.so
2629 # tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is
2630 # preferred over auto-detected subdirectories.
2631 $(objpfx
)tst-glibc-hwcaps-prepend
: $(objpfx
)libmarkermod1-1.so
2632 $(objpfx
)glibc-hwcaps
/prepend-markermod1
/libmarkermod1.so
: \
2633 $(objpfx
)libmarkermod1-2.so
2634 $(make-target-directory
)
2636 $(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
: $(objpfx
)libmarkermod1-3.so
2637 $(make-target-directory
)
2639 $(objpfx
)tst-glibc-hwcaps-prepend.out
: \
2640 $(objpfx
)tst-glibc-hwcaps-prepend
$(objpfx
)libmarkermod1.so \
2641 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,prepend-markermod1 \
2642 $(glibc-hwcaps-first-subdirs-for-tests
))
2643 $(test-wrapper
) $(rtld-prefix
) \
2644 --glibc-hwcaps-prepend prepend-markermod1 \
2648 # Like tst-glibc-hwcaps-prepend, but uses a container and loads the
2649 # library via ld.so.cache. Test setup is contained in the test
2651 $(objpfx
)tst-glibc-hwcaps-prepend-cache.out
: \
2652 $(objpfx
)tst-glibc-hwcaps-prepend-cache
$(objpfx
)libmarkermod1-1.so \
2653 $(objpfx
)libmarkermod1-2.so
$(objpfx
)libmarkermod1-3.so
2655 # tst-glibc-hwcaps-mask checks that --glibc-hwcaps-mask can be used to
2656 # suppress all auto-detected subdirectories.
2657 $(objpfx
)tst-glibc-hwcaps-mask
: $(objpfx
)libmarkermod1-1.so
2658 $(objpfx
)tst-glibc-hwcaps-mask.out
: \
2659 $(objpfx
)tst-glibc-hwcaps-mask
$(objpfx
)libmarkermod1.so \
2660 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,\
2661 $(glibc-hwcaps-first-subdirs-for-tests
))
2662 $(test-wrapper
) $(rtld-prefix
) \
2663 --glibc-hwcaps-mask does-not-exist \
2667 # Generic dependency for sysdeps implementation of
2668 # tst-glibc-hwcaps-cache.
2669 $(objpfx
)tst-glibc-hwcaps-cache.out
: $(objpfx
)tst-glibc-hwcaps
2671 $(objpfx
)list-tunables.out
: tst-rtld-list-tunables.sh
$(objpfx
)ld.so
2672 $(SHELL
) $< $(objpfx
)ld.so
'$(test-wrapper-env)' \
2673 '$(run_program_env)' > $(objpfx
)/tst-rtld-list-tunables.out
2674 cmp tst-rtld-list-tunables.exp \
2675 $(objpfx
)/tst-rtld-list-tunables.out
> $@
; \
2678 tst-dst-static-ENV
= LD_LIBRARY_PATH
='$$ORIGIN'
2680 $(objpfx
)tst-rtld-help.out
: $(objpfx
)ld.so
2681 $(test-wrapper
) $(rtld-prefix
) --help
> $@
; \
2683 echo
"info: ld.so exit status: $$status" >> $@
; \
2687 # Reuses tst-tls-many-dynamic-modules
2688 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep
)): \
2689 $(objpfx
)tst-tls-manydynamic
%mod-dep.os
: tst-tls-manydynamicmod.c
2690 $(compile-command.c
) \
2691 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2692 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep-bad
)): \
2693 $(objpfx
)tst-tls-manydynamic
%mod-dep-bad.os
: tst-tls-manydynamicmod.c
2694 $(compile-command.c
) \
2695 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2696 tst-tls20mod-bad.so-no-z-defs
= yes
2697 # Single dependency.
2698 $(objpfx
)tst-tls-manydynamic0mod-dep.so
: $(objpfx
)tst-tls-manydynamic1mod-dep.so
2699 # Double dependencies.
2700 $(objpfx
)tst-tls-manydynamic2mod-dep.so
: $(objpfx
)tst-tls-manydynamic3mod-dep.so \
2701 $(objpfx
)tst-tls-manydynamic4mod-dep.so
2702 # Double dependencies with each dependency depent of another module.
2703 $(objpfx
)tst-tls-manydynamic5mod-dep.so
: $(objpfx
)tst-tls-manydynamic6mod-dep.so \
2704 $(objpfx
)tst-tls-manydynamic7mod-dep.so
2705 $(objpfx
)tst-tls-manydynamic6mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2706 $(objpfx
)tst-tls-manydynamic7mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2707 # Long chain with one double dependency in the middle
2708 $(objpfx
)tst-tls-manydynamic9mod-dep.so
: $(objpfx
)tst-tls-manydynamic10mod-dep.so \
2709 $(objpfx
)tst-tls-manydynamic11mod-dep.so
2710 $(objpfx
)tst-tls-manydynamic10mod-dep.so
: $(objpfx
)tst-tls-manydynamic12mod-dep.so
2711 $(objpfx
)tst-tls-manydynamic12mod-dep.so
: $(objpfx
)tst-tls-manydynamic13mod-dep.so
2712 # Long chain with two double depedencies in the middle
2713 $(objpfx
)tst-tls-manydynamic14mod-dep.so
: $(objpfx
)tst-tls-manydynamic15mod-dep.so
2714 $(objpfx
)tst-tls-manydynamic15mod-dep.so
: $(objpfx
)tst-tls-manydynamic16mod-dep.so \
2715 $(objpfx
)tst-tls-manydynamic17mod-dep.so
2716 $(objpfx
)tst-tls-manydynamic16mod-dep.so
: $(objpfx
)tst-tls-manydynamic18mod-dep.so \
2717 $(objpfx
)tst-tls-manydynamic19mod-dep.so
2718 # Same but with an invalid module.
2719 # Single dependency.
2720 $(objpfx
)tst-tls-manydynamic0mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2721 LDFLAGS-tst-tls-manydynamic0mod-dep-bad.so
= -Wl
,--no-as-needed
2722 # Double dependencies.
2723 $(objpfx
)tst-tls-manydynamic1mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic2mod-dep-bad.so \
2724 $(objpfx
)tst-tls20mod-bad.so
2725 LDFLAGS-tst-tls-manydynamic1mod-dep-bad.so
= -Wl
,--no-as-needed
2726 # Double dependencies with each dependency depent of another module.
2727 $(objpfx
)tst-tls-manydynamic3mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so \
2728 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
2729 LDFLAGS-tst-tls-manydynamic3mod-dep-bad.so
= -Wl
,--no-as-needed
2730 $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2731 LDFLAGS-tst-tls-manydynamic4mod-dep-bad.so
= -Wl
,--no-as-needed
2732 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2733 LDFLAGS-tst-tls-manydynamic5mod-dep-bad.so
= -Wl
,--no-as-needed
2734 # Long chain with one double dependency in the middle
2735 $(objpfx
)tst-tls-manydynamic6mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so \
2736 $(objpfx
)tst-tls-manydynamic8mod-dep-bad.so
2737 LDFLAGS-tst-tls-manydynamic6mod-dep-bad.so
= -Wl
,--no-as-needed
2738 $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
2739 LDFLAGS-tst-tls-manydynamic7mod-dep-bad.so
= -Wl
,--no-as-needed
2740 $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2741 LDFLAGS-tst-tls-manydynamic9mod-dep-bad.so
= -Wl
,--no-as-needed
2742 # Long chain with two double depedencies in the middle
2743 $(objpfx
)tst-tls-manydynamic10mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
2744 LDFLAGS-tst-tls-manydynamic10mod-dep-bad.so
= -Wl
,--no-as-needed
2745 $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so \
2746 $(objpfx
)tst-tls-manydynamic13mod-dep-bad.so
2747 LDFLAGS-tst-tls-manydynamic11mod-dep-bad.so
= -Wl
,--no-as-needed
2748 $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic14mod-dep-bad.so \
2749 $(objpfx
)tst-tls20mod-bad.so
2750 LDFLAGS-tst-tls-manydynamic12mod-dep-bad.so
= -Wl
,--no-as-needed
2751 $(objpfx
)tst-tls20
: $(shared-thread-library
)
2752 $(objpfx
)tst-tls20.out
: $(objpfx
)tst-tls20mod-bad.so \
2753 $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
) \
2754 $(tst-tls-many-dynamic-modules-dep
:%=$(objpfx
)%.so
) \
2755 $(tst-tls-many-dynamic-modules-dep-bad
:%=$(objpfx
)%.so
) \
2757 # Reuses tst-tls-many-dynamic-modules
2758 $(objpfx
)tst-tls21
: $(shared-thread-library
)
2759 $(objpfx
)tst-tls21.out
: $(objpfx
)tst-tls21mod.so
2760 $(objpfx
)tst-tls21mod.so
: $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
)
2762 $(objpfx
)tst-getauxval-static.out
: $(objpfx
)tst-auxvalmod.so
2763 tst-getauxval-static-ENV
= LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
)
2765 $(objpfx
)tst-dlmopen-gethostbyname.out
: $(objpfx
)tst-dlmopen-gethostbyname-mod.so
2767 $(objpfx
)tst-ro-dynamic
: $(objpfx
)tst-ro-dynamic-mod.so
2768 $(objpfx
)tst-ro-dynamic-mod.so
: $(objpfx
)tst-ro-dynamic-mod.os \
2769 tst-ro-dynamic-mod.map
2770 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@ \
2772 -Wl
,--script
=tst-ro-dynamic-mod.map \
2773 $(objpfx
)tst-ro-dynamic-mod.os
2775 $(objpfx
)tst-rtld-run-static.out
: $(objpfx
)/ldconfig
2777 $(objpfx
)tst-dl_find_object.out
: \
2778 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2779 $(objpfx
)tst-dl_find_object-static.out
: \
2780 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2781 tst-dl_find_object-static-ENV
= $(static-dlopen-environment
)
2782 CFLAGS-tst-dl_find_object.c
+= -funwind-tables
2783 CFLAGS-tst-dl_find_object-static.c
+= -funwind-tables
2784 LDFLAGS-tst-dl_find_object-static
+= -Wl
,--eh-frame-hdr
2785 CFLAGS-tst-dl_find_object-mod1.c
+= -funwind-tables
2786 CFLAGS-tst-dl_find_object-mod2.c
+= -funwind-tables
2787 LDFLAGS-tst-dl_find_object-mod2.so
+= -Wl
,--enable-new-dtags
,-z
,nodelete
2788 $(objpfx
)tst-dl_find_object-threads
: $(shared-thread-library
)
2789 CFLAGS-tst-dl_find_object-threads.c
+= -funwind-tables
2790 $(objpfx
)tst-dl_find_object-threads.out
: \
2791 $(objpfx
)tst-dl_find_object-mod1.so \
2792 $(objpfx
)tst-dl_find_object-mod2.so \
2793 $(objpfx
)tst-dl_find_object-mod3.so \
2794 $(objpfx
)tst-dl_find_object-mod4.so \
2795 $(objpfx
)tst-dl_find_object-mod5.so \
2796 $(objpfx
)tst-dl_find_object-mod6.so \
2797 $(objpfx
)tst-dl_find_object-mod7.so \
2798 $(objpfx
)tst-dl_find_object-mod8.so \
2799 $(objpfx
)tst-dl_find_object-mod9.so
2800 CFLAGS-tst-dl_find_object-mod3.c
+= -funwind-tables
2801 CFLAGS-tst-dl_find_object-mod4.c
+= -funwind-tables
2802 CFLAGS-tst-dl_find_object-mod5.c
+= -funwind-tables
2803 CFLAGS-tst-dl_find_object-mod6.c
+= -funwind-tables
2804 CFLAGS-tst-dl_find_object-mod7.c
+= -funwind-tables
2805 CFLAGS-tst-dl_find_object-mod8.c
+= -funwind-tables
2806 CFLAGS-tst-dl_find_object-mod9.c
+= -funwind-tables
2808 $(objpfx
)tst-p_alignmod-base.so
: $(libsupport
)
2809 LDFLAGS-tst-p_alignmod-base.so
+= -Wl
,-z
,max-page-size
=0x200000
2811 $(objpfx
)tst-p_align1
: $(objpfx
)tst-p_alignmod1.so
2813 # Make a copy of tst-p_alignmod-base.so and lower p_align of the first
2815 $(objpfx
)tst-p_alignmod1.so
: $(objpfx
)tst-p_alignmod-base.so
2817 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2818 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a half
$@
2820 $(objpfx
)tst-p_align2
: $(objpfx
)tst-p_alignmod2.so
2822 # Make a copy of tst-p_alignmod-base.so and update p_align of the first
2824 $(objpfx
)tst-p_alignmod2.so
: $(objpfx
)tst-p_alignmod-base.so
2826 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2827 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a
1 $@
2829 LDFLAGS-tst-p_alignmod3.so
+= -Wl
,-z
,max-page-size
=0x100,-z
,common-page-size
=0x100
2831 $(objpfx
)tst-p_align3
: $(objpfx
)tst-p_alignmod3.so
2832 $(objpfx
)tst-p_align3.out
: tst-p_align3.sh
$(objpfx
)tst-p_align3
2833 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)'; \
2836 $(objpfx
)check-abi-version-libc.out
: $(common-objpfx
)libc.so
2837 LC_ALL
=C
$(READELF
) -V
-W
$< \
2838 | sed
-ne
'/.gnu.version_d/, /.gnu.version_r/ p' \
2839 | grep GLIBC_ABI_DT_RELR
> $@
; \
2842 $(objpfx
)check-tst-relr-pie.out
: $(objpfx
)tst-relr-pie
2843 LC_ALL
=C
$(OBJDUMP
) -p
$< \
2844 | sed
-ne
'/required from libc.so/,$$ p' \
2845 | grep GLIBC_ABI_DT_RELR
> $@
; \
2848 # The test checks if a DT_RELR shared library without DT_NEEDED works as
2849 # intended, so it uses an explicit link rule.
2850 $(objpfx
)tst-relr2
: $(objpfx
)tst-relr-mod2.so
2851 $(objpfx
)tst-relr-mod2.so
: $(objpfx
)tst-relr-mod2.os
2852 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2853 $(LDFLAGS-soname-fname
) \
2854 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2855 $(call after-link
,$@.new
)
2858 # The test checks if a DT_RELR shared library without DT_VERNEED works as
2859 # intended, so it uses an explicit link rule.
2860 $(objpfx
)tst-relr3
: $(objpfx
)tst-relr-mod3a.so
2861 $(objpfx
)tst-relr-mod3b.so
: $(objpfx
)tst-relr-mod3b.os
2862 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2863 $(LDFLAGS-soname-fname
) \
2864 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2865 $(call after-link
,$@.new
)
2868 $(objpfx
)tst-relr-mod3a.so
: $(objpfx
)tst-relr-mod3a.os \
2869 $(objpfx
)tst-relr-mod3b.so
2870 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2871 $(LDFLAGS-soname-fname
) $(LDFLAGS-rpath-ORIGIN
) \
2872 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2873 $(call after-link
,$@.new
)
2876 # The test checks if a DT_RELR shared library without libc.so on DT_NEEDED
2877 # works as intended, so it uses an explicit link rule.
2878 $(objpfx
)tst-relr4
: $(objpfx
)tst-relr-mod4a.so
2879 $(objpfx
)tst-relr-mod4b.so
: $(objpfx
)tst-relr-mod4b.os
2880 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2881 $(LDFLAGS-soname-fname
) \
2882 -Wl
,--version-script
=tst-relr-mod4b.map \
2883 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2884 $(call after-link
,$@.new
)
2887 $(objpfx
)tst-relr-mod4a.so
: $(objpfx
)tst-relr-mod4a.os \
2888 $(objpfx
)tst-relr-mod4b.so
2889 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2890 $(LDFLAGS-soname-fname
) $(LDFLAGS-rpath-ORIGIN
) \
2891 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2892 $(call after-link
,$@.new
)
2895 LDFLAGS-libtracemod1-1.so
+= -Wl
,-soname
,libtracemod1.so
2896 LDFLAGS-libtracemod2-1.so
+= -Wl
,-soname
,libtracemod2.so
2897 LDFLAGS-libtracemod3-1.so
+= -Wl
,-soname
,libtracemod3.so
2898 LDFLAGS-libtracemod4-1.so
+= -Wl
,-soname
,libtracemod4.so
2899 LDFLAGS-libtracemod5-1.so
+= -Wl
,-soname
,libtracemod5.so
2901 $(objpfx
)libtracemod1-1.so
: $(objpfx
)libtracemod2-1.so \
2902 $(objpfx
)libtracemod3-1.so
2903 $(objpfx
)libtracemod2-1.so
: $(objpfx
)libtracemod4-1.so \
2904 $(objpfx
)libtracemod5-1.so
2906 define libtracemod-x
2907 $(objpfx
)libtracemod
$(1)/libtracemod
$(1).so
: $(objpfx
)libtracemod
$(1)-1.so
2908 $$(make-target-directory
)
2911 libtracemod-suffixes
= 1 2 3 4 5
2912 $(foreach i
,$(libtracemod-suffixes
), $(eval
$(call libtracemod-x
,$(i
))))
2914 define tst-trace-skeleton
2915 $(objpfx
)tst-trace
$(1).out
: $(objpfx
)libtracemod1
/libtracemod1.so \
2916 $(objpfx
)libtracemod2
/libtracemod2.so \
2917 $(objpfx
)libtracemod3
/libtracemod3.so \
2918 $(objpfx
)libtracemod4
/libtracemod4.so \
2919 $(objpfx
)libtracemod5
/libtracemod5.so \
2920 $(..
)scripts
/tst-ld-trace.py \
2922 ${ $(PYTHON
) $(..
)scripts
/tst-ld-trace.py \
2923 "$(test-wrapper-env) $(elf-objpfx)$(rtld-installed-name) \
2924 --library-path $(common-objpfx):$(strip $(2)) \
2925 $(objpfx)libtracemod1/libtracemod1.so" tst-trace
$(1).exp \
2926 } > $$@
; $$(evaluate-test
)
2929 $(eval
$(call tst-trace-skeleton
,1,))
2930 $(eval
$(call tst-trace-skeleton
,2,\
2931 $(objpfx
)libtracemod2
))
2932 $(eval
$(call tst-trace-skeleton
,3,\
2933 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
))
2934 $(eval
$(call tst-trace-skeleton
,4,\
2935 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
:$(objpfx
)libtracemod4
))
2936 $(eval
$(call tst-trace-skeleton
,5,\
2937 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
:$(objpfx
)libtracemod4
:$(objpfx
)libtracemod5
))
2939 $(objpfx
)tst-tls-allocation-failure-static-patched
: \
2940 $(objpfx
)tst-tls-allocation-failure-static
$(..
)scripts
/tst-elf-edit.py
2942 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
--maximize-tls-size
$@
2944 $(objpfx
)tst-tls-allocation-failure-static-patched.out
: \
2945 $(objpfx
)tst-tls-allocation-failure-static-patched
2946 $< > $@
2>&1; echo
"status: $$?" >> $@
2947 grep
-q
'^Fatal glibc error: Cannot allocate TLS block$$' $@ \
2948 && grep
-q
'^status: 127$$' $@
; \
2951 $(objpfx
)tst-audit-tlsdesc
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
2952 $(objpfx
)tst-audit-tlsdesc-mod2.so \
2953 $(shared-thread-library
)
2954 ifeq (yes
,$(have-mtls-dialect-gnu2
))
2955 # The test is valid for all TLS types, but we want to exercise GNU2
2957 CFLAGS-tst-audit-tlsdesc-mod1.c
+= -mtls-dialect
=gnu2
2958 CFLAGS-tst-audit-tlsdesc-mod2.c
+= -mtls-dialect
=gnu2
2960 $(objpfx
)tst-audit-tlsdesc-dlopen
: $(shared-thread-library
)
2961 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
2962 $(objpfx
)tst-audit-tlsdesc-mod2.so
2963 $(objpfx
)tst-audit-tlsdesc-mod1.so
: $(objpfx
)tst-audit-tlsdesc-mod2.so
2964 $(objpfx
)tst-audit-tlsdesc.out
: $(objpfx
)tst-auditmod-tlsdesc.so
2965 tst-audit-tlsdesc-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
2966 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-auditmod-tlsdesc.so
2967 tst-audit-tlsdesc-dlopen-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
2969 $(objpfx
)tst-dlmopen-twice.out
: \
2970 $(objpfx
)tst-dlmopen-twice-mod1.so \
2971 $(objpfx
)tst-dlmopen-twice-mod2.so