1 # Copyright (C) 1995-2024 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 \
52 # The core dynamic linking functions are in libc for the static and
55 dl-call-libc-early-init \
80 dl-thread_gscope_wait \
89 ifeq (yes
,$(use-ldconfig
))
90 dl-routines
+= dl-cache
93 ifeq (yesyes
,$(build-shared
)$(run-built-tests
))
94 tests-special
+= $(objpfx
)list-tunables.out
97 # Make sure that the compiler does not insert any library calls in tunables
99 ifeq (yes
,$(have-loop-to-function
))
100 CFLAGS-dl-tunables.c
+= -fno-tree-loop-distribute-patterns
103 all-dl-routines
= $(dl-routines
) $(sysdep-dl-routines
)
104 # But they are absent from the shared libc, because that code is in ld.so.
105 elide-routines.os
= \
110 dl-reloc-static-pie \
118 # These object files are only included in the dynamically-linked libc.
119 shared-only-routines
= \
122 libc-dl_find_object \
123 # shared-only-routines
125 # ld.so uses those routines, plus some special stuff for being the program
126 # interpreter and operating independent of libc.
133 dl-diagnostics-kernel \
147 all-rtld-routines
= $(rtld-routines
) $(sysdep-rtld-routines
)
149 CFLAGS-dl-runtime.c
+= -fexceptions
-fasynchronous-unwind-tables
150 CFLAGS-dl-lookup.c
+= -fexceptions
-fasynchronous-unwind-tables
151 CFLAGS-dl-iteratephdr.c
+= $(uses-callbacks
)
153 # Called during static library initialization, so turn stack-protection
154 # off for non-shared builds.
155 CFLAGS-dl-minimal-malloc.o
= $(no-stack-protector
)
156 CFLAGS-dl-minimal-malloc.op
= $(no-stack-protector
)
158 # On targets without __builtin_memset, rtld.c uses a hand-coded loop
159 # in _dl_start. Make sure this isn't turned into a call to regular memset.
160 ifeq (yes
,$(have-loop-to-function
))
161 CFLAGS-rtld.c
+= -fno-tree-loop-distribute-patterns
164 # Compile rtld itself without stack protection.
165 # Also compile all routines in the static library that are elided from
166 # the shared libc because they are in libc.a in the same way.
168 CFLAGS-.o
+= $(call elide-stack-protector
,.o
,$(elide-routines.os
))
169 CFLAGS-.op
+= $(call elide-stack-protector
,.op
,$(elide-routines.os
))
170 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,$(all-rtld-routines
))
172 # Add the requested compiler flags to the early startup code.
173 CFLAGS-dl-printf.os
+= $(rtld-early-cflags
)
174 CFLAGS-dl-setup_hash.os
+= $(rtld-early-cflags
)
175 CFLAGS-dl-sysdep.os
+= $(rtld-early-cflags
)
176 CFLAGS-dl-tunables.os
+= $(rtld-early-cflags
)
177 CFLAGS-dl-write.os
+= $(rtld-early-cflags
)
178 CFLAGS-dl-writev.os
+= $(rtld-early-cflags
)
179 CFLAGS-rtld.os
+= $(rtld-early-cflags
)
181 ifeq ($(unwind-find-fde
),yes
)
182 routines
+= unwind-dw2-fde-glibc
183 shared-only-routines
+= unwind-dw2-fde-glibc
186 before-compile
+= $(objpfx
)trusted-dirs.h
187 generated
+= trusted-dirs.h trusted-dirs.st for-renamed
/renamed.so
188 generated-dirs
+= for-renamed
190 ifeq ($(build-shared
),yes
)
191 ld-map
= $(common-objpfx
)ld.map
194 ifeq (yes
,$(build-shared
))
196 $(all-rtld-routines
:%=%.os
) \
205 install-others
= $(inst_rtlddir
)/$(rtld-installed-name
) $(inst_bindir
)/ld.so
206 install-bin-script
= ldd
212 install-rootsbin
= sln
213 sln-modules
:= static-stubs
214 extra-objs
+= $(sln-modules
:=.o
)
216 ifeq (yes
,$(use-ldconfig
))
217 ifeq (yes
,$(build-shared
))
218 others-static
+= ldconfig
220 install-rootsbin
+= ldconfig
222 ldconfig-modules
:= \
231 extra-objs
+= $(ldconfig-modules
:=.o
)
232 others-extras
= $(ldconfig-modules
)
236 # To find xmalloc.c and xstrdup.c
237 vpath
%.c ..
/locale
/programs
239 ifeq ($(build-shared
),yes
)
240 extra-objs
+= sotruss-lib.os sotruss-lib.so
241 install-others
+= $(inst_auditdir
)/sotruss-lib.so
242 install-bin-script
+= sotruss
244 libof-sotruss-lib
= extramodules
245 LDFLAGS-sotruss-lib.so
+= $(z-now-
$(bind-now
))
246 $(objpfx
)sotruss-lib.so
: $(objpfx
)sotruss-lib.os
247 $(build-module-asneeded
)
248 $(objpfx
)sotruss-lib.so
: $(common-objpfx
)libc.so
$(objpfx
)ld.so \
249 $(common-objpfx
)libc_nonshared.a
251 $(objpfx
)sotruss
: sotruss.sh
$(common-objpfx
)config.make
252 sed
-e
's%@VERSION@%$(version)%g' \
253 -e
's%@TEXTDOMAINDIR@%$(localedir)%g' \
254 -e
's%@PREFIX@%$(prefix)%g' \
255 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
256 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
260 $(inst_auditdir
)/sotruss-lib.so
: $(objpfx
)sotruss-lib.so
$(+force)
261 $(do-install-program
)
264 tests-static-normal
:= \
269 tst-env-setuid-static \
270 tst-getauxval-static \
272 tst-single_threaded-pthread-static \
273 tst-single_threaded-static \
274 tst-tls-allocation-failure-static \
275 tst-tlsalign-extern-static \
276 tst-tlsalign-static \
277 # tests-static-normal
279 tests-static-internal
:= \
280 tst-dl-printf-static \
281 tst-dl_find_object-static \
282 tst-env-setuid-tunables \
283 tst-ptrguard1-static \
284 tst-stackguard1-static \
286 tst-tls1-static-non-pie \
288 tst-tunables-enable_secure \
289 # tests-static-internal
291 CRT-tst-tls1-static-non-pie
:= $(csu-objpfx
)crt1.o
292 tst-tls1-static-non-pie-no-pie
= yes
295 tst-ldconfig-bad-aux-cache \
296 tst-ldconfig-ld_so_conf-update \
299 ifeq (no
,$(build-hardcoded-path-in-tests
))
300 # This is an ld.so.cache test, and RPATH/RUNPATH in the executable
301 # interferes with its test objectives.
302 tests-container
+= tst-glibc-hwcaps-prepend-cache
321 $(tests-static-internal
) \
325 tests-static
:= $(tests-static-normal
) $(tests-static-internal
)
327 ifeq (yes
,$(build-shared
))
329 tst-single_threaded-static-dlopen \
333 static-dlopen-environment
= \
334 LD_LIBRARY_PATH
=$(ld-library-path
):$(common-objpfx
)dlfcn
335 tst-tls9-static-ENV
= $(static-dlopen-environment
)
336 tst-single_threaded-static-dlopen-ENV
= $(static-dlopen-environment
)
337 tst-rootdir-ENV
= LD_LIBRARY_PATH
=/
378 tst-audit-tlsdesc-dlopen \
409 tst-dlmopen-dlerror \
410 tst-dlmopen-gethostbyname \
416 tst-dlopen-tlsmodid \
422 tst-filterobj-dlopen \
424 tst-glibc-hwcaps-mask \
425 tst-glibc-hwcaps-prepend \
429 tst-initfinilazyfail \
435 tst-nodelete-dlclose \
436 tst-nodelete-opened \
441 tst-non-directory-path \
448 tst-rtld-run-static \
449 tst-single_threaded \
450 tst-single_threaded-pthread \
451 tst-sonamemove-dlopen \
452 tst-sonamemove-link \
457 tst-tls-manydynamic \
473 tst-tlsalign-extern \
488 tst-dlopen-nodelete-reloc \
494 tests
+= $(if
$(CXX
),$(tests-cxx
))
505 tst-dl-hwcaps_split \
507 tst-dl_find_object-threads \
521 tst-dlopen-self-container \
522 tst-dlopen-tlsmodid-container \
524 tst-preload-pthread-libc \
533 ifeq (yes
,$(have-fpie
))
534 tests-pie
+= tst-align3
536 selinux-enabled
:= $(shell cat
/selinux
/enforce
2> /dev
/null
)
538 ifneq ($(selinux-enabled
),1)
539 tests-execstack-yes
= \
541 tst-execstack-needed \
543 # tests-execstack-yes
545 ifeq ($(have-depaudit
),yes
)
552 ifeq ($(run-built-tests
),yes
)
554 $(objpfx
)tst-audit14-cmp.out \
555 $(objpfx
)tst-audit14a-cmp.out \
556 $(objpfx
)tst-audit15-cmp.out \
557 $(objpfx
)tst-audit16-cmp.out \
561 ifeq ($(have-dt-relr
),yes
)
568 modules-names-dt-relr
= \
574 # modules-names-dt-relr
575 modules-names
+= $(modules-names-dt-relr
)
576 # These shared libraries have special build rules.
577 modules-names-nobuild
+= $(modules-names-dt-relr
)
578 ifeq ($(have-fpie
),yes
)
586 $(objpfx
)check-tst-relr-pie.out \
589 CFLAGS-tst-relr-pie.c
+= $(pie-ccflag
)
590 LDFLAGS-tst-relr
+= -Wl
,-z
,pack-relative-relocs
591 LDFLAGS-tst-relr-pie
+= -Wl
,-z
,pack-relative-relocs
592 CFLAGS-tst-relr-mod2.c
+= $(no-stack-protector
)
593 CFLAGS-tst-relr-mod3a.c
+= $(no-stack-protector
)
594 CFLAGS-tst-relr-mod3b.c
+= $(no-stack-protector
)
595 CFLAGS-tst-relr-mod4a.c
+= $(no-stack-protector
)
596 CFLAGS-tst-relr-mod4b.c
+= $(no-stack-protector
)
600 tests-special
+= $(objpfx
)tst-relro-ldso.out
$(objpfx
)tst-relro-libc.out
601 $(objpfx
)tst-relro-ldso.out
: tst-relro-symbols.py
$(..
)/scripts
/glibcelf.py \
603 $(PYTHON
) tst-relro-symbols.py
$(objpfx
)ld.so \
604 --required
=_rtld_global_ro \
605 > $@
2>&1; $(evaluate-test
)
606 # The optional symbols are present in libc only if the architecture has
607 # the GLIBC_2.0 symbol set in libc.
608 $(objpfx
)tst-relro-libc.out
: tst-relro-symbols.py
$(..
)/scripts
/glibcelf.py \
609 $(common-objpfx
)libc.so
610 $(PYTHON
) tst-relro-symbols.py
$(common-objpfx
)libc.so \
611 --required
=_IO_file_jumps \
612 --required
=_IO_wfile_jumps \
613 --required
=__io_vtables \
614 > $@
2>&1; $(evaluate-test
)
616 ifeq ($(run-built-tests
),yes
)
617 tests-special
+= $(objpfx
)tst-valgrind-smoke.out
619 $(objpfx
)tst-valgrind-smoke.out
: tst-valgrind-smoke.sh
$(objpfx
)ld.so
$(objpfx
)valgrind-test
620 $(SHELL
) $< $(objpfx
)ld.so
$(rtlddir
)/$(rtld-installed-name
) '$(test-wrapper-env)' \
621 '$(run-program-env)' '$(rpath-link)' $(objpfx
)valgrind-test \
622 '$(valgrind-suppressions-tst-valgrind-smoke)' > $@
; $(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-ldconfig-p.out \
630 $(objpfx
)tst-ldconfig-soname.out \
631 $(objpfx
)tst-leaks1-mem.out \
632 $(objpfx
)tst-rtld-help.out \
635 tlsmod17a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
636 tlsmod18a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
637 tlsmod17a-modules
= $(addprefix tst-tlsmod17a
, $(tlsmod17a-suffixes
))
638 tlsmod18a-modules
= $(addprefix tst-tlsmod18a
, $(tlsmod17a-suffixes
))
639 one-hundred
= $(foreach x
,0 1 2 3 4 5 6 7 8 9, \
640 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
641 tst-tls-many-dynamic-modules
:= \
642 $(foreach n
,$(one-hundred
),tst-tls-manydynamic
$(n
)mod
)
643 tst-tls-many-dynamic-modules-dep-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 \
645 tst-tls-many-dynamic-modules-dep
= \
646 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-suffixes
),tst-tls-manydynamic
$(n
)mod-dep
)
647 tst-tls-many-dynamic-modules-dep-bad-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
648 tst-tls-many-dynamic-modules-dep-bad
= \
649 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-bad-suffixes
),tst-tls-manydynamic
$(n
)mod-dep-bad
)
651 $(tlsmod17a-modules
:=.os
) \
652 $(tlsmod18a-modules
:=.os
) \
653 tst-tlsalign-vars.o \
758 tst-absolute-sym-lib \
759 tst-absolute-zero-lib \
765 tst-audit-tlsdesc-mod1 \
766 tst-audit-tlsdesc-mod2 \
800 tst-auditmod-tlsdesc \
825 tst-dl_find_object-mod1 \
826 tst-dl_find_object-mod2 \
827 tst-dl_find_object-mod3 \
828 tst-dl_find_object-mod4 \
829 tst-dl_find_object-mod5 \
830 tst-dl_find_object-mod6 \
831 tst-dl_find_object-mod7 \
832 tst-dl_find_object-mod8 \
833 tst-dl_find_object-mod9 \
834 tst-dlclose-lazy-mod1 \
835 tst-dlclose-lazy-mod2 \
836 tst-dlmopen-dlerror-mod \
837 tst-dlmopen-gethostbyname-mod \
838 tst-dlmopen-twice-mod1 \
839 tst-dlmopen-twice-mod2 \
841 tst-dlopenfaillinkmod \
845 tst-dlopenfailnodelmod \
848 tst-filterobj-filtee \
850 tst-finilazyfailmod \
855 tst-initlazyfailmod \
867 tst-ldconfig-ld-mod \
868 tst-ldconfig-soname-lib-with-soname \
869 tst-ldconfig-soname-lib-without-soname \
871 tst-nodelete-dlclose-dso \
872 tst-nodelete-dlclose-plugin \
873 tst-nodelete-opened-lib \
877 tst-non-directory-mod \
879 tst-p_alignmod-base \
885 tst-single_threaded-mod1 \
886 tst-single_threaded-mod2 \
887 tst-single_threaded-mod3 \
888 tst-single_threaded-mod4 \
889 tst-sonamemove-linkmod1 \
890 tst-sonamemove-runmod1 \
891 tst-sonamemove-runmod2 \
934 tst-unwind-ctor-lib \
960 modules-names-cxx
= \
961 tst-dlopen-nodelete-reloc-mod1 \
962 tst-dlopen-nodelete-reloc-mod2 \
963 tst-dlopen-nodelete-reloc-mod3 \
964 tst-dlopen-nodelete-reloc-mod4 \
965 tst-dlopen-nodelete-reloc-mod5 \
966 tst-dlopen-nodelete-reloc-mod6 \
967 tst-dlopen-nodelete-reloc-mod7 \
968 tst-dlopen-nodelete-reloc-mod8 \
969 tst-dlopen-nodelete-reloc-mod9 \
970 tst-dlopen-nodelete-reloc-mod10 \
971 tst-dlopen-nodelete-reloc-mod11 \
972 tst-dlopen-nodelete-reloc-mod12 \
973 tst-dlopen-nodelete-reloc-mod13 \
974 tst-dlopen-nodelete-reloc-mod14 \
975 tst-dlopen-nodelete-reloc-mod15 \
976 tst-dlopen-nodelete-reloc-mod16 \
977 tst-dlopen-nodelete-reloc-mod17 \
978 tst-nodelete-rtldmod \
979 tst-nodelete-uniquemod \
987 $(if
$(CXX
),$(modules-names-cxx
)) \
988 $(modules-execstack-
$(have-z-execstack
)) \
989 $(tlsmod17a-modules
) \
990 $(tlsmod18a-modules
) \
991 $(tst-tls-many-dynamic-modules
) \
992 $(tst-tls-many-dynamic-modules-dep
) \
993 $(tst-tls-many-dynamic-modules-dep-bad
) \
996 # Most modules build with _ISOMAC defined, but those filtered out
997 # depend on internal headers.
998 modules-names-tests
= $(filter-out ifuncmod
% tst-tlsmod
%,\
1001 # For +depfiles in Makerules.
1002 extra-test-objs
+= tst-auditmod17.os
1004 ifneq (no
,$(have-mtls-descriptor
))
1005 tests
+= tst-gnu2-tls1
1006 modules-names
+= tst-gnu2-tls1mod
1007 $(objpfx
)tst-gnu2-tls1
: $(objpfx
)tst-gnu2-tls1mod.so
1008 tst-gnu2-tls1mod.so-no-z-defs
= yes
1009 CFLAGS-tst-gnu2-tls1mod.c
+= -mtls-dialect
=$(have-mtls-descriptor
)
1010 endif # $(have-mtls-descriptor)
1012 ifeq (yes
,$(have-protected-data
))
1013 modules-names
+= tst-protected1moda tst-protected1modb
1014 tests
+= tst-protected1a tst-protected1b
1015 $(objpfx
)tst-protected1a
: $(addprefix $(objpfx
),tst-protected1moda.so tst-protected1modb.so
)
1016 $(objpfx
)tst-protected1b
: $(addprefix $(objpfx
),tst-protected1modb.so tst-protected1moda.so
)
1017 tst-protected1modb.so-no-z-defs
= yes
1018 # These tests fail with GCC versions prior to 5.1 and with some versions
1019 # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
1020 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
1021 # Perhaps in future we can make these XFAILs conditional on some detection
1022 # of compiler/linker behavior/version.
1023 test-xfail-tst-protected1a
= yes
1024 test-xfail-tst-protected1b
= yes
1026 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1027 modules-names
+= tst-piemod1
1028 tests
+= tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \
1030 tests-pie
+= tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie
1031 ifeq (yes
,$(have-protected-data
))
1033 tests-pie
+= vismain
1034 CFLAGS-vismain.c
+= $(PIE-ccflag
)
1037 modules-execstack-yes
= tst-execstack-mod
1038 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
1040 # filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special
1042 modules-names-nobuild
+= \
1049 tst-ro-dynamic-mod \
1050 # modules-names-nobuild
1052 tests
+= $(tests-static
)
1054 ifeq (yes
,$(have-ifunc
))
1055 tests-ifuncstatic
:= \
1056 ifuncmain1picstatic \
1058 ifuncmain2picstatic \
1060 ifuncmain4picstatic \
1062 ifuncmain5picstatic \
1064 ifuncmain7picstatic \
1067 ifeq (yes
,$(have-gcc-ifunc
))
1068 tests-ifuncstatic
+= ifuncmain9static ifuncmain9picstatic
1070 tests-static
+= $(tests-ifuncstatic
)
1071 tests-internal
+= $(tests-ifuncstatic
)
1072 ifeq (yes
,$(build-shared
))
1074 tst-ifunc-fault-bindnow \
1075 tst-ifunc-fault-lazy \
1077 # Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8.
1080 ifuncmain1staticpic \
1087 ifuncmain5staticpic \
1091 ifeq (no
,$(with-lld
))
1098 ifeq (yes
,$(have-gcc-ifunc
))
1104 ifunc-test-modules
= \
1111 # ifunc-test-modules
1112 extra-test-objs
+= $(ifunc-test-modules
:=.o
)
1113 test-internal-extras
+= $(ifunc-test-modules
)
1114 ifeq (yes
,$(have-fpie
))
1117 ifuncmain1staticpie \
1122 ifeq (yes
,$(have-gcc-ifunc
))
1123 ifunc-pie-tests
+= ifuncmain9pie
1125 ifeq (no
,$(with-lld
))
1126 ifunc-pie-tests
+= ifuncmain5pie
1128 ifeq (yes
,$(have-textrel_ifunc
))
1129 ifunc-pie-tests
+= tst-ifunc-textrel
1131 tests-internal
+= $(ifunc-pie-tests
)
1132 tests-pie
+= $(ifunc-pie-tests
)
1139 ifeq (no
,$(with-lld
))
1140 modules-names
+= ifuncmod5
1145 ifeq (yes
,$(build-shared
))
1146 ifeq ($(run-built-tests
),yes
)
1148 $(objpfx
)argv0test.out \
1149 $(objpfx
)tst-non-directory-path.out \
1150 $(objpfx
)tst-pathopt.out \
1151 $(objpfx
)tst-rtld-help.out \
1152 $(objpfx
)tst-rtld-list-diagnostics.out \
1153 $(objpfx
)tst-rtld-load-self.out \
1154 $(objpfx
)tst-rtld-preload.out \
1155 $(objpfx
)tst-sprof-basic.out \
1159 $(objpfx
)check-execstack.out \
1160 $(objpfx
)check-initfini.out \
1161 $(objpfx
)check-localplt.out \
1162 $(objpfx
)check-textrel.out \
1163 $(objpfx
)check-wx-segment.out \
1167 ifeq ($(run-built-tests
),yes
)
1169 $(objpfx
)order-cmp.out \
1170 $(objpfx
)order2-cmp.out \
1171 $(objpfx
)tst-array1-cmp.out \
1172 $(objpfx
)tst-array1-static-cmp.out \
1173 $(objpfx
)tst-array2-cmp.out \
1174 $(objpfx
)tst-array3-cmp.out \
1175 $(objpfx
)tst-array4-cmp.out \
1176 $(objpfx
)tst-array5-cmp.out \
1177 $(objpfx
)tst-array5-static-cmp.out \
1178 $(objpfx
)tst-initorder-cmp.out \
1179 $(objpfx
)tst-initorder2-cmp.out \
1180 $(objpfx
)tst-trace1.out \
1181 $(objpfx
)tst-trace2.out \
1182 $(objpfx
)tst-trace3.out \
1183 $(objpfx
)tst-trace4.out \
1184 $(objpfx
)tst-trace5.out \
1185 $(objpfx
)tst-unused-dep-cmp.out \
1186 $(objpfx
)tst-unused-dep.out \
1190 ifndef avoid-generated
1191 # DSO sorting tests:
1192 # The dso-ordering-test.py script generates testcase source files in $(objpfx),
1193 # creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a
1194 # Makefile fragment to be included.
1195 define include_dsosort_tests
1196 $(objpfx
)$(1).generated-makefile
: $(1)
1197 $(PYTHON
) $(..
)scripts
/dso-ordering-test.py \
1198 --description-file
$$< --objpfx
$(objpfx
) --output-makefile
$$@T
1200 -include $(objpfx
)$(1).generated-makefile
1204 postclean-generated
+= $(objpfx
)/dso-sort-tests-2.generated-makefile \
1205 $(objpfx
)/dso-sort-tests-2.generated-makefile
1207 # Generate from each testcase description file
1208 $(eval
$(call include_dsosort_tests
,dso-sort-tests-1.def
))
1209 $(eval
$(call include_dsosort_tests
,dso-sort-tests-2.def
))
1211 # BZ15311 is intentionally underlinked.
1212 LDFLAGS-tst-bz15311-b.so
+= -Wl
,-z
,lazy
1213 LDFLAGS-tst-bz15311-c.so
+= -Wl
,-z
,lazy
1214 LDFLAGS-tst-bz15311-d.so
+= -Wl
,-z
,lazy
1216 check-abi
: $(objpfx
)check-abi-ld.out \
1217 $(objpfx
)check-abi-version-libc.out
1219 $(objpfx
)check-abi-ld.out \
1220 $(objpfx
)check-abi-version-libc.out \
1222 update-abi
: update-abi-ld
1223 update-all-abi
: update-all-abi-ld
1225 tests-special
+= $(objpfx
)tst-glibcelf.out
1226 $(objpfx
)tst-glibcelf.out
: tst-glibcelf.py elf.h
$(..
)/scripts
/glibcelf.py \
1227 $(..
)/scripts
/glibcextract.py
1228 PYTHONPATH
=$(..
)scripts
$(PYTHON
) tst-glibcelf.py \
1229 --cc="$(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS))" \
1230 < /dev
/null
> $@
2>&1; $(evaluate-test
)
1232 ifeq ($(run-built-tests
),yes
)
1233 tests-special
+= $(objpfx
)tst-tls-allocation-failure-static-patched.out
1236 # The test requires shared _and_ PIE because the executable
1237 # unit test driver must be able to link with the shared object
1238 # that is going to eventually go into an installed DSO.
1239 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1240 tests-internal
+= tst-_dl_addr_inside_object
1241 tests-pie
+= tst-_dl_addr_inside_object
1242 $(objpfx
)tst-_dl_addr_inside_object
: $(objpfx
)dl-addr-obj.os
1243 CFLAGS-tst-_dl_addr_inside_object.c
+= $(PIE-ccflag
)
1248 ifeq (yes
,$(build-shared
))
1249 # Make sure these things are built in the `make lib' pass so they can be used
1250 # to run programs during the `make others' pass.
1251 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
1252 $(addprefix $(objpfx
),$(extra-objs
))
1255 # Command to link into a larger single relocatable object.
1256 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
1258 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
1259 $(reloc-link
) -o
$@
$^
1261 # Link together the dynamic linker into a single relocatable object.
1262 # First we do a link against libc_pic.a just to get a link map,
1263 # and discard the object produced by that link. From the link map
1264 # we can glean all the libc modules that need to go into the dynamic
1265 # linker. Then we do a recursive make that goes into all the subdirs
1266 # those modules come from and builds special rtld-foo.os versions that
1267 # are compiled with special flags, and puts these modules into rtld-libc.a
1268 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
1270 # These symbols need to be stubbed out during symbol discovery because
1271 # their implementation is provided differently in rtld, and the symbol
1272 # discovery mechanism is not compatible with the libc implementation
1273 # when compiled for libc.
1274 rtld-stubbed-symbols
= \
1275 __GI___pthread_disable_asynccancel \
1276 __GI___pthread_enable_asynccancel \
1277 __libc_assert_fail \
1278 __pthread_disable_asynccancel \
1279 __pthread_enable_asynccancel \
1284 # rtld-stubbed-symbols
1286 ifeq ($(have-ssp
),yes
)
1287 # rtld is not built with the stack protector, so these references will
1288 # go away in the rebuilds.
1289 rtld-stubbed-symbols
+= __stack_chk_fail __stack_chk_fail_local
1292 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
1294 for symbol in
$(rtld-stubbed-symbols
); do \
1295 echo
".globl $$symbol"; \
1297 done |
$(CC
) -o
$@T.o
$(ASFLAGS
) -c
-x assembler
-
1298 $(reloc-link
) -o
$@.o
$@T.o
'-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
1302 # For lld, skip preceding addresses and values before matching the archive and the member.
1303 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
1305 sed
-n
's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
1307 while read lib file
; do \
1310 LC_ALL
=C grep
-F
-l
/$$file \
1311 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
1313 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
1316 echo rtld-
$${lib
%%/*} += $$file ;; \
1317 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
1320 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
1321 | LC_ALL=C sort -u` >> $@T
1324 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
1325 $(MAKE
) -f
$< -f rtld-Rules
1327 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
1328 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
1331 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
1333 z-now-yes
= -Wl
,-z
,now
1335 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
1336 # Link into a temporary file so that we don't touch $@ at all
1337 # if the sanity check below fails.
1338 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
1339 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
1341 $(filter-out $(map-file
),$^
) $(load-map-file
) \
1342 -Wl
,-soname
=$(rtld-installed-name
)
1343 $(call after-link
,$@.new
)
1344 $(READELF
) -s
$@.new \
1345 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
1348 ifeq (yes
,$(build-shared
))
1349 # interp.c exists just to get the runtime linker path into libc.so.
1350 $(objpfx
)interp.os
: $(common-objpfx
)runtime-linker.h
1353 ifneq (ld.so
,$(rtld-installed-name
))
1354 # Make sure ld.so.1 exists in the build directory so we can link
1356 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
1358 generated
+= $(rtld-installed-name
)
1361 # Build a file mentioning all trustworthy directories to look for shared
1362 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
1363 # add directories to the list by defining $(user-defined-trusted-dirs)
1364 # before starting make.
1365 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
1366 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
1367 $(make-target-directory
)
1368 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
1369 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
1370 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
1371 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
1373 CPPFLAGS-dl-load.c
+= -I
$(objpfx
).
-I
$(csu-objpfx
).
1375 ifeq (yes
,$(build-shared
))
1376 $(inst_rtlddir
)/$(rtld-installed-name
): $(objpfx
)ld.so
$(+force)
1377 $(make-target-directory
)
1378 $(do-install-program
)
1380 # Creates the relative /usr/bin/ld.so symbolic link.
1381 $(inst_bindir
)/ld.so
: $(inst_rtlddir
)/$(rtld-installed-name
)
1382 $(make-target-directory
)
1385 # Special target called by parent to install just the dynamic linker.
1386 .PHONY
: ldso_install
1387 ldso_install
: $(inst_rtlddir
)/$(rtld-installed-name
)
1388 endif # $(build-shared)
1391 # Workarounds for ${exec_prefix} expansion in configure variables.
1392 # config.status cannot be used directly for processing ldd.bash.in or
1393 # expanding variables such as sysconfdir because the expansion
1394 # contains the literal string ${exec_prefix}, which is not valid in C
1395 # headers or installed shell scripts.
1397 ldd-rewrite
= -e
's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
1398 -e
's%@VERSION@%$(version)%g' \
1399 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
1400 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
1401 -e
's%@TEXTDOMAINDIR@%$(localedir)%g'
1403 ifeq ($(ldd-rewrite-script
),no
)
1405 LC_ALL
=C sed
$(ldd-rewrite
) < $< > $@.new
1409 LC_ALL
=C sed
$(ldd-rewrite
) < $< \
1410 | LC_ALL
=C sed
-f
$(patsubst $(..
)/%,/%,$(..
)$(ldd-rewrite-script
)) > $@.new
1414 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
1415 $(common-objpfx
)config.make
1420 $(objpfx
)sln
: $(sln-modules
:%=$(objpfx
)%.o
)
1422 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
1424 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
1425 CFLAGS-ldconfig.c
+= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
1426 -D
'SLIBDIR="$(slibdir)"'
1427 libof-ldconfig
= ldconfig
1428 CFLAGS-dl-cache.c
+= $(SYSCONF-FLAGS
)
1429 CFLAGS-cache.c
+= $(SYSCONF-FLAGS
)
1430 CFLAGS-rtld.c
+= $(SYSCONF-FLAGS
)
1431 CFLAGS-dl-usage.c
+= $(SYSCONF-FLAGS
) \
1432 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1433 CFLAGS-dl-diagnostics.c
+= $(SYSCONF-FLAGS
) \
1434 -D
'PREFIX="$(prefix)"' \
1435 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1437 cpp-srcs-left
:= $(all-rtld-routines
:=.os
)
1439 include $(patsubst %,$(..
)libof-iterator.mk
,$(cpp-srcs-left
))
1441 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
1442 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
1444 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
1445 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
1446 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
1447 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
1448 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
1449 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
1450 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
1451 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
1452 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
1453 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
1454 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1455 $(objpfx
)neededobj3.so
1456 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
1457 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
1458 $(objpfx
)firstobj.so
: $(shared-thread-library
)
1459 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
1460 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
1461 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
1462 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
1463 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
1464 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
1465 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
1466 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
1467 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
1468 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
1469 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
1470 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
1471 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
1472 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
1473 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
1474 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
1475 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
1476 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
1477 $(objpfx
)tst-tls19mod1.so
: $(objpfx
)tst-tls19mod2.so
$(objpfx
)tst-tls19mod3.so
1478 $(objpfx
)tst-tls19mod3.so
: $(objpfx
)ld.so
1479 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
1480 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
1481 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
1482 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
1483 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
1484 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
1485 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
1486 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
1487 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
1488 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
1489 $(objpfx
)unload8mod1.so
: $(objpfx
)unload8mod2.so
1490 $(objpfx
)unload8mod2.so
: $(objpfx
)unload8mod3.so
1491 $(objpfx
)tst-initordera2.so
: $(objpfx
)tst-initordera1.so
1492 $(objpfx
)tst-initorderb2.so
: $(objpfx
)tst-initorderb1.so
$(objpfx
)tst-initordera2.so
1493 $(objpfx
)tst-initordera3.so
: $(objpfx
)tst-initorderb2.so
$(objpfx
)tst-initorderb1.so
1494 $(objpfx
)tst-initordera4.so
: $(objpfx
)tst-initordera3.so
1495 $(objpfx
)tst-initorder
: $(objpfx
)tst-initordera4.so
$(objpfx
)tst-initordera1.so
$(objpfx
)tst-initorderb2.so
1496 $(objpfx
)tst-null-argv
: $(objpfx
)tst-null-argv-lib.so
1497 $(objpfx
)tst-tlsalign
: $(objpfx
)tst-tlsalign-lib.so
1498 $(objpfx
)tst-nodelete-opened.out
: $(objpfx
)tst-nodelete-opened-lib.so
1500 $(objpfx
)tst-tlsalign-extern
: $(objpfx
)tst-tlsalign-vars.o
1501 $(objpfx
)tst-tlsalign-extern-static
: $(objpfx
)tst-tlsalign-vars.o
1503 tst-null-argv-ENV
= LD_DEBUG
=all LD_DEBUG_OUTPUT
=$(objpfx
)tst-null-argv.debug.out
1504 LDFLAGS-nodel2mod3.so
= -Wl
,--no-as-needed
1505 LDFLAGS-reldepmod5.so
= -Wl
,--no-as-needed
1506 LDFLAGS-reldep6mod1.so
= -Wl
,--no-as-needed
1507 LDFLAGS-reldep6mod4.so
= -Wl
,--no-as-needed
1508 LDFLAGS-reldep8mod3.so
= -Wl
,--no-as-needed
1509 LDFLAGS-unload4mod1.so
= -Wl
,--no-as-needed
1510 LDFLAGS-unload4mod2.so
= -Wl
,--no-as-needed
1511 LDFLAGS-tst-initorder
= -Wl
,--no-as-needed
1512 LDFLAGS-tst-initordera2.so
= -Wl
,--no-as-needed
1513 LDFLAGS-tst-initordera3.so
= -Wl
,--no-as-needed
1514 LDFLAGS-tst-initordera4.so
= -Wl
,--no-as-needed
1515 LDFLAGS-tst-initorderb2.so
= -Wl
,--no-as-needed
1516 LDFLAGS-tst-tlsmod5.so
= -nostdlib
-Wl
,--no-as-needed
1517 LDFLAGS-tst-tlsmod6.so
= -nostdlib
-Wl
,--no-as-needed
1519 # The following tests are underlinked, and rely on late loading. On toolchains
1520 # that set -z now by default, this leads to failures to load or fix up the
1521 # executables being tested.
1522 LDFLAGS-circlemod2.so
= -Wl
,-z
,lazy
1523 LDFLAGS-tst-tls20mod-bad.so
= -Wl
,-z
,lazy
1524 LDFLAGS-reldep6mod1.so
+= -Wl
,-z
,lazy
1525 LDFLAGS-constload2.so
= -Wl
,-z
,lazy
1526 LDFLAGS-constload3.so
= -Wl
,-z
,lazy
1527 LDFLAGS-dblloadmod3.so
= -Wl
,-z
,lazy
1528 LDFLAGS-ifuncmod6.so
= -Wl
,-z
,lazy
1529 LDFLAGS-ltglobmod2.so
= -Wl
,-z
,lazy
1530 LDFLAGS-testobj1.so
= -Wl
,-z
,lazy
1531 LDFLAGS-testobj6.so
= -Wl
,-z
,lazy
1533 testobj1.so-no-z-defs
= yes
1534 testobj3.so-no-z-defs
= yes
1535 testobj4.so-no-z-defs
= yes
1536 testobj5.so-no-z-defs
= yes
1537 testobj6.so-no-z-defs
= yes
1538 failobj.so-no-z-defs
= yes
1539 constload2.so-no-z-defs
= yes
1540 constload3.so-no-z-defs
= yes
1541 nodelmod1.so-no-z-defs
= yes
1542 nodelmod2.so-no-z-defs
= yes
1543 nodelmod4.so-no-z-defs
= yes
1544 nodel2mod2.so-no-z-defs
= yes
1545 reldepmod2.so-no-z-defs
= yes
1546 reldepmod3.so-no-z-defs
= yes
1547 reldepmod4.so-no-z-defs
= yes
1548 reldep4mod4.so-no-z-defs
= yes
1549 reldep4mod2.so-no-z-defs
= yes
1550 ltglobmod2.so-no-z-defs
= yes
1551 dblloadmod3.so-no-z-defs
= yes
1552 tst-tlsmod1.so-no-z-defs
= yes
1553 tst-tlsmod2.so-no-z-defs
= yes
1554 tst-tlsmod3.so-no-z-defs
= yes
1555 tst-tlsmod4.so-no-z-defs
= yes
1556 tst-tlsmod7.so-no-z-defs
= yes
1557 tst-tlsmod8.so-no-z-defs
= yes
1558 tst-tlsmod9.so-no-z-defs
= yes
1559 tst-tlsmod10.so-no-z-defs
= yes
1560 tst-tlsmod12.so-no-z-defs
= yes
1561 tst-tlsmod14a.so-no-z-defs
= yes
1562 tst-tlsmod14b.so-no-z-defs
= yes
1563 tst-tlsmod15a.so-no-z-defs
= yes
1564 tst-tlsmod16b.so-no-z-defs
= yes
1565 circlemod2.so-no-z-defs
= yes
1566 circlemod3.so-no-z-defs
= yes
1567 circlemod3a.so-no-z-defs
= yes
1568 reldep8mod2.so-no-z-defs
= yes
1569 reldep9mod1.so-no-z-defs
= yes
1570 unload3mod4.so-no-z-defs
= yes
1571 unload4mod1.so-no-z-defs
= yes
1572 ifuncmod1.so-no-z-defs
= yes
1573 ifuncmod5.so-no-z-defs
= yes
1574 ifuncmod6.so-no-z-defs
= yes
1575 tst-auditmod9a.so-no-z-defs
= yes
1576 tst-auditmod9b.so-no-z-defs
= yes
1577 tst-nodelete-uniquemod.so-no-z-defs
= yes
1578 tst-nodelete-rtldmod.so-no-z-defs
= yes
1579 tst-nodelete-zmod.so-no-z-defs
= yes
1580 tst-nodelete2mod.so-no-z-defs
= yes
1582 ifeq ($(build-shared
),yes
)
1583 # Build all the modules even when not actually running test programs.
1584 tests
: $(test-modules
)
1587 LDFLAGS-loadtest
= -rdynamic
1589 $(objpfx
)loadtest.out
: $(test-modules
)
1591 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1592 $(objpfx
)neededobj3.so
1594 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1595 $(objpfx
)neededobj3.so
1597 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1598 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
1600 $(objpfx
)neededtest4
: $(objpfx
)neededobj1.so
1601 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
1603 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
1604 LDFLAGS-restest1
= -rdynamic
1606 LDFLAGS-restest2
= -rdynamic
1608 $(objpfx
)restest1.out
: $(test-modules
)
1610 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
1611 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
1612 LDFLAGS-preloadtest
= -rdynamic
1613 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1615 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1617 LDFLAGS-loadfail
= -rdynamic
1619 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
$(objpfx
)testobj1.so \
1620 $(objpfx
)testobj2.so
$(objpfx
)testobj3.so \
1621 $(objpfx
)testobj4.so
$(objpfx
)testobj5.so
1623 LDFLAGS-multiload
= -rdynamic
1624 CFLAGS-multiload.c
+= -DOBJDIR
=\"$(elf-objpfx
)\"
1626 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
1628 LDFLAGS-origtest
= -rdynamic
1629 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
1631 $(objpfx
)resolvfail.out
: $(objpfx
)testobj1.so
1632 ifeq ($(have-thread-library
),yes
)
1633 $(objpfx
)resolvfail
: $(shared-thread-library
)
1636 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
1638 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
1639 $(objpfx
)circlemod1a.so
1641 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
1642 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
1643 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
1644 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
1646 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
1648 $(objpfx
)order-cmp.out
: $(objpfx
)order.out
1649 (echo
"0123456789" | cmp
$< -) > $@
; \
1652 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
1653 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
1654 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
1656 $(objpfx
)noload
: $(objpfx
)testobj1.so
1657 LDFLAGS-noload
= -rdynamic
-Wl
,--no-as-needed
1658 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
1660 $(objpfx
)noload-mem.out
: $(objpfx
)noload.out
1661 $(common-objpfx
)malloc
/mtrace
$(objpfx
)noload.mtrace
> $@
; \
1663 noload-ENV
= MALLOC_TRACE
=$(objpfx
)noload.mtrace \
1664 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
1666 LDFLAGS-nodelete
= -rdynamic
1667 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1668 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1669 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
1670 $(objpfx
)nodelmod3.so
1672 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
1673 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
1675 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
1676 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
1678 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
1679 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
1681 -L
$(subst :, -L
,$(rpath-link
)) \
1682 -Wl
,-rpath-link
=$(rpath-link
) \
1683 $< -Wl
,-F
,$(objpfx
)filtmod2.so
1684 $(objpfx
)filter: $(objpfx
)filtmod1.so
1686 # This does not link against libc.
1687 CFLAGS-filtmod1.c
+= $(no-stack-protector
)
1689 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
1691 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
1693 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
1695 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1697 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
1699 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
1700 LDFLAGS-next
= -Wl
,--no-as-needed
1702 $(objpfx
)tst-next-ver
: $(objpfx
)nextmod3.so
1703 LDFLAGS-tst-next-ver
= -Wl
,--no-as-needed
1705 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
1707 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
1709 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
1710 $(objpfx
)pathoptobj.so
1711 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
1712 '$(run-program-env)'; \
1715 $(objpfx
)tst-rtld-load-self.out
: tst-rtld-load-self.sh
$(objpfx
)ld.so
1716 $(SHELL
) $^
'$(test-wrapper)' '$(test-wrapper-env)' > $@
; \
1719 tst-rtld-preload-OBJS
= $(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1720 $(objpfx
)tst-rtld-preload.out
: tst-rtld-preload.sh
$(objpfx
)ld.so \
1721 $(objpfx
)preloadtest \
1722 $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1723 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)preloadtest \
1724 '$(test-wrapper-env)' '$(run_program_env)' \
1725 '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@
; \
1728 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
1730 $(objpfx
)global
: $(objpfx
)globalmod1.so
1731 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1733 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1735 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1737 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
1739 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
1741 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
1743 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
1745 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1746 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
1748 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
1750 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
1752 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
1754 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
1756 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
1758 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
1760 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
1762 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1764 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
$(objpfx
)tst-tlsmod7.so
1766 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
$(objpfx
)tst-tlsmod9.so
1768 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
$(objpfx
)tst-tlsmod11.so
1770 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
1772 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
1773 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
1775 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
1777 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
1781 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
1783 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
1784 $(patsubst %,$(objpfx
)%.os
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
1785 $(compile-command.c
) -DN
=$*
1786 $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
1787 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
))
1789 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
))
1790 $(patsubst %,$(objpfx
)%.os
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
1791 $(compile-command.c
) -DN
=$*
1792 $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
1794 $(objpfx
)tst-tls19.out
: $(objpfx
)tst-tls19mod1.so
1796 CFLAGS-tst-align.c
+= $(stack-align-test-flags
)
1797 CFLAGS-tst-align2.c
+= $(stack-align-test-flags
)
1798 CFLAGS-tst-alignmod.c
+= $(stack-align-test-flags
)
1799 CFLAGS-tst-alignmod2.c
+= $(stack-align-test-flags
)
1800 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
1801 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
1802 $(objpfx
)tst-align3
: $(objpfx
)tst-alignmod3.so
1803 ifeq (yes
,$(have-fpie
))
1804 CFLAGS-tst-align3.c
+= $(PIE-ccflag
)
1806 LDFLAGS-tst-align3
+= -Wl
,-z
,max-page-size
=0x200000
1807 LDFLAGS-tst-alignmod3.so
+= -Wl
,-z
,max-page-size
=0x200000
1808 $(objpfx
)tst-alignmod3.so
: $(libsupport
)
1810 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1811 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1813 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
1815 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1816 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1818 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
1819 $(objpfx
)unload6mod3.so
1821 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
1822 unload7-ENV
= MALLOC_PERTURB_
=85
1824 $(objpfx
)unload8.out
: $(objpfx
)unload8mod1.so
$(objpfx
)unload8mod1x.so
1826 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1828 ifeq ($(have-z-execstack
),yes
)
1829 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
1830 CPPFLAGS-tst-execstack.c
+= -DUSE_PTHREADS
=0
1831 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
1832 LDFLAGS-tst-execstack-mod.so
= -Wl
,-z
,execstack
1834 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
1835 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
1837 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
1838 CFLAGS-tst-execstack-prog.c
+= -Wno-trampolines
1839 CFLAGS-tst-execstack-mod.c
+= -Wno-trampolines
1842 LDFLAGS-tst-array2
= -Wl
,--no-as-needed
1843 LDFLAGS-tst-array5
= -Wl
,--no-as-needed
1845 $(objpfx
)tst-array1-cmp.out
: tst-array1.exp
$(objpfx
)tst-array1.out
1849 $(objpfx
)tst-array1-static-cmp.out
: tst-array1.exp \
1850 $(objpfx
)tst-array1-static.out
1854 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
1855 $(objpfx
)tst-array2-cmp.out
: tst-array2.exp
$(objpfx
)tst-array2.out
1859 $(objpfx
)tst-array3-cmp.out
: tst-array1.exp
$(objpfx
)tst-array3.out
1863 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array2dep.so
1864 $(objpfx
)tst-array4-cmp.out
: tst-array4.exp
$(objpfx
)tst-array4.out
1868 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
1869 $(objpfx
)tst-array5-cmp.out
: tst-array5.exp
$(objpfx
)tst-array5.out
1873 $(objpfx
)tst-array5-static-cmp.out
: tst-array5-static.exp \
1874 $(objpfx
)tst-array5-static.out
1878 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
1879 CFLAGS-tst-pie2.c
+= $(pie-ccflag
)
1881 $(objpfx
)tst-piemod1.so
: $(libsupport
)
1882 $(objpfx
)tst-pie1
: $(objpfx
)tst-piemod1.so
1883 $(objpfx
)tst-dlopen-pie.out
: $(objpfx
)tst-pie1
1885 ifeq (yes
,$(build-shared
))
1886 # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with
1887 # all-built-dso here.
1888 all-built-dso
:= $(common-objpfx
)elf
/ld.so
$(common-objpfx
)libc.so \
1889 $(filter-out $(common-objpfx
)linkobj
/libc.so
, \
1890 $(sort $(wildcard $(addprefix $(common-objpfx
), \
1894 $(all-built-dso
:=.dyn
): %.dyn
: %
1896 LC_ALL
=C
$(READELF
) -W
-d
$< > $@T
1899 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dyn
)
1901 $(objpfx
)check-textrel.out
: $(..
)scripts
/check-textrel.awk \
1902 $(all-built-dso
:=.dyn
)
1903 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1905 generated
+= check-textrel.out
1907 $(objpfx
)execstack-default
: $(first-word
$(wildcard $(sysdirs
:%=%/stackinfo.h
)))
1908 $(make-target-directory
)
1909 { echo
'#include <elf.h>'; \
1910 echo
'#include <stackinfo.h>'; \
1911 echo
'#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1912 echo
'@@@execstack-no@@@'; \
1914 echo
'@@@execstack-yes@@@'; \
1915 echo
'#endif'; } | \
1916 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -E
-x c-header
- | \
1917 sed
-n
-e
's/^@@@\(.*\)@@@/\1/p' > $@T
1919 generated
+= execstack-default
1921 $(all-built-dso
:=.phdr
): %.phdr
: %
1923 LC_ALL
=C
$(READELF
) -W
-l
$< > $@T
1926 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.phdr
)
1928 $(objpfx
)check-execstack.out
: $(..
)scripts
/check-execstack.awk \
1929 $(objpfx
)execstack-default \
1930 $(all-built-dso
:=.phdr
)
1931 LC_ALL
=C
$(AWK
) -v
"xfail=$(check-execstack-xfail)" -f
$^
> $@
; \
1933 generated
+= check-execstack.out
1935 $(objpfx
)check-wx-segment.out
: $(..
)scripts
/check-wx-segment.py \
1936 $(all-built-dso
:=.phdr
)
1937 $(PYTHON
) $^
--xfail
="$(check-wx-segment-xfail)" > $@
; \
1939 generated
+= check-wx-segment.out
1941 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
1943 $(all-built-dso
:=.jmprel
): %.jmprel
: % Makefile
1945 LC_ALL
=C
$(READELF
) -W
-S
-d
-r
$< > $@T
1948 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.jmprel
)
1950 localplt-built-dso
:= $(addprefix $(common-objpfx
),\
1955 resolv
/libresolv.so \
1957 ifeq ($(build-mathvec
),yes
)
1958 localplt-built-dso
+= $(addprefix $(common-objpfx
), mathvec
/libmvec.so
)
1960 ifeq ($(have-thread-library
),yes
)
1961 localplt-built-dso
+= $(filter-out %_nonshared.a
, $(shared-thread-library
))
1963 ifneq ($(pthread-in-libc
),yes
)
1964 localplt-built-dso
+= $(addprefix $(common-objpfx
), rt
/librt.so
)
1967 vpath localplt.data
$(+sysdep_dirs
)
1969 $(objpfx
)check-localplt.out
: $(..
)scripts
/check-localplt.awk \
1970 $(..
)scripts
/localplt.awk \
1971 $(localplt-built-dso
:=.jmprel
) \
1973 LC_ALL
=C
$(AWK
) -f
$(filter-out $< %localplt.data
,$^
) | \
1974 LC_ALL
=C
$(AWK
) -f
$< $(filter %localplt.data
,$^
) - \
1979 $(all-built-dso
:=.dynsym
): %.dynsym
: %
1981 LC_ALL
=C
$(READELF
) -W
--dyn-syms
$< > $@T
1984 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dynsym
)
1986 $(objpfx
)check-initfini.out
: $(..
)scripts
/check-initfini.awk \
1987 $(all-built-dso
:=.dynsym
)
1988 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1990 generated
+= check-initfini.out
1992 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
1993 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
1994 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
1995 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
1997 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
1998 $(objpfx
)tst-deep1
: $(objpfx
)tst-deep1mod1.so
1999 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
2000 LDFLAGS-tst-deep1
+= -rdynamic
2001 tst-deep1mod3.so-no-z-defs
= yes
2003 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
2005 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
2007 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
2009 $(objpfx
)tst-dlmopen4.out
: $(objpfx
)tst-dlmopen1mod.so
2011 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
2012 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
2014 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
$(objpfx
)tst-auditmod9b.so
2015 # Prevent GCC-5 from translating a malloc/memset pair into calloc
2016 CFLAGS-tst-audit2.c
+= -fno-builtin
2017 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
2019 $(objpfx
)tst-audit9.out
: $(objpfx
)tst-auditmod9a.so
$(objpfx
)tst-auditmod9b.so
2020 tst-audit9-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod9a.so
2022 $(objpfx
)tst-audit8
: $(libm
)
2023 $(objpfx
)tst-audit8.out
: $(objpfx
)tst-auditmod1.so
2024 tst-audit8-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
2026 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
2028 $(objpfx
)tst-global2
: $(objpfx
)tst-globalmod2.so
2029 $(objpfx
)tst-global2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
2030 LDFLAGS-tst-global2
= -Wl
,--enable-new-dtags
2031 LDFLAGS-tst-globalmod2.so
= -Wl
,--enable-new-dtags
2033 $(objpfx
)order2.out
: $(objpfx
)order2mod1.so
$(objpfx
)order2mod2.so
2034 $(objpfx
)order2-cmp.out
: $(objpfx
)order2.out
2035 (echo
"12345" | cmp
$< -) > $@
; \
2037 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
2038 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
2039 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
2040 order2mod2.so-no-z-defs
= yes
2041 LDFLAGS-order2mod1.so
= -Wl
,--no-as-needed
2042 LDFLAGS-order2mod2.so
= -Wl
,--no-as-needed
2044 tst-stackguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
2045 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
2047 tst-ptrguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
2048 # When built statically, the pointer guard interface uses
2049 # __pointer_chk_guard_local.
2050 CFLAGS-tst-ptrguard1-static.c
+= -DPTRGUARD_LOCAL
2051 tst-ptrguard1-static-ARGS
= --command
"$(objpfx)tst-ptrguard1-static --child"
2053 $(objpfx
)tst-leaks1-mem.out
: $(objpfx
)tst-leaks1.out
2054 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
; \
2057 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace \
2058 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
2060 $(objpfx
)tst-thrlock
: $(shared-thread-library
)
2061 $(objpfx
)tst-thrlock.out
: $(libm
)
2062 $(objpfx
)tst-noload.out
: $(libm
)
2064 tst-tst-dlopen-tlsmodid-no-pie
= yes
2065 $(objpfx
)tst-dlopen-tlsmodid
: $(shared-thread-library
)
2066 $(objpfx
)tst-dlopen-tlsmodid.out
: $(objpfx
)tst-dlopen-self
2067 CFLAGS-tst-dlopen-tlsmodid-pie.c
+= $(pie-ccflag
)
2068 $(objpfx
)tst-dlopen-tlsmodid-pie
: $(shared-thread-library
)
2069 $(objpfx
)tst-dlopen-tlsmodid-pie.out
: $(objpfx
)tst-dlopen-self-pie
2070 $(objpfx
)tst-dlopen-tlsmodid-container
: $(shared-thread-library
)
2071 LDFLAGS-tst-dlopen-tlsmodid-container
+= -Wl
,-rpath
,\
$$ORIGIN
2073 tst-tst-dlopen-self-no-pie
= yes
2074 CFLAGS-tst-dlopen-self-pie.c
+= $(pie-ccflag
)
2075 LDFLAGS-tst-dlopen-self-container
+= -Wl
,-rpath
,\
$$ORIGIN
2077 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
2078 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
2079 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
2080 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
2081 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
2082 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
2083 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
2084 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
2085 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
2086 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
2087 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
2088 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
2089 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
2090 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
2091 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
2092 CFLAGS-ifuncmain9pic.c
+= $(pic-ccflag
)
2093 CFLAGS-ifuncmain9picstatic.c
+= $(pic-ccflag
)
2095 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
2097 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
2098 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
2099 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
2100 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
2101 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
2102 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
2103 CFLAGS-ifuncmain9pie.c
+= $(pie-ccflag
)
2104 CFLAGS-tst-ifunc-textrel.c
+= $(pic-ccflag
)
2106 LDFLAGS-ifuncmain6pie
= -Wl
,-z
,lazy
2108 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmod1.so
2109 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncdep1pic.o
2110 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmod1.so
2111 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmod5.so
2112 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmod6.so
2114 $(objpfx
)ifuncmain1
: $(addprefix $(objpfx
),ifuncmod1.so
)
2115 $(objpfx
)ifuncmain1pic
: $(addprefix $(objpfx
),ifuncmod1.so
)
2116 $(objpfx
)ifuncmain1staticpic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
2117 $(objpfx
)ifuncmain1static
: $(addprefix $(objpfx
),ifuncdep1.o
)
2118 $(objpfx
)ifuncmain1picstatic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
2119 $(objpfx
)ifuncmain1vis
: $(addprefix $(objpfx
),ifuncmod1.so
)
2120 $(objpfx
)ifuncmain1vispic
: $(addprefix $(objpfx
),ifuncmod1.so
)
2121 $(objpfx
)ifuncmain2
: $(addprefix $(objpfx
),ifuncdep2.o
)
2122 $(objpfx
)ifuncmain2pic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2123 $(objpfx
)ifuncmain2static
: $(addprefix $(objpfx
),ifuncdep2.o
)
2124 $(objpfx
)ifuncmain2picstatic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2126 $(objpfx
)ifuncmain3.out
: $(objpfx
)ifuncmod3.so
2128 $(objpfx
)ifuncmain5
: $(addprefix $(objpfx
),ifuncmod5.so
)
2129 $(objpfx
)ifuncmain5pic
: $(addprefix $(objpfx
),ifuncmod5.so
)
2130 $(objpfx
)ifuncmain5static
: $(addprefix $(objpfx
),ifuncdep5.o
)
2131 $(objpfx
)ifuncmain5staticpic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2132 $(objpfx
)ifuncmain5picstatic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2134 LDFLAGS-tst-ifunc-fault-lazy
= -Wl
,-z
,lazy
2135 LDFLAGS-tst-ifunc-fault-bindnow
= -Wl
,-z
,now
2136 define tst-ifunc-fault-script
2137 ( $(test-wrapper
) $(rtld-prefix
) --verify
$^ \
2138 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 $(rtld-prefix
) $^ \
2139 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 LD_DEBUG
=unused \
2141 ) > $@
; $(evaluate-test
)
2143 $(objpfx
)tst-ifunc-fault-lazy.out
: $(objpfx
)tst-ifunc-fault-lazy
$(objpfx
)ld.so
2144 $(tst-ifunc-fault-script
)
2145 $(objpfx
)tst-ifunc-fault-bindnow.out
: $(objpfx
)tst-ifunc-fault-bindnow \
2147 $(tst-ifunc-fault-script
)
2149 $(objpfx
)tst-unique1.out
: $(objpfx
)tst-unique1mod1.so \
2150 $(objpfx
)tst-unique1mod2.so
2152 $(objpfx
)tst-unique2
: $(objpfx
)tst-unique2mod1.so
2153 $(objpfx
)tst-unique2.out
: $(objpfx
)tst-unique2mod2.so
2155 $(objpfx
)tst-unique3
: $(objpfx
)tst-unique3lib.so
2156 $(objpfx
)tst-unique3.out
: $(objpfx
)tst-unique3lib2.so
2158 $(objpfx
)tst-unique4
: $(objpfx
)tst-unique4lib.so
2160 $(objpfx
)tst-nodelete.out
: $(objpfx
)tst-nodelete-uniquemod.so \
2161 $(objpfx
)tst-nodelete-rtldmod.so \
2162 $(objpfx
)tst-nodelete-zmod.so
2164 LDFLAGS-tst-nodelete
= -rdynamic
2165 LDFLAGS-tst-nodelete-zmod.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
2167 $(objpfx
)tst-nodelete2.out
: $(objpfx
)tst-nodelete2mod.so
2169 LDFLAGS-tst-nodelete2
= -rdynamic
2171 $(objpfx
)tst-initorder-cmp.out
: tst-initorder.exp
$(objpfx
)tst-initorder.out
2175 $(objpfx
)tst-initorder2
: $(objpfx
)tst-initorder2a.so
$(objpfx
)tst-initorder2d.so
$(objpfx
)tst-initorder2c.so
2176 $(objpfx
)tst-initorder2a.so
: $(objpfx
)tst-initorder2b.so
2177 $(objpfx
)tst-initorder2b.so
: $(objpfx
)tst-initorder2c.so
2178 $(objpfx
)tst-initorder2c.so
: $(objpfx
)tst-initorder2d.so
2179 LDFLAGS-tst-initorder2
= -Wl
,--no-as-needed
2180 LDFLAGS-tst-initorder2a.so
= -Wl
,--no-as-needed
2181 LDFLAGS-tst-initorder2b.so
= -Wl
,--no-as-needed
2182 LDFLAGS-tst-initorder2c.so
= -Wl
,--no-as-needed
2183 define o-iterator-doit
2184 $(objpfx
)tst-initorder2
$o.os
: tst-initorder2.c
; \
2185 $$(compile-command.c
) -DNAME
=\"$o\"
2187 object-suffixes-left
:= a b c d
2188 include $(o-iterator
)
2190 $(objpfx
)tst-initorder2-cmp.out
: tst-initorder2.exp
$(objpfx
)tst-initorder2.out
2194 $(objpfx
)tst-relsort1mod1.so
: $(libm
) $(objpfx
)tst-relsort1mod2.so
2195 $(objpfx
)tst-relsort1mod2.so
: $(libm
)
2196 $(objpfx
)tst-relsort1.out
: $(objpfx
)tst-relsort1mod1.so \
2197 $(objpfx
)tst-relsort1mod2.so
2199 $(objpfx
)tst-unused-dep.out
: $(objpfx
)testobj1.so
2200 $(test-wrapper-env
) \
2201 LD_TRACE_LOADED_OBJECTS
=1 \
2208 $(objpfx
)tst-unused-dep-cmp.out
: $(objpfx
)tst-unused-dep.out
2209 cmp
$< /dev
/null
> $@
; \
2212 $(objpfx
)tst-audit11.out
: $(objpfx
)tst-auditmod11.so
$(objpfx
)tst-audit11mod1.so
2213 tst-audit11-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod11.so
2214 $(objpfx
)tst-audit11mod1.so
: $(objpfx
)tst-audit11mod2.so
2215 LDFLAGS-tst-audit11mod2.so
= -Wl
,--version-script
=tst-audit11mod2.map
,-soname
,tst-audit11mod2.so
2217 $(objpfx
)tst-audit12.out
: $(objpfx
)tst-auditmod12.so
$(objpfx
)tst-audit12mod1.so
$(objpfx
)tst-audit12mod3.so
2218 tst-audit12-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod12.so
2219 $(objpfx
)tst-audit12mod1.so
: $(objpfx
)tst-audit12mod2.so
2220 LDFLAGS-tst-audit12mod2.so
= -Wl
,--version-script
=tst-audit12mod2.map
2222 $(objpfx
)tst-audit13.out
: $(objpfx
)tst-audit13mod1.so
2223 LDFLAGS-tst-audit13mod1.so
= -Wl
,-z
,lazy
2224 tst-audit13-ENV
= LD_AUDIT
=$(objpfx
)tst-audit13mod1.so
2226 $(objpfx
)tst-auditmany.out
: $(objpfx
)tst-auditmanymod1.so \
2227 $(objpfx
)tst-auditmanymod2.so
$(objpfx
)tst-auditmanymod3.so \
2228 $(objpfx
)tst-auditmanymod4.so
$(objpfx
)tst-auditmanymod5.so \
2229 $(objpfx
)tst-auditmanymod6.so
$(objpfx
)tst-auditmanymod7.so \
2230 $(objpfx
)tst-auditmanymod8.so
$(objpfx
)tst-auditmanymod9.so
2231 tst-auditmany-ENV
= \
2232 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
2234 LDFLAGS-tst-audit14
= -Wl
,--audit
=tst-auditlogmod-1.so
,--disable-new-dtags
2235 $(objpfx
)tst-auditlogmod-1.so
: $(libsupport
)
2236 $(objpfx
)tst-audit14.out
: $(objpfx
)tst-auditlogmod-1.so
2237 LDFLAGS-tst-audit14a
= -Wl
,--audit
=tst-auditlogmod-1.so
,--enable-new-dtags
2238 $(objpfx
)tst-audit14a.out
: $(objpfx
)tst-auditlogmod-1.so
2239 LDFLAGS-tst-audit15
= \
2240 -Wl
,--audit
=tst-auditlogmod-1.so
,--depaudit
=tst-auditlogmod-2.so
2241 $(objpfx
)tst-auditlogmod-2.so
: $(libsupport
)
2242 $(objpfx
)tst-audit15.out
: \
2243 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so
2244 LDFLAGS-tst-audit16
= \
2245 -Wl
,--audit
=tst-auditlogmod-1.so
:tst-auditlogmod-2.so \
2246 -Wl
,--depaudit
=tst-auditlogmod-3.so
2247 $(objpfx
)tst-auditlogmod-3.so
: $(libsupport
)
2248 $(objpfx
)tst-audit16.out
: \
2249 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so \
2250 $(objpfx
)tst-auditlogmod-3.so
2251 $(objpfx
)tst-audit17.out
: $(objpfx
)tst-auditmod17.so
2252 # The test check if a audit library without libc.so on DT_NEEDED works as
2253 # intended, so it uses an explicit link rule.
2254 $(objpfx
)tst-auditmod17.so
: $(objpfx
)tst-auditmod17.os
2255 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
2256 $(filter-out $(map-file
),$^
)
2257 $(call after-link
,$@.new
)
2259 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-auditmod17
)
2260 tst-audit17-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod17.so
2262 $(objpfx
)tst-audit14-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14.out
2265 $(objpfx
)tst-audit14a-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14a.out
2268 $(objpfx
)tst-audit15-cmp.out
: tst-audit15.exp
$(objpfx
)tst-audit15.out
2271 $(objpfx
)tst-audit16-cmp.out
: tst-audit16.exp
$(objpfx
)tst-audit16.out
2275 $(objpfx
)tst-audit18.out
: $(objpfx
)tst-auditmod18.so \
2276 $(objpfx
)tst-audit18mod.so
2277 tst-audit18-ARGS
= -- $(host-test-program-cmd
)
2279 $(objpfx
)tst-audit19a.out
: $(objpfx
)tst-auditmod19a.so
2280 tst-audit19a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod19a.so
2282 $(objpfx
)tst-audit19b.out
: $(objpfx
)tst-auditmod19b.so
2283 $(objpfx
)tst-audit19b
: $(objpfx
)tst-audit19bmod.so
2284 tst-audit19b-ARGS
= -- $(host-test-program-cmd
)
2286 $(objpfx
)tst-audit20.out
: $(objpfx
)tst-auditmod20.so
2287 tst-audit20-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod20.so
2289 $(objpfx
)tst-audit21
: $(shared-thread-library
)
2290 $(objpfx
)tst-audit21.out
: $(objpfx
)tst-auditmod21a.so
2291 $(objpfx
)tst-auditmod21a.so
: $(objpfx
)tst-auditmod21b.so
2292 tst-audit21-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod21a.so
2294 $(objpfx
)tst-audit22.out
: $(objpfx
)tst-auditmod22.so
2295 tst-audit22-ARGS
= -- $(host-test-program-cmd
)
2297 $(objpfx
)tst-audit23.out
: $(objpfx
)tst-auditmod23.so \
2298 $(objpfx
)tst-audit23mod.so
2299 tst-audit23-ARGS
= -- $(host-test-program-cmd
)
2301 $(objpfx
)tst-audit24a.out
: $(objpfx
)tst-auditmod24a.so
2302 $(objpfx
)tst-audit24a
: $(objpfx
)tst-audit24amod1.so \
2303 $(objpfx
)tst-audit24amod2.so
2304 tst-audit24a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24a.so
2305 LDFLAGS-tst-audit24a
= -Wl
,-z
,now
2307 $(objpfx
)tst-audit24b.out
: $(objpfx
)tst-auditmod24b.so
2308 $(objpfx
)tst-audit24b
: $(objpfx
)tst-audit24bmod1.so \
2309 $(objpfx
)tst-audit24bmod2.so
2310 $(objpfx
)tst-audit24bmod1
: $(objpfx
)tst-audit24bmod2.so
2311 # The test checks if a library without .gnu.version correctly calls the
2312 # audit callbacks. So it uses an explicit link rule to avoid linking
2314 $(objpfx
)tst-audit24bmod1.so
: $(objpfx
)tst-audit24bmod1.os
2315 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod1.os \
2317 $(call after-link
,$@.new
)
2319 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod1
)
2320 $(objpfx
)tst-audit24bmod2.so
: $(objpfx
)tst-audit24bmod2.os
2321 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod2.os
2322 $(call after-link
,$@.new
)
2324 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod2
)
2325 tst-audit24b-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24b.so
2326 LDFLAGS-tst-audit24b
= -Wl
,-z
,now
2328 # Same as tst-audit24a, but tests LD_BIND_NOW
2329 $(objpfx
)tst-audit24c.out
: $(objpfx
)tst-auditmod24c.so
2330 $(objpfx
)tst-audit24c
: $(objpfx
)tst-audit24amod1.so \
2331 $(objpfx
)tst-audit24amod2.so
2332 tst-audit24c-ENV
= LD_BIND_NOW
=1 LD_AUDIT
=$(objpfx
)tst-auditmod24c.so
2333 LDFLAGS-tst-audit24c
= -Wl
,-z
,lazy
2335 $(objpfx
)tst-audit24d.out
: $(objpfx
)tst-auditmod24d.so
2336 $(objpfx
)tst-audit24d
: $(objpfx
)tst-audit24dmod1.so \
2337 $(objpfx
)tst-audit24dmod2.so
2338 $(objpfx
)tst-audit24dmod1.so
: $(objpfx
)tst-audit24dmod3.so
2339 LDFLAGS-tst-audit24dmod1.so
= -Wl
,-z
,now
2340 $(objpfx
)tst-audit24dmod2.so
: $(objpfx
)tst-audit24dmod4.so
2341 LDFLAGS-tst-audit24dmod2.so
= -Wl
,-z
,lazy
2342 tst-audit24d-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24d.so
2343 LDFLAGS-tst-audit24d
= -Wl
,-z
,lazy
2345 $(objpfx
)tst-audit25a.out
: $(objpfx
)tst-auditmod25.so
2346 $(objpfx
)tst-audit25a
: $(objpfx
)tst-audit25mod1.so \
2347 $(objpfx
)tst-audit25mod2.so \
2348 $(objpfx
)tst-audit25mod3.so \
2349 $(objpfx
)tst-audit25mod4.so
2350 LDFLAGS-tst-audit25a
= -Wl
,-z
,lazy
2351 $(objpfx
)tst-audit25mod1.so
: $(objpfx
)tst-audit25mod3.so
2352 LDFLAGS-tst-audit25mod1.so
= -Wl
,-z
,now
2353 $(objpfx
)tst-audit25mod2.so
: $(objpfx
)tst-audit25mod4.so
2354 LDFLAGS-tst-audit25mod2.so
= -Wl
,-z
,lazy
2355 tst-audit25a-ARGS
= -- $(host-test-program-cmd
)
2357 $(objpfx
)tst-audit25b.out
: $(objpfx
)tst-auditmod25.so
2358 $(objpfx
)tst-audit25b
: $(objpfx
)tst-audit25mod1.so \
2359 $(objpfx
)tst-audit25mod2.so \
2360 $(objpfx
)tst-audit25mod3.so \
2361 $(objpfx
)tst-audit25mod4.so
2362 LDFLAGS-tst-audit25b
= -Wl
,-z
,now
2363 tst-audit25b-ARGS
= -- $(host-test-program-cmd
)
2365 $(objpfx
)tst-audit28.out
: $(objpfx
)tst-auditmod28.so
2366 $(objpfx
)tst-auditmod28.so
: $(libsupport
)
2367 tst-audit28-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod28.so
2369 # tst-sonamemove links against an older implementation of the library.
2370 LDFLAGS-tst-sonamemove-linkmod1.so
= \
2371 -Wl
,--version-script
=tst-sonamemove-linkmod1.map \
2372 -Wl
,-soname
,tst-sonamemove-runmod1.so
2373 LDFLAGS-tst-sonamemove-runmod1.so
= -Wl
,--no-as-needed \
2374 -Wl
,--version-script
=tst-sonamemove-runmod1.map \
2375 -Wl
,-soname
,tst-sonamemove-runmod1.so
2376 LDFLAGS-tst-sonamemove-runmod2.so
= \
2377 -Wl
,--version-script
=tst-sonamemove-runmod2.map \
2378 -Wl
,-soname
,tst-sonamemove-runmod2.so
2379 $(objpfx
)tst-sonamemove-runmod1.so
: $(objpfx
)tst-sonamemove-runmod2.so
2380 # Link against the link module, but depend on the run-time modules
2382 $(objpfx
)tst-sonamemove-link
: $(objpfx
)tst-sonamemove-linkmod1.so
2383 $(objpfx
)tst-sonamemove-link.out
: \
2384 $(objpfx
)tst-sonamemove-runmod1.so \
2385 $(objpfx
)tst-sonamemove-runmod2.so
2386 $(objpfx
)tst-sonamemove-dlopen.out
: \
2387 $(objpfx
)tst-sonamemove-runmod1.so \
2388 $(objpfx
)tst-sonamemove-runmod2.so
2390 $(objpfx
)tst-dlmopen-dlerror-mod.so
: $(libsupport
)
2391 $(objpfx
)tst-dlmopen-dlerror.out
: $(objpfx
)tst-dlmopen-dlerror-mod.so
2393 # Override -z defs, so that we can reference an undefined symbol.
2394 # Force lazy binding for the same reason.
2395 LDFLAGS-tst-latepthreadmod.so
= \
2396 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2397 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
2398 # function this_function_is_not_defined.
2399 CFLAGS-tst-latepthreadmod.c
+= -fno-optimize-sibling-calls
2400 $(objpfx
)tst-latepthreadmod.so
: $(shared-thread-library
)
2401 $(objpfx
)tst-latepthread.out
: $(objpfx
)tst-latepthreadmod.so
2403 # The test modules are parameterized by preprocessor macros.
2404 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules
)): \
2405 $(objpfx
)tst-tls-manydynamic
%mod.os
: tst-tls-manydynamicmod.c
2406 $(compile-command.c
) \
2407 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2408 $(objpfx
)tst-tls-manydynamic
: $(shared-thread-library
)
2409 $(objpfx
)tst-tls-manydynamic.out
: \
2410 $(patsubst %,$(objpfx
)%.so
,$(tst-tls-many-dynamic-modules
))
2412 $(objpfx
)tst-ldconfig-X.out
: tst-ldconfig-X.sh
$(objpfx
)ldconfig
2413 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
2414 '$(run-program-env)' > $@
; \
2417 $(objpfx
)tst-ldconfig-p.out
: tst-ldconfig-p.sh
$(objpfx
)ldconfig
2418 $(SHELL
) $< '$(common-objpfx)' '$(sysconfdir)' '$(test-wrapper-env)' \
2419 '$(run-program-env)' > $@
; \
2422 LDFLAGS-tst-ldconfig-soname-lib-with-soname.so
= \
2423 -Wl
,-soname
,libtst-ldconfig-soname-lib-with-soname.so
.1
2425 $(objpfx
)tst-ldconfig-soname.out
: tst-ldconfig-soname.sh \
2427 $(objpfx
)tst-ldconfig-soname-lib-with-soname.so \
2428 $(objpfx
)tst-ldconfig-soname-lib-without-soname.so
2429 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
2430 '$(run-program-env)' > $@
; \
2433 # Test static linking of all the libraries we can possibly link
2434 # together. Note that in some configurations this may be less than the
2435 # complete list of libraries we build but we try to maxmimize this list.
2436 ifeq ($(pthread-in-libc
),no
)
2437 $(objpfx
)tst-linkall-static
: \
2438 $(common-objpfx
)resolv
/libanl.a
2440 $(objpfx
)tst-linkall-static
: \
2441 $(common-objpfx
)math
/libm.a \
2442 $(common-objpfx
)resolv
/libresolv.a \
2443 $(common-objpfx
)login
/libutil.a \
2444 $(common-objpfx
)rt
/librt.a \
2445 $(static-thread-library
)
2447 LDFLAGS-nextmod3.so
= -Wl
,--version-script
=nextmod3.map
2449 # The application depends on the DSO, and the DSO loads the plugin.
2450 # The plugin also depends on the DSO. This creates the circular
2451 # dependency via dlopen that we're testing to make sure works.
2452 $(objpfx
)tst-nodelete-dlclose-plugin.so
: $(objpfx
)tst-nodelete-dlclose-dso.so
2453 $(objpfx
)tst-nodelete-dlclose
: $(objpfx
)tst-nodelete-dlclose-dso.so
2454 $(objpfx
)tst-nodelete-dlclose.out
: $(objpfx
)tst-nodelete-dlclose-dso.so \
2455 $(objpfx
)tst-nodelete-dlclose-plugin.so
2457 $(objpfx
)tst-debug1.out
: $(objpfx
)tst-debug1mod1.so
2459 $(objpfx
)tst-debug1mod1.so
: $(objpfx
)testobj1.so
2460 $(OBJCOPY
) --only-keep-debug
$< $@
2462 $(objpfx
)tst-main1
: $(objpfx
)tst-main1mod.so
2463 CRT-tst-main1
:= $(csu-objpfx
)crt1.o
2464 tst-main1-no-pie
= yes
2465 LDLIBS-tst-main1
= $(libsupport
)
2466 tst-main1mod.so-no-z-defs
= yes
2468 LDLIBS-tst-absolute-sym-lib.so
= tst-absolute-sym-lib.lds
2469 $(objpfx
)tst-absolute-sym-lib.so
: $(LDLIBS-tst-absolute-sym-lib.so
)
2470 $(objpfx
)tst-absolute-sym
: $(objpfx
)tst-absolute-sym-lib.so
2472 LDLIBS-tst-absolute-zero-lib.so
= tst-absolute-zero-lib.lds
2473 $(objpfx
)tst-absolute-zero-lib.so
: $(LDLIBS-tst-absolute-zero-lib.so
)
2474 $(objpfx
)tst-absolute-zero
: $(objpfx
)tst-absolute-zero-lib.so
2476 $(objpfx
)tst-big-note
: $(objpfx
)tst-big-note-lib.so
2477 # Avoid creating an ABI tag note, which may come before the
2478 # artificial, large note in tst-big-note-lib.o and invalidate the
2480 $(objpfx
)tst-big-note-lib.so
: $(objpfx
)tst-big-note-lib.o
2481 $(LINK.o
) -shared
-o
$@
$(LDFLAGS.so
) $(dt-relr-ldflag
) $<
2483 $(objpfx
)tst-unwind-ctor
: $(objpfx
)tst-unwind-ctor-lib.so
2485 CFLAGS-tst-unwind-main.c
+= -funwind-tables
-DUSE_PTHREADS
=0
2487 $(objpfx
)tst-initfinilazyfail.out
: \
2488 $(objpfx
)tst-initlazyfailmod.so
$(objpfx
)tst-finilazyfailmod.so
2489 # Override -z defs, so that we can reference an undefined symbol.
2490 # Force lazy binding for the same reason.
2491 LDFLAGS-tst-initlazyfailmod.so
= \
2492 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2493 LDFLAGS-tst-finilazyfailmod.so
= \
2494 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2496 $(objpfx
)tst-dlopenfail.out
: \
2497 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so
2498 # Order matters here. tst-dlopenfaillinkmod.so's soname ensures a
2499 # run-time loader failure. --as-needed breaks this test because
2500 # nothing actually references tst-dlopenfailmod2.so (with its soname
2501 # tst-dlopenfail-missingmod.so).
2502 LDFLAGS-tst-dlopenfailmod1.so
= -Wl
,--no-as-needed
2503 $(objpfx
)tst-dlopenfailmod1.so
: \
2504 $(shared-thread-library
) $(objpfx
)tst-dlopenfaillinkmod.so
2505 LDFLAGS-tst-dlopenfaillinkmod.so
= -Wl
,-soname
,tst-dlopenfail-missingmod.so
2506 $(objpfx
)tst-dlopenfailmod2.so
: $(objpfx
)tst-dlopenfailnodelmod.so
2507 $(objpfx
)tst-dlopenfail-2.out
: \
2508 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so \
2509 $(objpfx
)tst-dlopenfailmod3.so
2510 # tst-dlopenfailnodelmod.so emulates how libpthread was linked.
2511 $(objpfx
)tst-dlopenfailnodelmod.so
: $(libsupport
)
2512 LDFLAGS-tst-dlopenfailnodelmod.so
= \
2513 -Wl
,--enable-new-dtags
,-z
,nodelete
,-z
,initfirst
2514 # tst-dlopenfail should export the libsupport symbols, so that
2515 # tst-dlopenfailnodelmod.so uses them for error reporting.
2516 LDFLAGS-tst-dlopenfail
= -Wl
,-E
2518 $(objpfx
)tst-dlopen-nodelete-reloc.out
: \
2519 $(objpfx
)tst-dlopen-nodelete-reloc-mod1.so \
2520 $(objpfx
)tst-dlopen-nodelete-reloc-mod2.so \
2521 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so \
2522 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so \
2523 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so \
2524 $(objpfx
)tst-dlopen-nodelete-reloc-mod6.so \
2525 $(objpfx
)tst-dlopen-nodelete-reloc-mod7.so \
2526 $(objpfx
)tst-dlopen-nodelete-reloc-mod8.so \
2527 $(objpfx
)tst-dlopen-nodelete-reloc-mod9.so \
2528 $(objpfx
)tst-dlopen-nodelete-reloc-mod10.so \
2529 $(objpfx
)tst-dlopen-nodelete-reloc-mod11.so \
2530 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so \
2531 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so \
2532 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so \
2533 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2534 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so \
2535 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
2536 tst-dlopen-nodelete-reloc-mod2.so-no-z-defs
= yes
2537 LDFLAGS-tst-dlopen-nodelete-reloc-mod2.so
= -Wl
,-z
,nodelete
2538 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
: \
2539 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so
2540 LDFLAGS-tst-dlopen-nodelete-reloc-mod4.so
= -Wl
,--no-as-needed
2541 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so
: \
2542 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
2543 LDFLAGS-tst-dlopen-nodelete-reloc-mod5.so
= -Wl
,-z
,nodelete
,--no-as-needed
2544 tst-dlopen-nodelete-reloc-mod5.so-no-z-defs
= yes
2545 tst-dlopen-nodelete-reloc-mod7.so-no-z-defs
= yes
2546 tst-dlopen-nodelete-reloc-mod11.so-no-z-defs
= yes
2547 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so
: \
2548 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so
2549 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
: \
2550 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so
2551 tst-dlopen-nodelete-reloc-mod16.so-no-z-defs
= yes
2552 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
: \
2553 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
2554 LDFLAGS-tst-dlopen-nodelete-reloc-mod16.so
= -Wl
,--no-as-needed
2555 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
: \
2556 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2557 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
2558 LDFLAGS-tst-dlopen-nodelete-reloc-mod17.so
= -Wl
,--no-as-needed
2560 $(objpfx
)tst-ldconfig-ld_so_conf-update.out
: $(objpfx
)tst-ldconfig-ld-mod.so
2562 LDFLAGS-tst-filterobj-flt.so
= -Wl
,--filter=$(objpfx
)tst-filterobj-filtee.so
2563 $(objpfx
)tst-filterobj
: $(objpfx
)tst-filterobj-flt.so
2564 $(objpfx
)tst-filterobj.out
: $(objpfx
)tst-filterobj-filtee.so
2565 $(objpfx
)tst-filterobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2567 LDFLAGS-tst-filterobj-aux.so
= -Wl
,--auxiliary
=$(objpfx
)tst-filterobj-filtee.so
2568 $(objpfx
)tst-auxobj
: $(objpfx
)tst-filterobj-aux.so
2569 $(objpfx
)tst-auxobj.out
: $(objpfx
)tst-filterobj-filtee.so
2570 $(objpfx
)tst-auxobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2572 $(objpfx
)tst-single_threaded
: $(objpfx
)tst-single_threaded-mod1.so
2573 $(objpfx
)tst-single_threaded.out
: \
2574 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so
2575 $(objpfx
)tst-single_threaded-static-dlopen
: \
2576 $(objpfx
)tst-single_threaded-mod1.o
2577 $(objpfx
)tst-single_threaded-static-dlopen.out
: \
2578 $(objpfx
)tst-single_threaded-mod2.so
2579 $(objpfx
)tst-single_threaded-pthread
: \
2580 $(objpfx
)tst-single_threaded-mod1.so
$(shared-thread-library
)
2581 $(objpfx
)tst-single_threaded-pthread.out
: \
2582 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so \
2583 $(objpfx
)tst-single_threaded-mod4.so
2584 $(objpfx
)tst-single_threaded-pthread-static
: $(static-thread-library
)
2586 $(objpfx
)tst-tls-ie
: $(shared-thread-library
)
2587 $(objpfx
)tst-tls-ie.out
: \
2588 $(objpfx
)tst-tls-ie-mod0.so \
2589 $(objpfx
)tst-tls-ie-mod1.so \
2590 $(objpfx
)tst-tls-ie-mod2.so \
2591 $(objpfx
)tst-tls-ie-mod3.so \
2592 $(objpfx
)tst-tls-ie-mod4.so \
2593 $(objpfx
)tst-tls-ie-mod5.so \
2594 $(objpfx
)tst-tls-ie-mod6.so
2596 $(objpfx
)tst-tls-ie-dlmopen
: $(shared-thread-library
)
2597 $(objpfx
)tst-tls-ie-dlmopen.out
: \
2598 $(objpfx
)tst-tls-ie-mod0.so \
2599 $(objpfx
)tst-tls-ie-mod1.so \
2600 $(objpfx
)tst-tls-ie-mod2.so \
2601 $(objpfx
)tst-tls-ie-mod3.so \
2602 $(objpfx
)tst-tls-ie-mod4.so \
2603 $(objpfx
)tst-tls-ie-mod5.so \
2604 $(objpfx
)tst-tls-ie-mod6.so
2606 $(objpfx
)argv0test.out
: tst-rtld-argv0.sh
$(objpfx
)ld.so \
2608 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)argv0test \
2609 '$(test-wrapper-env)' '$(run_program_env)' \
2610 '$(rpath-link)' 'test-argv0' > $@
; \
2613 # A list containing the name of the most likely searched subdirectory
2614 # of the glibc-hwcaps directory, for each supported architecture (in
2615 # other words, the oldest hardware level recognized by the
2616 # glibc-hwcaps mechanism for this architecture). Used to obtain test
2617 # coverage for some glibc-hwcaps tests for the widest possible range
2619 glibc-hwcaps-first-subdirs-for-tests
= power9 x86-64-v2 z13
2621 # The test modules are parameterized by preprocessor macros.
2622 LDFLAGS-libmarkermod1-1.so
+= -Wl
,-soname
,libmarkermod1.so
2623 LDFLAGS-libmarkermod2-1.so
+= -Wl
,-soname
,libmarkermod2.so
2624 LDFLAGS-libmarkermod3-1.so
+= -Wl
,-soname
,libmarkermod3.so
2625 LDFLAGS-libmarkermod4-1.so
+= -Wl
,-soname
,libmarkermod4.so
2626 LDFLAGS-libmarkermod5-1.so
+= -Wl
,-soname
,libmarkermod5.so
2627 $(objpfx
)libmarkermod
%.os
: markermodMARKER-VALUE.c
2628 $(compile-command.c
) \
2629 -DMARKER
=marker
$(firstword $(subst -, ,$*)) \
2630 -DVALUE
=$(lastword
$(subst -, ,$*))
2631 $(objpfx
)libmarkermod1.so
: $(objpfx
)libmarkermod1-1.so
2633 $(objpfx
)libmarkermod2.so
: $(objpfx
)libmarkermod2-1.so
2635 $(objpfx
)libmarkermod3.so
: $(objpfx
)libmarkermod3-1.so
2637 $(objpfx
)libmarkermod4.so
: $(objpfx
)libmarkermod4-1.so
2639 $(objpfx
)libmarkermod5.so
: $(objpfx
)libmarkermod5-1.so
2642 # tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is
2643 # preferred over auto-detected subdirectories.
2644 $(objpfx
)tst-glibc-hwcaps-prepend
: $(objpfx
)libmarkermod1-1.so
2645 $(objpfx
)glibc-hwcaps
/prepend-markermod1
/libmarkermod1.so
: \
2646 $(objpfx
)libmarkermod1-2.so
2647 $(make-target-directory
)
2649 $(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
: $(objpfx
)libmarkermod1-3.so
2650 $(make-target-directory
)
2652 $(objpfx
)tst-glibc-hwcaps-prepend.out
: \
2653 $(objpfx
)tst-glibc-hwcaps-prepend
$(objpfx
)libmarkermod1.so \
2654 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,prepend-markermod1 \
2655 $(glibc-hwcaps-first-subdirs-for-tests
))
2656 $(test-wrapper
) $(rtld-prefix
) \
2657 --glibc-hwcaps-prepend prepend-markermod1 \
2661 # Like tst-glibc-hwcaps-prepend, but uses a container and loads the
2662 # library via ld.so.cache. Test setup is contained in the test
2664 $(objpfx
)tst-glibc-hwcaps-prepend-cache.out
: \
2665 $(objpfx
)tst-glibc-hwcaps-prepend-cache
$(objpfx
)libmarkermod1-1.so \
2666 $(objpfx
)libmarkermod1-2.so
$(objpfx
)libmarkermod1-3.so
2668 # tst-glibc-hwcaps-mask checks that --glibc-hwcaps-mask can be used to
2669 # suppress all auto-detected subdirectories.
2670 $(objpfx
)tst-glibc-hwcaps-mask
: $(objpfx
)libmarkermod1-1.so
2671 $(objpfx
)tst-glibc-hwcaps-mask.out
: \
2672 $(objpfx
)tst-glibc-hwcaps-mask
$(objpfx
)libmarkermod1.so \
2673 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,\
2674 $(glibc-hwcaps-first-subdirs-for-tests
))
2675 $(test-wrapper
) $(rtld-prefix
) \
2676 --glibc-hwcaps-mask does-not-exist \
2680 # Generic dependency for sysdeps implementation of
2681 # tst-glibc-hwcaps-cache.
2682 $(objpfx
)tst-glibc-hwcaps-cache.out
: $(objpfx
)tst-glibc-hwcaps
2684 tst-tunables-ARGS
= -- $(host-test-program-cmd
)
2685 tst-tunables-enable_secure-ARGS
= -- $(host-test-program-cmd
)
2687 $(objpfx
)list-tunables.out
: tst-rtld-list-tunables.sh
$(objpfx
)ld.so
2688 $(SHELL
) $< $(objpfx
)ld.so
'$(test-wrapper-env)' \
2689 '$(run_program_env)' > $(objpfx
)/tst-rtld-list-tunables.out
2690 cmp tst-rtld-list-tunables.exp \
2691 $(objpfx
)/tst-rtld-list-tunables.out
> $@
; \
2694 tst-dst-static-ENV
= LD_LIBRARY_PATH
='$$ORIGIN'
2696 $(objpfx
)tst-rtld-help.out
: $(objpfx
)ld.so
2697 $(test-wrapper
) $(rtld-prefix
) --help
> $@
; \
2699 echo
"info: ld.so exit status: $$status" >> $@
; \
2703 # Reuses tst-tls-many-dynamic-modules
2704 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep
)): \
2705 $(objpfx
)tst-tls-manydynamic
%mod-dep.os
: tst-tls-manydynamicmod.c
2706 $(compile-command.c
) \
2707 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2708 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep-bad
)): \
2709 $(objpfx
)tst-tls-manydynamic
%mod-dep-bad.os
: tst-tls-manydynamicmod.c
2710 $(compile-command.c
) \
2711 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2712 tst-tls20mod-bad.so-no-z-defs
= yes
2713 # Single dependency.
2714 $(objpfx
)tst-tls-manydynamic0mod-dep.so
: $(objpfx
)tst-tls-manydynamic1mod-dep.so
2715 # Double dependencies.
2716 $(objpfx
)tst-tls-manydynamic2mod-dep.so
: $(objpfx
)tst-tls-manydynamic3mod-dep.so \
2717 $(objpfx
)tst-tls-manydynamic4mod-dep.so
2718 # Double dependencies with each dependency dependent of another module.
2719 $(objpfx
)tst-tls-manydynamic5mod-dep.so
: $(objpfx
)tst-tls-manydynamic6mod-dep.so \
2720 $(objpfx
)tst-tls-manydynamic7mod-dep.so
2721 $(objpfx
)tst-tls-manydynamic6mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2722 $(objpfx
)tst-tls-manydynamic7mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2723 # Long chain with one double dependency in the middle
2724 $(objpfx
)tst-tls-manydynamic9mod-dep.so
: $(objpfx
)tst-tls-manydynamic10mod-dep.so \
2725 $(objpfx
)tst-tls-manydynamic11mod-dep.so
2726 $(objpfx
)tst-tls-manydynamic10mod-dep.so
: $(objpfx
)tst-tls-manydynamic12mod-dep.so
2727 $(objpfx
)tst-tls-manydynamic12mod-dep.so
: $(objpfx
)tst-tls-manydynamic13mod-dep.so
2728 # Long chain with two double dependencies in the middle
2729 $(objpfx
)tst-tls-manydynamic14mod-dep.so
: $(objpfx
)tst-tls-manydynamic15mod-dep.so
2730 $(objpfx
)tst-tls-manydynamic15mod-dep.so
: $(objpfx
)tst-tls-manydynamic16mod-dep.so \
2731 $(objpfx
)tst-tls-manydynamic17mod-dep.so
2732 $(objpfx
)tst-tls-manydynamic16mod-dep.so
: $(objpfx
)tst-tls-manydynamic18mod-dep.so \
2733 $(objpfx
)tst-tls-manydynamic19mod-dep.so
2734 # Same but with an invalid module.
2735 # Single dependency.
2736 $(objpfx
)tst-tls-manydynamic0mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2737 LDFLAGS-tst-tls-manydynamic0mod-dep-bad.so
= -Wl
,--no-as-needed
2738 # Double dependencies.
2739 $(objpfx
)tst-tls-manydynamic1mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic2mod-dep-bad.so \
2740 $(objpfx
)tst-tls20mod-bad.so
2741 LDFLAGS-tst-tls-manydynamic1mod-dep-bad.so
= -Wl
,--no-as-needed
2742 # Double dependencies with each dependency dependent of another module.
2743 $(objpfx
)tst-tls-manydynamic3mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so \
2744 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
2745 LDFLAGS-tst-tls-manydynamic3mod-dep-bad.so
= -Wl
,--no-as-needed
2746 $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2747 LDFLAGS-tst-tls-manydynamic4mod-dep-bad.so
= -Wl
,--no-as-needed
2748 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2749 LDFLAGS-tst-tls-manydynamic5mod-dep-bad.so
= -Wl
,--no-as-needed
2750 # Long chain with one double dependency in the middle
2751 $(objpfx
)tst-tls-manydynamic6mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so \
2752 $(objpfx
)tst-tls-manydynamic8mod-dep-bad.so
2753 LDFLAGS-tst-tls-manydynamic6mod-dep-bad.so
= -Wl
,--no-as-needed
2754 $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
2755 LDFLAGS-tst-tls-manydynamic7mod-dep-bad.so
= -Wl
,--no-as-needed
2756 $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2757 LDFLAGS-tst-tls-manydynamic9mod-dep-bad.so
= -Wl
,--no-as-needed
2758 # Long chain with two double dependencies in the middle
2759 $(objpfx
)tst-tls-manydynamic10mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
2760 LDFLAGS-tst-tls-manydynamic10mod-dep-bad.so
= -Wl
,--no-as-needed
2761 $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so \
2762 $(objpfx
)tst-tls-manydynamic13mod-dep-bad.so
2763 LDFLAGS-tst-tls-manydynamic11mod-dep-bad.so
= -Wl
,--no-as-needed
2764 $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic14mod-dep-bad.so \
2765 $(objpfx
)tst-tls20mod-bad.so
2766 LDFLAGS-tst-tls-manydynamic12mod-dep-bad.so
= -Wl
,--no-as-needed
2767 $(objpfx
)tst-tls20
: $(shared-thread-library
)
2768 $(objpfx
)tst-tls20.out
: $(objpfx
)tst-tls20mod-bad.so \
2769 $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
) \
2770 $(tst-tls-many-dynamic-modules-dep
:%=$(objpfx
)%.so
) \
2771 $(tst-tls-many-dynamic-modules-dep-bad
:%=$(objpfx
)%.so
) \
2773 # Reuses tst-tls-many-dynamic-modules
2774 $(objpfx
)tst-tls21
: $(shared-thread-library
)
2775 $(objpfx
)tst-tls21.out
: $(objpfx
)tst-tls21mod.so
2776 $(objpfx
)tst-tls21mod.so
: $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
)
2778 $(objpfx
)tst-getauxval-static.out
: $(objpfx
)tst-auxvalmod.so
2779 tst-getauxval-static-ENV
= LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
)
2781 $(objpfx
)tst-dlmopen-gethostbyname.out
: $(objpfx
)tst-dlmopen-gethostbyname-mod.so
2783 $(objpfx
)tst-ro-dynamic
: $(objpfx
)tst-ro-dynamic-mod.so
2784 $(objpfx
)tst-ro-dynamic-mod.so
: $(objpfx
)tst-ro-dynamic-mod.os \
2785 tst-ro-dynamic-mod.map
2786 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@ \
2788 -Wl
,--script
=tst-ro-dynamic-mod.map \
2789 $(objpfx
)tst-ro-dynamic-mod.os
2791 $(objpfx
)tst-rtld-list-diagnostics.out
: tst-rtld-list-diagnostics.py \
2792 $(..
)manual
/dynlink.texi
$(objpfx
)$(rtld-installed-name
)
2793 $(PYTHON
) tst-rtld-list-diagnostics.py \
2794 --manual
=$(..
)manual
/dynlink.texi \
2795 "$(test-wrapper-env) $(objpfx)$(rtld-installed-name) --list-diagnostics" \
2799 $(objpfx
)tst-rtld-run-static.out
: $(objpfx
)/ldconfig
2801 $(objpfx
)tst-dl_find_object.out
: \
2802 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2803 $(objpfx
)tst-dl_find_object-static.out
: \
2804 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2805 tst-dl_find_object-static-ENV
= $(static-dlopen-environment
)
2806 CFLAGS-tst-dl_find_object.c
+= -funwind-tables
2807 CFLAGS-tst-dl_find_object-static.c
+= -funwind-tables
2808 LDFLAGS-tst-dl_find_object-static
+= -Wl
,--eh-frame-hdr
2809 CFLAGS-tst-dl_find_object-mod1.c
+= -funwind-tables
2810 CFLAGS-tst-dl_find_object-mod2.c
+= -funwind-tables
2811 LDFLAGS-tst-dl_find_object-mod2.so
+= -Wl
,--enable-new-dtags
,-z
,nodelete
2812 $(objpfx
)tst-dl_find_object-threads
: $(shared-thread-library
)
2813 CFLAGS-tst-dl_find_object-threads.c
+= -funwind-tables
2814 $(objpfx
)tst-dl_find_object-threads.out
: \
2815 $(objpfx
)tst-dl_find_object-mod1.so \
2816 $(objpfx
)tst-dl_find_object-mod2.so \
2817 $(objpfx
)tst-dl_find_object-mod3.so \
2818 $(objpfx
)tst-dl_find_object-mod4.so \
2819 $(objpfx
)tst-dl_find_object-mod5.so \
2820 $(objpfx
)tst-dl_find_object-mod6.so \
2821 $(objpfx
)tst-dl_find_object-mod7.so \
2822 $(objpfx
)tst-dl_find_object-mod8.so \
2823 $(objpfx
)tst-dl_find_object-mod9.so
2824 CFLAGS-tst-dl_find_object-mod3.c
+= -funwind-tables
2825 CFLAGS-tst-dl_find_object-mod4.c
+= -funwind-tables
2826 CFLAGS-tst-dl_find_object-mod5.c
+= -funwind-tables
2827 CFLAGS-tst-dl_find_object-mod6.c
+= -funwind-tables
2828 CFLAGS-tst-dl_find_object-mod7.c
+= -funwind-tables
2829 CFLAGS-tst-dl_find_object-mod8.c
+= -funwind-tables
2830 CFLAGS-tst-dl_find_object-mod9.c
+= -funwind-tables
2832 $(objpfx
)tst-p_alignmod-base.so
: $(libsupport
)
2833 LDFLAGS-tst-p_alignmod-base.so
+= -Wl
,-z
,max-page-size
=0x200000
2835 $(objpfx
)tst-p_align1
: $(objpfx
)tst-p_alignmod1.so
2837 # Make a copy of tst-p_alignmod-base.so and lower p_align of the first
2839 $(objpfx
)tst-p_alignmod1.so
: $(objpfx
)tst-p_alignmod-base.so
2841 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2842 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a half
$@
2844 $(objpfx
)tst-p_align2
: $(objpfx
)tst-p_alignmod2.so
2846 # Make a copy of tst-p_alignmod-base.so and update p_align of the first
2848 $(objpfx
)tst-p_alignmod2.so
: $(objpfx
)tst-p_alignmod-base.so
2850 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2851 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a
1 $@
2853 LDFLAGS-tst-p_alignmod3.so
+= -Wl
,-z
,max-page-size
=0x100,-z
,common-page-size
=0x100
2855 $(objpfx
)tst-p_align3
: $(objpfx
)tst-p_alignmod3.so
2856 $(objpfx
)tst-p_align3.out
: tst-p_align3.sh
$(objpfx
)tst-p_align3
2857 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)'; \
2860 $(objpfx
)check-abi-version-libc.out
: $(common-objpfx
)libc.so
2861 LC_ALL
=C
$(READELF
) -V
-W
$< \
2862 | sed
-ne
'/.gnu.version_d/, /.gnu.version_r/ p' \
2863 | grep GLIBC_ABI_DT_RELR
> $@
; \
2866 $(objpfx
)check-tst-relr-pie.out
: $(objpfx
)tst-relr-pie
2867 LC_ALL
=C
$(OBJDUMP
) -p
$< \
2868 | sed
-ne
'/required from libc.so/,$$ p' \
2869 | grep GLIBC_ABI_DT_RELR
> $@
; \
2872 # The test checks if a DT_RELR shared library without DT_NEEDED works as
2873 # intended, so it uses an explicit link rule.
2874 $(objpfx
)tst-relr2
: $(objpfx
)tst-relr-mod2.so
2875 $(objpfx
)tst-relr-mod2.so
: $(objpfx
)tst-relr-mod2.os
2876 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2877 $(LDFLAGS-soname-fname
) \
2878 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2879 $(call after-link
,$@.new
)
2882 # The test checks if a DT_RELR shared library without DT_VERNEED works as
2883 # intended, so it uses an explicit link rule.
2884 $(objpfx
)tst-relr3
: $(objpfx
)tst-relr-mod3a.so
2885 $(objpfx
)tst-relr-mod3b.so
: $(objpfx
)tst-relr-mod3b.os
2886 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2887 $(LDFLAGS-soname-fname
) \
2888 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2889 $(call after-link
,$@.new
)
2892 $(objpfx
)tst-relr-mod3a.so
: $(objpfx
)tst-relr-mod3a.os \
2893 $(objpfx
)tst-relr-mod3b.so
2894 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2895 $(LDFLAGS-soname-fname
) $(LDFLAGS-rpath-ORIGIN
) \
2896 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2897 $(call after-link
,$@.new
)
2900 # The test checks if a DT_RELR shared library without libc.so on DT_NEEDED
2901 # works as intended, so it uses an explicit link rule.
2902 $(objpfx
)tst-relr4
: $(objpfx
)tst-relr-mod4a.so
2903 $(objpfx
)tst-relr-mod4b.so
: $(objpfx
)tst-relr-mod4b.os
2904 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2905 $(LDFLAGS-soname-fname
) \
2906 -Wl
,--version-script
=tst-relr-mod4b.map \
2907 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2908 $(call after-link
,$@.new
)
2911 $(objpfx
)tst-relr-mod4a.so
: $(objpfx
)tst-relr-mod4a.os \
2912 $(objpfx
)tst-relr-mod4b.so
2913 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2914 $(LDFLAGS-soname-fname
) $(LDFLAGS-rpath-ORIGIN
) \
2915 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2916 $(call after-link
,$@.new
)
2919 LDFLAGS-libtracemod1-1.so
+= -Wl
,-soname
,libtracemod1.so
2920 LDFLAGS-libtracemod2-1.so
+= -Wl
,-soname
,libtracemod2.so
2921 LDFLAGS-libtracemod3-1.so
+= -Wl
,-soname
,libtracemod3.so
2922 LDFLAGS-libtracemod4-1.so
+= -Wl
,-soname
,libtracemod4.so
2923 LDFLAGS-libtracemod5-1.so
+= -Wl
,-soname
,libtracemod5.so
2925 $(objpfx
)libtracemod1-1.so
: $(objpfx
)libtracemod2-1.so \
2926 $(objpfx
)libtracemod3-1.so
2927 $(objpfx
)libtracemod2-1.so
: $(objpfx
)libtracemod4-1.so \
2928 $(objpfx
)libtracemod5-1.so
2930 define libtracemod-x
2931 $(objpfx
)libtracemod
$(1)/libtracemod
$(1).so
: $(objpfx
)libtracemod
$(1)-1.so
2932 $$(make-target-directory
)
2935 libtracemod-suffixes
= 1 2 3 4 5
2936 $(foreach i
,$(libtracemod-suffixes
), $(eval
$(call libtracemod-x
,$(i
))))
2938 define tst-trace-skeleton
2939 $(objpfx
)tst-trace
$(1).out
: $(objpfx
)libtracemod1
/libtracemod1.so \
2940 $(objpfx
)libtracemod2
/libtracemod2.so \
2941 $(objpfx
)libtracemod3
/libtracemod3.so \
2942 $(objpfx
)libtracemod4
/libtracemod4.so \
2943 $(objpfx
)libtracemod5
/libtracemod5.so \
2944 $(..
)scripts
/tst-ld-trace.py \
2946 ${ $(PYTHON
) $(..
)scripts
/tst-ld-trace.py \
2947 "$(test-wrapper-env) $(elf-objpfx)$(rtld-installed-name) \
2948 --library-path $(common-objpfx):$(strip $(2)) \
2949 $(objpfx)libtracemod1/libtracemod1.so" tst-trace
$(1).exp \
2950 } > $$@
; $$(evaluate-test
)
2953 $(eval
$(call tst-trace-skeleton
,1,))
2954 $(eval
$(call tst-trace-skeleton
,2,\
2955 $(objpfx
)libtracemod2
))
2956 $(eval
$(call tst-trace-skeleton
,3,\
2957 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
))
2958 $(eval
$(call tst-trace-skeleton
,4,\
2959 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
:$(objpfx
)libtracemod4
))
2960 $(eval
$(call tst-trace-skeleton
,5,\
2961 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
:$(objpfx
)libtracemod4
:$(objpfx
)libtracemod5
))
2963 $(objpfx
)tst-tls-allocation-failure-static-patched
: \
2964 $(objpfx
)tst-tls-allocation-failure-static
$(..
)scripts
/tst-elf-edit.py
2966 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
--maximize-tls-size
$@
2968 $(objpfx
)tst-tls-allocation-failure-static-patched.out
: \
2969 $(objpfx
)tst-tls-allocation-failure-static-patched
2970 $(test-wrapper
) $< > $@
2>&1; echo
"status: $$?" >> $@
2971 grep
-q
'^Fatal glibc error: Cannot allocate TLS block$$' $@ \
2972 && grep
-q
'^status: 127$$' $@
; \
2975 $(objpfx
)tst-audit-tlsdesc
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
2976 $(objpfx
)tst-audit-tlsdesc-mod2.so \
2977 $(shared-thread-library
)
2978 ifneq (no
,$(have-mtls-descriptor
))
2979 # The test is valid for all TLS types, but we want to exercise GNU2
2981 CFLAGS-tst-audit-tlsdesc-mod1.c
+= -mtls-dialect
=$(have-mtls-descriptor
)
2982 CFLAGS-tst-audit-tlsdesc-mod2.c
+= -mtls-dialect
=$(have-mtls-descriptor
)
2984 $(objpfx
)tst-audit-tlsdesc-dlopen
: $(shared-thread-library
)
2985 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
2986 $(objpfx
)tst-audit-tlsdesc-mod2.so
2987 $(objpfx
)tst-audit-tlsdesc-mod1.so
: $(objpfx
)tst-audit-tlsdesc-mod2.so
2988 $(objpfx
)tst-audit-tlsdesc.out
: $(objpfx
)tst-auditmod-tlsdesc.so
2989 tst-audit-tlsdesc-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
2990 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-auditmod-tlsdesc.so
2991 tst-audit-tlsdesc-dlopen-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
2993 $(objpfx
)tst-dlmopen-twice.out
: \
2994 $(objpfx
)tst-dlmopen-twice-mod1.so \
2995 $(objpfx
)tst-dlmopen-twice-mod2.so
2997 LDFLAGS-tst-sprof-mod.so
= -Wl
,-soname
,tst-sprof-mod.so
2998 $(objpfx
)tst-sprof-basic
: $(objpfx
)tst-sprof-mod.so
2999 $(objpfx
)tst-sprof-basic.out
: tst-sprof-basic.sh
$(objpfx
)tst-sprof-basic
3000 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
3001 '$(run-program-env)' > $@
; \
3003 generated
+= tst-sprof-mod.so.profile
3005 LDFLAGS-tst-dlclose-lazy-mod1.so
= -Wl
,-z
,lazy
,--no-as-needed
3006 $(objpfx
)tst-dlclose-lazy-mod1.so
: $(objpfx
)tst-dlclose-lazy-mod2.so
3007 $(objpfx
)tst-dlclose-lazy.out
: \
3008 $(objpfx
)tst-dlclose-lazy-mod1.so
$(objpfx
)tst-dlclose-lazy-mod2.so
3010 $(objpfx
)tst-decorate-maps
: $(shared-thread-library
)
3012 tst-decorate-maps-ENV
= \
3013 GLIBC_TUNABLES
=glibc.malloc.arena_max
=8:glibc.malloc.mmap_threshold
=1024:glibc.mem.decorate_maps
=1
3014 tst-decorate-maps-ARGS
= 8
3016 LDFLAGS-tst-non-directory-mod.so
= -Wl
,-soname
,tst-non-directory-mod.so
3017 $(objpfx
)tst-non-directory-path
: $(objpfx
)tst-non-directory-mod.so
3018 $(objpfx
)tst-non-directory-path.out
: tst-non-directory-path.sh \
3019 $(objpfx
)tst-non-directory-path
3020 $(SHELL
) tst-non-directory-path.sh
$(objpfx
)ld.so
$(objpfx
)tst-non-directory-path \
3021 '$(test-wrapper-env)' '$(run_program_env)' \
3022 '$(rpath-link)' $(objpfx
) > $@
; \
3025 tst-env-setuid-ARGS
= -- $(host-test-program-cmd
)
3027 # Reuse a module with a SONAME, to specific as the LD_PROFILE.
3028 $(objpfx
)tst-env-setuid
: $(objpfx
)tst-sonamemove-runmod2.so
3029 $(objpfx
)tst-env-setuid-static.out
: $(objpfx
)tst-sonamemove-runmod1.so
3031 # The object tst-nodeps1-mod.so has no explicit dependencies on libc.so.
3032 # We do not use $(link-test-modules-rpath-link) since the object has no
3034 $(objpfx
)tst-nodeps1-mod.so
: $(objpfx
)tst-nodeps1-mod.os
3035 $(LINK.o
) -nostartfiles
-nostdlib
-shared
-o
$@
$^
3036 tst-nodeps1.so-no-z-defs
= yes
3037 # Link libc.so before the test module with the IFUNC resolver reference.
3038 LDFLAGS-tst-nodeps1
= $(common-objpfx
)libc.so
$(objpfx
)tst-nodeps1-mod.so
3039 $(objpfx
)tst-nodeps1
: $(objpfx
)tst-nodeps1-mod.so
3040 # Reuse the tst-nodeps1 module. Link libc.so before the test module
3041 # with the IFUNC resolver reference.
3042 $(objpfx
)tst-nodeps2-mod.so
: $(common-objpfx
)libc.so \
3043 $(objpfx
)tst-nodeps1-mod.so
$(objpfx
)tst-nodeps2-mod.os
3044 $(LINK.o
) -Wl
,--no-as-needed
-nostartfiles
-nostdlib
-shared
-o
$@
$^ \
3045 $(link-test-modules-rpath-link
)
3046 $(objpfx
)tst-nodeps2.out
: \
3047 $(objpfx
)tst-nodeps1-mod.so
$(objpfx
)tst-nodeps2-mod.so
3049 $(objpfx
)tst-tlsgap
: $(shared-thread-library
)
3050 $(objpfx
)tst-tlsgap.out
: \
3051 $(objpfx
)tst-tlsgap-mod0.so \
3052 $(objpfx
)tst-tlsgap-mod1.so \
3053 $(objpfx
)tst-tlsgap-mod2.so
3055 $(objpfx
)tst-gnu2-tls2
: $(shared-thread-library
)
3056 $(objpfx
)tst-gnu2-tls2.out
: \
3057 $(objpfx
)tst-gnu2-tls2mod0.so \
3058 $(objpfx
)tst-gnu2-tls2mod1.so \
3059 $(objpfx
)tst-gnu2-tls2mod2.so
3061 ifneq (no
,$(have-mtls-descriptor
))
3062 CFLAGS-tst-tlsgap-mod0.c
+= -mtls-dialect
=$(have-mtls-descriptor
)
3063 CFLAGS-tst-tlsgap-mod1.c
+= -mtls-dialect
=$(have-mtls-descriptor
)
3064 CFLAGS-tst-tlsgap-mod2.c
+= -mtls-dialect
=$(have-mtls-descriptor
)
3065 CFLAGS-tst-gnu2-tls2mod0.c
+= -mtls-dialect
=$(have-mtls-descriptor
)
3066 CFLAGS-tst-gnu2-tls2mod1.c
+= -mtls-dialect
=$(have-mtls-descriptor
)
3067 CFLAGS-tst-gnu2-tls2mod2.c
+= -mtls-dialect
=$(have-mtls-descriptor
)