1 # Copyright (C) 1995-2023 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
18 # Makefile for elf subdirectory of GNU C Library.
27 bits
/link_lavcurrent.h \
51 # The core dynamic linking functions are in libc for the static and
54 dl-call-libc-early-init \
81 dl-thread_gscope_wait \
90 ifeq (yes
,$(use-ldconfig
))
91 dl-routines
+= dl-cache
94 ifeq (yesyes
,$(build-shared
)$(run-built-tests
))
95 tests-special
+= $(objpfx
)list-tunables.out
98 # Make sure that the compiler does not insert any library calls in tunables
100 ifeq (yes
,$(have-loop-to-function
))
101 CFLAGS-dl-tunables.c
+= -fno-tree-loop-distribute-patterns
104 all-dl-routines
= $(dl-routines
) $(sysdep-dl-routines
)
105 # But they are absent from the shared libc, because that code is in ld.so.
106 elide-routines.os
= \
111 dl-reloc-static-pie \
119 # These object files are only included in the dynamically-linked libc.
120 shared-only-routines
= libc-dl_find_object
122 # ld.so uses those routines, plus some special stuff for being the program
123 # interpreter and operating independent of libc.
130 dl-diagnostics-kernel \
143 all-rtld-routines
= $(rtld-routines
) $(sysdep-rtld-routines
)
145 CFLAGS-dl-runtime.c
+= -fexceptions
-fasynchronous-unwind-tables
146 CFLAGS-dl-lookup.c
+= -fexceptions
-fasynchronous-unwind-tables
147 CFLAGS-dl-iteratephdr.c
+= $(uses-callbacks
)
149 # Called during static library initialization, so turn stack-protection
150 # off for non-shared builds.
151 CFLAGS-dl-minimal-malloc.o
= $(no-stack-protector
)
152 CFLAGS-dl-minimal-malloc.op
= $(no-stack-protector
)
154 # On targets without __builtin_memset, rtld.c uses a hand-coded loop
155 # in _dl_start. Make sure this isn't turned into a call to regular memset.
156 ifeq (yes
,$(have-loop-to-function
))
157 CFLAGS-rtld.c
+= -fno-tree-loop-distribute-patterns
160 # Compile rtld itself without stack protection.
161 # Also compile all routines in the static library that are elided from
162 # the shared libc because they are in libc.a in the same way.
164 CFLAGS-.o
+= $(call elide-stack-protector
,.o
,$(elide-routines.os
))
165 CFLAGS-.op
+= $(call elide-stack-protector
,.op
,$(elide-routines.os
))
166 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,$(all-rtld-routines
))
168 # Add the requested compiler flags to the early startup code.
169 CFLAGS-dl-printf.os
+= $(rtld-early-cflags
)
170 CFLAGS-dl-setup_hash.os
+= $(rtld-early-cflags
)
171 CFLAGS-dl-sysdep.os
+= $(rtld-early-cflags
)
172 CFLAGS-dl-tunables.os
+= $(rtld-early-cflags
)
173 CFLAGS-dl-write.os
+= $(rtld-early-cflags
)
174 CFLAGS-dl-writev.os
+= $(rtld-early-cflags
)
175 CFLAGS-rtld.os
+= $(rtld-early-cflags
)
177 ifeq ($(unwind-find-fde
),yes
)
178 routines
+= unwind-dw2-fde-glibc
179 shared-only-routines
+= unwind-dw2-fde-glibc
182 before-compile
+= $(objpfx
)trusted-dirs.h
183 generated
+= trusted-dirs.h trusted-dirs.st for-renamed
/renamed.so
184 generated-dirs
+= for-renamed
186 ifeq ($(build-shared
),yes
)
187 ld-map
= $(common-objpfx
)ld.map
190 ifeq (yes
,$(build-shared
))
192 $(all-rtld-routines
:%=%.os
) \
201 install-others
= $(inst_rtlddir
)/$(rtld-installed-name
) $(inst_bindir
)/ld.so
202 install-bin-script
= ldd
208 install-rootsbin
= sln
209 sln-modules
:= static-stubs
210 extra-objs
+= $(sln-modules
:=.o
)
212 ifeq (yes
,$(use-ldconfig
))
213 ifeq (yes
,$(build-shared
))
214 others-static
+= ldconfig
216 install-rootsbin
+= ldconfig
218 ldconfig-modules
:= \
227 extra-objs
+= $(ldconfig-modules
:=.o
)
228 others-extras
= $(ldconfig-modules
)
232 # To find xmalloc.c and xstrdup.c
233 vpath
%.c ..
/locale
/programs
235 ifeq ($(build-shared
),yes
)
236 extra-objs
+= sotruss-lib.os sotruss-lib.so
237 install-others
+= $(inst_auditdir
)/sotruss-lib.so
238 install-bin-script
+= sotruss
240 libof-sotruss-lib
= extramodules
241 LDFLAGS-sotruss-lib.so
+= $(z-now-
$(bind-now
))
242 $(objpfx
)sotruss-lib.so
: $(objpfx
)sotruss-lib.os
243 $(build-module-asneeded
)
244 $(objpfx
)sotruss-lib.so
: $(common-objpfx
)libc.so
$(objpfx
)ld.so \
245 $(common-objpfx
)libc_nonshared.a
247 $(objpfx
)sotruss
: sotruss.sh
$(common-objpfx
)config.make
248 sed
-e
's%@VERSION@%$(version)%g' \
249 -e
's%@TEXTDOMAINDIR@%$(localedir)%g' \
250 -e
's%@PREFIX@%$(prefix)%g' \
251 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
252 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
256 $(inst_auditdir
)/sotruss-lib.so
: $(objpfx
)sotruss-lib.so
$(+force)
257 $(do-install-program
)
260 tests-static-normal
:= \
266 tst-env-setuid-tunables \
267 tst-getauxval-static \
269 tst-single_threaded-pthread-static \
270 tst-single_threaded-static \
271 tst-tls-allocation-failure-static \
272 tst-tlsalign-extern-static \
273 tst-tlsalign-static \
274 # tests-static-normal
276 tests-static-internal
:= \
277 tst-dl-printf-static \
278 tst-dl_find_object-static \
279 tst-ptrguard1-static \
280 tst-stackguard1-static \
282 tst-tls1-static-non-pie \
283 # tests-static-internal
285 CRT-tst-tls1-static-non-pie
:= $(csu-objpfx
)crt1.o
286 tst-tls1-static-non-pie-no-pie
= yes
289 tst-ldconfig-bad-aux-cache \
290 tst-ldconfig-ld_so_conf-update \
293 ifeq (no
,$(build-hardcoded-path-in-tests
))
294 # This is an ld.so.cache test, and RPATH/RUNPATH in the executable
295 # interferes with its test objectives.
296 tests-container
+= tst-glibc-hwcaps-prepend-cache
313 $(tests-static-internal
) \
317 tests-static
:= $(tests-static-normal
) $(tests-static-internal
)
319 ifeq (yes
,$(build-shared
))
321 tst-single_threaded-static-dlopen \
325 static-dlopen-environment
= \
326 LD_LIBRARY_PATH
=$(ld-library-path
):$(common-objpfx
)dlfcn
327 tst-tls9-static-ENV
= $(static-dlopen-environment
)
328 tst-single_threaded-static-dlopen-ENV
= $(static-dlopen-environment
)
329 tst-rootdir-ENV
= LD_LIBRARY_PATH
=/
370 tst-audit-tlsdesc-dlopen \
401 tst-dlmopen-dlerror \
402 tst-dlmopen-gethostbyname \
408 tst-dlopen-tlsmodid \
414 tst-filterobj-dlopen \
416 tst-glibc-hwcaps-mask \
417 tst-glibc-hwcaps-prepend \
420 tst-initfinilazyfail \
426 tst-nodelete-dlclose \
427 tst-nodelete-opened \
436 tst-rtld-run-static \
437 tst-single_threaded \
438 tst-single_threaded-pthread \
439 tst-sonamemove-dlopen \
440 tst-sonamemove-link \
445 tst-tls-manydynamic \
461 tst-tlsalign-extern \
475 tst-dlopen-nodelete-reloc \
481 tests
+= $(if
$(CXX
),$(tests-cxx
))
492 tst-dl-hwcaps_split \
494 tst-dl_find_object-threads \
508 tst-dlopen-self-container \
509 tst-dlopen-tlsmodid-container \
511 tst-preload-pthread-libc \
520 ifeq (yes
,$(have-fpie
))
521 tests-pie
+= tst-align3
523 selinux-enabled
:= $(shell cat
/selinux
/enforce
2> /dev
/null
)
525 ifneq ($(selinux-enabled
),1)
526 tests-execstack-yes
= \
528 tst-execstack-needed \
530 # tests-execstack-yes
532 ifeq ($(have-depaudit
),yes
)
539 ifeq ($(run-built-tests
),yes
)
541 $(objpfx
)tst-audit14-cmp.out \
542 $(objpfx
)tst-audit14a-cmp.out \
543 $(objpfx
)tst-audit15-cmp.out \
544 $(objpfx
)tst-audit16-cmp.out \
548 ifeq ($(have-dt-relr
),yes
)
555 modules-names-dt-relr
= \
561 # modules-names-dt-relr
562 modules-names
+= $(modules-names-dt-relr
)
563 # These shared libraries have special build rules.
564 modules-names-nobuild
+= $(modules-names-dt-relr
)
565 ifeq ($(have-fpie
),yes
)
573 $(objpfx
)check-tst-relr-pie.out \
576 CFLAGS-tst-relr-pie.c
+= $(pie-ccflag
)
577 LDFLAGS-tst-relr
+= -Wl
,-z
,pack-relative-relocs
578 LDFLAGS-tst-relr-pie
+= -Wl
,-z
,pack-relative-relocs
579 CFLAGS-tst-relr-mod2.c
+= $(no-stack-protector
)
580 CFLAGS-tst-relr-mod3a.c
+= $(no-stack-protector
)
581 CFLAGS-tst-relr-mod3b.c
+= $(no-stack-protector
)
582 CFLAGS-tst-relr-mod4a.c
+= $(no-stack-protector
)
583 CFLAGS-tst-relr-mod4b.c
+= $(no-stack-protector
)
587 tests-special
+= $(objpfx
)tst-relro-ldso.out
$(objpfx
)tst-relro-libc.out
588 $(objpfx
)tst-relro-ldso.out
: tst-relro-symbols.py
$(..
)/scripts
/glibcelf.py \
590 $(PYTHON
) tst-relro-symbols.py
$(objpfx
)ld.so \
591 --required
=_rtld_global_ro \
592 > $@
2>&1; $(evaluate-test
)
593 # The optional symbols are present in libc only if the architecture has
594 # the GLIBC_2.0 symbol set in libc.
595 $(objpfx
)tst-relro-libc.out
: tst-relro-symbols.py
$(..
)/scripts
/glibcelf.py \
596 $(common-objpfx
)libc.so
597 $(PYTHON
) tst-relro-symbols.py
$(common-objpfx
)libc.so \
598 --required
=_IO_file_jumps \
599 --required
=_IO_wfile_jumps \
600 --required
=__io_vtables \
601 > $@
2>&1; $(evaluate-test
)
603 ifeq ($(run-built-tests
),yes
)
604 tests-special
+= $(objpfx
)tst-valgrind-smoke.out
606 $(objpfx
)tst-valgrind-smoke.out
: tst-valgrind-smoke.sh
$(objpfx
)ld.so
$(objpfx
)valgrind-test
607 $(SHELL
) $< $(objpfx
)ld.so
$(rtlddir
)/$(rtld-installed-name
) '$(test-wrapper-env)' \
608 '$(run-program-env)' '$(rpath-link)' $(objpfx
)valgrind-test
> $@
; $(evaluate-test
)
610 tests
+= $(tests-execstack-
$(have-z-execstack
))
611 ifeq ($(run-built-tests
),yes
)
613 $(objpfx
)noload-mem.out \
614 $(objpfx
)tst-ldconfig-X.out \
615 $(objpfx
)tst-ldconfig-p.out \
616 $(objpfx
)tst-ldconfig-soname.out \
617 $(objpfx
)tst-leaks1-mem.out \
618 $(objpfx
)tst-rtld-help.out \
621 tlsmod17a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
622 tlsmod18a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
623 tlsmod17a-modules
= $(addprefix tst-tlsmod17a
, $(tlsmod17a-suffixes
))
624 tlsmod18a-modules
= $(addprefix tst-tlsmod18a
, $(tlsmod17a-suffixes
))
625 one-hundred
= $(foreach x
,0 1 2 3 4 5 6 7 8 9, \
626 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
627 tst-tls-many-dynamic-modules
:= \
628 $(foreach n
,$(one-hundred
),tst-tls-manydynamic
$(n
)mod
)
629 tst-tls-many-dynamic-modules-dep-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 \
631 tst-tls-many-dynamic-modules-dep
= \
632 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-suffixes
),tst-tls-manydynamic
$(n
)mod-dep
)
633 tst-tls-many-dynamic-modules-dep-bad-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
634 tst-tls-many-dynamic-modules-dep-bad
= \
635 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-bad-suffixes
),tst-tls-manydynamic
$(n
)mod-dep-bad
)
637 $(tlsmod17a-modules
:=.os
) \
638 $(tlsmod18a-modules
:=.os
) \
639 tst-tlsalign-vars.o \
744 tst-absolute-sym-lib \
745 tst-absolute-zero-lib \
751 tst-audit-tlsdesc-mod1 \
752 tst-audit-tlsdesc-mod2 \
786 tst-auditmod-tlsdesc \
811 tst-dl_find_object-mod1 \
812 tst-dl_find_object-mod2 \
813 tst-dl_find_object-mod3 \
814 tst-dl_find_object-mod4 \
815 tst-dl_find_object-mod5 \
816 tst-dl_find_object-mod6 \
817 tst-dl_find_object-mod7 \
818 tst-dl_find_object-mod8 \
819 tst-dl_find_object-mod9 \
820 tst-dlclose-lazy-mod1 \
821 tst-dlclose-lazy-mod2 \
822 tst-dlmopen-dlerror-mod \
823 tst-dlmopen-gethostbyname-mod \
824 tst-dlmopen-twice-mod1 \
825 tst-dlmopen-twice-mod2 \
827 tst-dlopenfaillinkmod \
831 tst-dlopenfailnodelmod \
834 tst-filterobj-filtee \
836 tst-finilazyfailmod \
838 tst-initlazyfailmod \
850 tst-ldconfig-ld-mod \
851 tst-ldconfig-soname-lib-with-soname \
852 tst-ldconfig-soname-lib-without-soname \
854 tst-nodelete-dlclose-dso \
855 tst-nodelete-dlclose-plugin \
856 tst-nodelete-opened-lib \
859 tst-p_alignmod-base \
865 tst-single_threaded-mod1 \
866 tst-single_threaded-mod2 \
867 tst-single_threaded-mod3 \
868 tst-single_threaded-mod4 \
869 tst-sonamemove-linkmod1 \
870 tst-sonamemove-runmod1 \
871 tst-sonamemove-runmod2 \
911 tst-unwind-ctor-lib \
937 modules-names-cxx
= \
938 tst-dlopen-nodelete-reloc-mod1 \
939 tst-dlopen-nodelete-reloc-mod2 \
940 tst-dlopen-nodelete-reloc-mod3 \
941 tst-dlopen-nodelete-reloc-mod4 \
942 tst-dlopen-nodelete-reloc-mod5 \
943 tst-dlopen-nodelete-reloc-mod6 \
944 tst-dlopen-nodelete-reloc-mod7 \
945 tst-dlopen-nodelete-reloc-mod8 \
946 tst-dlopen-nodelete-reloc-mod9 \
947 tst-dlopen-nodelete-reloc-mod10 \
948 tst-dlopen-nodelete-reloc-mod11 \
949 tst-dlopen-nodelete-reloc-mod12 \
950 tst-dlopen-nodelete-reloc-mod13 \
951 tst-dlopen-nodelete-reloc-mod14 \
952 tst-dlopen-nodelete-reloc-mod15 \
953 tst-dlopen-nodelete-reloc-mod16 \
954 tst-dlopen-nodelete-reloc-mod17 \
955 tst-nodelete-rtldmod \
956 tst-nodelete-uniquemod \
964 $(if
$(CXX
),$(modules-names-cxx
)) \
965 $(modules-execstack-
$(have-z-execstack
)) \
966 $(tlsmod17a-modules
) \
967 $(tlsmod18a-modules
) \
968 $(tst-tls-many-dynamic-modules
) \
969 $(tst-tls-many-dynamic-modules-dep
) \
970 $(tst-tls-many-dynamic-modules-dep-bad
) \
973 # Most modules build with _ISOMAC defined, but those filtered out
974 # depend on internal headers.
975 modules-names-tests
= $(filter-out ifuncmod
% tst-tlsmod
%,\
978 # For +depfiles in Makerules.
979 extra-test-objs
+= tst-auditmod17.os
981 ifeq (yes
,$(have-mtls-dialect-gnu2
))
982 tests
+= tst-gnu2-tls1
983 modules-names
+= tst-gnu2-tls1mod
984 $(objpfx
)tst-gnu2-tls1
: $(objpfx
)tst-gnu2-tls1mod.so
985 tst-gnu2-tls1mod.so-no-z-defs
= yes
986 CFLAGS-tst-gnu2-tls1mod.c
+= -mtls-dialect
=gnu2
987 endif # $(have-mtls-dialect-gnu2)
989 ifeq (yes
,$(have-protected-data
))
990 modules-names
+= tst-protected1moda tst-protected1modb
991 tests
+= tst-protected1a tst-protected1b
992 $(objpfx
)tst-protected1a
: $(addprefix $(objpfx
),tst-protected1moda.so tst-protected1modb.so
)
993 $(objpfx
)tst-protected1b
: $(addprefix $(objpfx
),tst-protected1modb.so tst-protected1moda.so
)
994 tst-protected1modb.so-no-z-defs
= yes
995 # These tests fail with GCC versions prior to 5.1 and with some versions
996 # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
997 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
998 # Perhaps in future we can make these XFAILs conditional on some detection
999 # of compiler/linker behavior/version.
1000 test-xfail-tst-protected1a
= yes
1001 test-xfail-tst-protected1b
= yes
1003 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1004 modules-names
+= tst-piemod1
1005 tests
+= tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \
1007 tests-pie
+= tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie
1008 ifeq (yes
,$(have-protected-data
))
1010 tests-pie
+= vismain
1011 CFLAGS-vismain.c
+= $(PIE-ccflag
)
1014 modules-execstack-yes
= tst-execstack-mod
1015 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
1017 # filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special
1019 modules-names-nobuild
+= \
1024 tst-ro-dynamic-mod \
1025 # modules-names-nobuild
1027 tests
+= $(tests-static
)
1029 ifeq (yes
,$(have-ifunc
))
1030 tests-ifuncstatic
:= \
1031 ifuncmain1picstatic \
1033 ifuncmain2picstatic \
1035 ifuncmain4picstatic \
1037 ifuncmain5picstatic \
1039 ifuncmain7picstatic \
1042 ifeq (yes
,$(have-gcc-ifunc
))
1043 tests-ifuncstatic
+= ifuncmain9static ifuncmain9picstatic
1045 tests-static
+= $(tests-ifuncstatic
)
1046 tests-internal
+= $(tests-ifuncstatic
)
1047 ifeq (yes
,$(build-shared
))
1049 tst-ifunc-fault-bindnow \
1050 tst-ifunc-fault-lazy \
1052 # Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8.
1055 ifuncmain1staticpic \
1062 ifuncmain5staticpic \
1066 ifeq (no
,$(with-lld
))
1073 ifeq (yes
,$(have-gcc-ifunc
))
1079 ifunc-test-modules
= \
1086 # ifunc-test-modules
1087 extra-test-objs
+= $(ifunc-test-modules
:=.o
)
1088 test-internal-extras
+= $(ifunc-test-modules
)
1089 ifeq (yes
,$(have-fpie
))
1092 ifuncmain1staticpie \
1097 ifeq (yes
,$(have-gcc-ifunc
))
1098 ifunc-pie-tests
+= ifuncmain9pie
1100 ifeq (no
,$(with-lld
))
1101 ifunc-pie-tests
+= ifuncmain5pie
1103 ifeq (yes
,$(have-textrel_ifunc
))
1104 ifunc-pie-tests
+= tst-ifunc-textrel
1106 tests-internal
+= $(ifunc-pie-tests
)
1107 tests-pie
+= $(ifunc-pie-tests
)
1114 ifeq (no
,$(with-lld
))
1115 modules-names
+= ifuncmod5
1120 ifeq (yes
,$(build-shared
))
1121 ifeq ($(run-built-tests
),yes
)
1123 $(objpfx
)argv0test.out \
1124 $(objpfx
)tst-pathopt.out \
1125 $(objpfx
)tst-rtld-help.out \
1126 $(objpfx
)tst-rtld-list-diagnostics.out \
1127 $(objpfx
)tst-rtld-load-self.out \
1128 $(objpfx
)tst-rtld-preload.out \
1129 $(objpfx
)tst-sprof-basic.out \
1133 $(objpfx
)check-execstack.out \
1134 $(objpfx
)check-initfini.out \
1135 $(objpfx
)check-localplt.out \
1136 $(objpfx
)check-textrel.out \
1137 $(objpfx
)check-wx-segment.out \
1141 ifeq ($(run-built-tests
),yes
)
1143 $(objpfx
)order-cmp.out \
1144 $(objpfx
)order2-cmp.out \
1145 $(objpfx
)tst-array1-cmp.out \
1146 $(objpfx
)tst-array1-static-cmp.out \
1147 $(objpfx
)tst-array2-cmp.out \
1148 $(objpfx
)tst-array3-cmp.out \
1149 $(objpfx
)tst-array4-cmp.out \
1150 $(objpfx
)tst-array5-cmp.out \
1151 $(objpfx
)tst-array5-static-cmp.out \
1152 $(objpfx
)tst-initorder-cmp.out \
1153 $(objpfx
)tst-initorder2-cmp.out \
1154 $(objpfx
)tst-trace1.out \
1155 $(objpfx
)tst-trace2.out \
1156 $(objpfx
)tst-trace3.out \
1157 $(objpfx
)tst-trace4.out \
1158 $(objpfx
)tst-trace5.out \
1159 $(objpfx
)tst-unused-dep-cmp.out \
1160 $(objpfx
)tst-unused-dep.out \
1164 ifndef avoid-generated
1165 # DSO sorting tests:
1166 # The dso-ordering-test.py script generates testcase source files in $(objpfx),
1167 # creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a
1168 # Makefile fragment to be included.
1169 define include_dsosort_tests
1170 $(objpfx
)$(1).generated-makefile
: $(1)
1171 $(PYTHON
) $(..
)scripts
/dso-ordering-test.py \
1172 --description-file
$$< --objpfx
$(objpfx
) --output-makefile
$$@T
1174 -include $(objpfx
)$(1).generated-makefile
1178 postclean-generated
+= $(objpfx
)/dso-sort-tests-2.generated-makefile \
1179 $(objpfx
)/dso-sort-tests-2.generated-makefile
1181 # Generate from each testcase description file
1182 $(eval
$(call include_dsosort_tests
,dso-sort-tests-1.def
))
1183 $(eval
$(call include_dsosort_tests
,dso-sort-tests-2.def
))
1185 # BZ15311 is intentionally underlinked.
1186 LDFLAGS-tst-bz15311-b.so
+= -Wl
,-z
,lazy
1187 LDFLAGS-tst-bz15311-c.so
+= -Wl
,-z
,lazy
1188 LDFLAGS-tst-bz15311-d.so
+= -Wl
,-z
,lazy
1190 check-abi
: $(objpfx
)check-abi-ld.out \
1191 $(objpfx
)check-abi-version-libc.out
1193 $(objpfx
)check-abi-ld.out \
1194 $(objpfx
)check-abi-version-libc.out \
1196 update-abi
: update-abi-ld
1197 update-all-abi
: update-all-abi-ld
1199 tests-special
+= $(objpfx
)tst-glibcelf.out
1200 $(objpfx
)tst-glibcelf.out
: tst-glibcelf.py elf.h
$(..
)/scripts
/glibcelf.py \
1201 $(..
)/scripts
/glibcextract.py
1202 PYTHONPATH
=$(..
)scripts
$(PYTHON
) tst-glibcelf.py \
1203 --cc="$(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS))" \
1204 < /dev
/null
> $@
2>&1; $(evaluate-test
)
1206 ifeq ($(run-built-tests
),yes
)
1207 tests-special
+= $(objpfx
)tst-tls-allocation-failure-static-patched.out
1210 # The test requires shared _and_ PIE because the executable
1211 # unit test driver must be able to link with the shared object
1212 # that is going to eventually go into an installed DSO.
1213 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1214 tests-internal
+= tst-_dl_addr_inside_object
1215 tests-pie
+= tst-_dl_addr_inside_object
1216 $(objpfx
)tst-_dl_addr_inside_object
: $(objpfx
)dl-addr-obj.os
1217 CFLAGS-tst-_dl_addr_inside_object.c
+= $(PIE-ccflag
)
1222 ifeq (yes
,$(build-shared
))
1223 # Make sure these things are built in the `make lib' pass so they can be used
1224 # to run programs during the `make others' pass.
1225 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
1226 $(addprefix $(objpfx
),$(extra-objs
))
1229 # Command to link into a larger single relocatable object.
1230 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
1232 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
1233 $(reloc-link
) -o
$@
$^
1235 # Link together the dynamic linker into a single relocatable object.
1236 # First we do a link against libc_pic.a just to get a link map,
1237 # and discard the object produced by that link. From the link map
1238 # we can glean all the libc modules that need to go into the dynamic
1239 # linker. Then we do a recursive make that goes into all the subdirs
1240 # those modules come from and builds special rtld-foo.os versions that
1241 # are compiled with special flags, and puts these modules into rtld-libc.a
1242 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
1244 # These symbols need to be stubbed out during symbol discovery because
1245 # their implementation is provided differently in rtld, and the symbol
1246 # discovery mechanism is not compatible with the libc implementation
1247 # when compiled for libc.
1248 rtld-stubbed-symbols
= \
1249 __GI___pthread_disable_asynccancel \
1250 __GI___pthread_enable_asynccancel \
1251 __libc_assert_fail \
1252 __pthread_disable_asynccancel \
1253 __pthread_enable_asynccancel \
1258 # rtld-stubbed-symbols
1260 ifeq ($(have-ssp
),yes
)
1261 # rtld is not built with the stack protector, so these references will
1262 # go away in the rebuilds.
1263 rtld-stubbed-symbols
+= __stack_chk_fail __stack_chk_fail_local
1266 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
1268 for symbol in
$(rtld-stubbed-symbols
); do \
1269 echo
".globl $$symbol"; \
1271 done |
$(CC
) -o
$@T.o
$(ASFLAGS
) -c
-x assembler
-
1272 $(reloc-link
) -o
$@.o
$@T.o
'-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
1276 # For lld, skip preceding addresses and values before matching the archive and the member.
1277 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
1279 sed
-n
's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
1281 while read lib file
; do \
1284 LC_ALL
=C grep
-F
-l
/$$file \
1285 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
1287 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
1290 echo rtld-
$${lib
%%/*} += $$file ;; \
1291 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
1294 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
1295 | LC_ALL=C sort -u` >> $@T
1298 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
1299 $(MAKE
) -f
$< -f rtld-Rules
1301 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
1302 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
1305 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
1307 z-now-yes
= -Wl
,-z
,now
1309 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
1310 # Link into a temporary file so that we don't touch $@ at all
1311 # if the sanity check below fails.
1312 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
1313 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
1315 $(filter-out $(map-file
),$^
) $(load-map-file
) \
1316 -Wl
,-soname
=$(rtld-installed-name
)
1317 $(call after-link
,$@.new
)
1318 $(READELF
) -s
$@.new \
1319 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
1322 ifeq (yes
,$(build-shared
))
1323 # interp.c exists just to get the runtime linker path into libc.so.
1324 $(objpfx
)interp.os
: $(common-objpfx
)runtime-linker.h
1327 ifneq (ld.so
,$(rtld-installed-name
))
1328 # Make sure ld.so.1 exists in the build directory so we can link
1330 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
1332 generated
+= $(rtld-installed-name
)
1335 # Build a file mentioning all trustworthy directories to look for shared
1336 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
1337 # add directories to the list by defining $(user-defined-trusted-dirs)
1338 # before starting make.
1339 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
1340 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
1341 $(make-target-directory
)
1342 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
1343 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
1344 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
1345 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
1347 CPPFLAGS-dl-load.c
+= -I
$(objpfx
).
-I
$(csu-objpfx
).
1349 ifeq (yes
,$(build-shared
))
1350 $(inst_rtlddir
)/$(rtld-installed-name
): $(objpfx
)ld.so
$(+force)
1351 $(make-target-directory
)
1352 $(do-install-program
)
1354 # Creates the relative /usr/bin/ld.so symbolic link.
1355 $(inst_bindir
)/ld.so
: $(inst_rtlddir
)/$(rtld-installed-name
)
1356 $(make-target-directory
)
1359 # Special target called by parent to install just the dynamic linker.
1360 .PHONY
: ldso_install
1361 ldso_install
: $(inst_rtlddir
)/$(rtld-installed-name
)
1362 endif # $(build-shared)
1365 # Workarounds for ${exec_prefix} expansion in configure variables.
1366 # config.status cannot be used directly for processing ldd.bash.in or
1367 # expanding variables such as sysconfdir because the expansion
1368 # contains the literal string ${exec_prefix}, which is not valid in C
1369 # headers or installed shell scripts.
1371 ldd-rewrite
= -e
's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
1372 -e
's%@VERSION@%$(version)%g' \
1373 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
1374 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
1375 -e
's%@TEXTDOMAINDIR@%$(localedir)%g'
1377 ifeq ($(ldd-rewrite-script
),no
)
1379 LC_ALL
=C sed
$(ldd-rewrite
) < $< > $@.new
1383 LC_ALL
=C sed
$(ldd-rewrite
) < $< \
1384 | LC_ALL
=C sed
-f
$(patsubst $(..
)/%,/%,$(..
)$(ldd-rewrite-script
)) > $@.new
1388 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
1389 $(common-objpfx
)config.make
1394 $(objpfx
)sln
: $(sln-modules
:%=$(objpfx
)%.o
)
1396 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
1398 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
1399 CFLAGS-ldconfig.c
+= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
1400 -D
'SLIBDIR="$(slibdir)"'
1401 libof-ldconfig
= ldconfig
1402 CFLAGS-dl-cache.c
+= $(SYSCONF-FLAGS
)
1403 CFLAGS-cache.c
+= $(SYSCONF-FLAGS
)
1404 CFLAGS-rtld.c
+= $(SYSCONF-FLAGS
)
1405 CFLAGS-dl-usage.c
+= $(SYSCONF-FLAGS
) \
1406 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1407 CFLAGS-dl-diagnostics.c
+= $(SYSCONF-FLAGS
) \
1408 -D
'PREFIX="$(prefix)"' \
1409 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1411 cpp-srcs-left
:= $(all-rtld-routines
:=.os
)
1413 include $(patsubst %,$(..
)libof-iterator.mk
,$(cpp-srcs-left
))
1415 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
1416 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
1418 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
1419 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
1420 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
1421 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
1422 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
1423 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
1424 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
1425 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
1426 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
1427 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
1428 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1429 $(objpfx
)neededobj3.so
1430 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
1431 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
1432 $(objpfx
)firstobj.so
: $(shared-thread-library
)
1433 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
1434 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
1435 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
1436 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
1437 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
1438 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
1439 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
1440 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
1441 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
1442 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
1443 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
1444 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
1445 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
1446 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
1447 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
1448 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
1449 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
1450 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
1451 $(objpfx
)tst-tls19mod1.so
: $(objpfx
)tst-tls19mod2.so
$(objpfx
)tst-tls19mod3.so
1452 $(objpfx
)tst-tls19mod3.so
: $(objpfx
)ld.so
1453 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
1454 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
1455 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
1456 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
1457 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
1458 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
1459 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
1460 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
1461 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
1462 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
1463 $(objpfx
)unload8mod1.so
: $(objpfx
)unload8mod2.so
1464 $(objpfx
)unload8mod2.so
: $(objpfx
)unload8mod3.so
1465 $(objpfx
)tst-initordera2.so
: $(objpfx
)tst-initordera1.so
1466 $(objpfx
)tst-initorderb2.so
: $(objpfx
)tst-initorderb1.so
$(objpfx
)tst-initordera2.so
1467 $(objpfx
)tst-initordera3.so
: $(objpfx
)tst-initorderb2.so
$(objpfx
)tst-initorderb1.so
1468 $(objpfx
)tst-initordera4.so
: $(objpfx
)tst-initordera3.so
1469 $(objpfx
)tst-initorder
: $(objpfx
)tst-initordera4.so
$(objpfx
)tst-initordera1.so
$(objpfx
)tst-initorderb2.so
1470 $(objpfx
)tst-null-argv
: $(objpfx
)tst-null-argv-lib.so
1471 $(objpfx
)tst-tlsalign
: $(objpfx
)tst-tlsalign-lib.so
1472 $(objpfx
)tst-nodelete-opened.out
: $(objpfx
)tst-nodelete-opened-lib.so
1474 $(objpfx
)tst-tlsalign-extern
: $(objpfx
)tst-tlsalign-vars.o
1475 $(objpfx
)tst-tlsalign-extern-static
: $(objpfx
)tst-tlsalign-vars.o
1477 tst-null-argv-ENV
= LD_DEBUG
=all LD_DEBUG_OUTPUT
=$(objpfx
)tst-null-argv.debug.out
1478 LDFLAGS-nodel2mod3.so
= -Wl
,--no-as-needed
1479 LDFLAGS-reldepmod5.so
= -Wl
,--no-as-needed
1480 LDFLAGS-reldep6mod1.so
= -Wl
,--no-as-needed
1481 LDFLAGS-reldep6mod4.so
= -Wl
,--no-as-needed
1482 LDFLAGS-reldep8mod3.so
= -Wl
,--no-as-needed
1483 LDFLAGS-unload4mod1.so
= -Wl
,--no-as-needed
1484 LDFLAGS-unload4mod2.so
= -Wl
,--no-as-needed
1485 LDFLAGS-tst-initorder
= -Wl
,--no-as-needed
1486 LDFLAGS-tst-initordera2.so
= -Wl
,--no-as-needed
1487 LDFLAGS-tst-initordera3.so
= -Wl
,--no-as-needed
1488 LDFLAGS-tst-initordera4.so
= -Wl
,--no-as-needed
1489 LDFLAGS-tst-initorderb2.so
= -Wl
,--no-as-needed
1490 LDFLAGS-tst-tlsmod5.so
= -nostdlib
-Wl
,--no-as-needed
1491 LDFLAGS-tst-tlsmod6.so
= -nostdlib
-Wl
,--no-as-needed
1493 # The following tests are underlinked, and rely on late loading. On toolchains
1494 # that set -z now by default, this leads to failures to load or fix up the
1495 # executables being tested.
1496 LDFLAGS-circlemod2.so
= -Wl
,-z
,lazy
1497 LDFLAGS-tst-tls20mod-bad.so
= -Wl
,-z
,lazy
1498 LDFLAGS-reldep6mod1.so
+= -Wl
,-z
,lazy
1499 LDFLAGS-constload2.so
= -Wl
,-z
,lazy
1500 LDFLAGS-constload3.so
= -Wl
,-z
,lazy
1501 LDFLAGS-dblloadmod3.so
= -Wl
,-z
,lazy
1502 LDFLAGS-ifuncmod6.so
= -Wl
,-z
,lazy
1503 LDFLAGS-ltglobmod2.so
= -Wl
,-z
,lazy
1504 LDFLAGS-testobj1.so
= -Wl
,-z
,lazy
1505 LDFLAGS-testobj6.so
= -Wl
,-z
,lazy
1507 testobj1.so-no-z-defs
= yes
1508 testobj3.so-no-z-defs
= yes
1509 testobj4.so-no-z-defs
= yes
1510 testobj5.so-no-z-defs
= yes
1511 testobj6.so-no-z-defs
= yes
1512 failobj.so-no-z-defs
= yes
1513 constload2.so-no-z-defs
= yes
1514 constload3.so-no-z-defs
= yes
1515 nodelmod1.so-no-z-defs
= yes
1516 nodelmod2.so-no-z-defs
= yes
1517 nodelmod4.so-no-z-defs
= yes
1518 nodel2mod2.so-no-z-defs
= yes
1519 reldepmod2.so-no-z-defs
= yes
1520 reldepmod3.so-no-z-defs
= yes
1521 reldepmod4.so-no-z-defs
= yes
1522 reldep4mod4.so-no-z-defs
= yes
1523 reldep4mod2.so-no-z-defs
= yes
1524 ltglobmod2.so-no-z-defs
= yes
1525 dblloadmod3.so-no-z-defs
= yes
1526 tst-tlsmod1.so-no-z-defs
= yes
1527 tst-tlsmod2.so-no-z-defs
= yes
1528 tst-tlsmod3.so-no-z-defs
= yes
1529 tst-tlsmod4.so-no-z-defs
= yes
1530 tst-tlsmod7.so-no-z-defs
= yes
1531 tst-tlsmod8.so-no-z-defs
= yes
1532 tst-tlsmod9.so-no-z-defs
= yes
1533 tst-tlsmod10.so-no-z-defs
= yes
1534 tst-tlsmod12.so-no-z-defs
= yes
1535 tst-tlsmod14a.so-no-z-defs
= yes
1536 tst-tlsmod14b.so-no-z-defs
= yes
1537 tst-tlsmod15a.so-no-z-defs
= yes
1538 tst-tlsmod16b.so-no-z-defs
= yes
1539 circlemod2.so-no-z-defs
= yes
1540 circlemod3.so-no-z-defs
= yes
1541 circlemod3a.so-no-z-defs
= yes
1542 reldep8mod2.so-no-z-defs
= yes
1543 reldep9mod1.so-no-z-defs
= yes
1544 unload3mod4.so-no-z-defs
= yes
1545 unload4mod1.so-no-z-defs
= yes
1546 ifuncmod1.so-no-z-defs
= yes
1547 ifuncmod5.so-no-z-defs
= yes
1548 ifuncmod6.so-no-z-defs
= yes
1549 tst-auditmod9a.so-no-z-defs
= yes
1550 tst-auditmod9b.so-no-z-defs
= yes
1551 tst-nodelete-uniquemod.so-no-z-defs
= yes
1552 tst-nodelete-rtldmod.so-no-z-defs
= yes
1553 tst-nodelete-zmod.so-no-z-defs
= yes
1554 tst-nodelete2mod.so-no-z-defs
= yes
1556 ifeq ($(build-shared
),yes
)
1557 # Build all the modules even when not actually running test programs.
1558 tests
: $(test-modules
)
1561 LDFLAGS-loadtest
= -rdynamic
1563 $(objpfx
)loadtest.out
: $(test-modules
)
1565 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1566 $(objpfx
)neededobj3.so
1568 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1569 $(objpfx
)neededobj3.so
1571 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1572 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
1574 $(objpfx
)neededtest4
: $(objpfx
)neededobj1.so
1575 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
1577 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
1578 LDFLAGS-restest1
= -rdynamic
1580 LDFLAGS-restest2
= -rdynamic
1582 $(objpfx
)restest1.out
: $(test-modules
)
1584 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
1585 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
1586 LDFLAGS-preloadtest
= -rdynamic
1587 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1589 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1591 LDFLAGS-loadfail
= -rdynamic
1593 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
$(objpfx
)testobj1.so \
1594 $(objpfx
)testobj2.so
$(objpfx
)testobj3.so \
1595 $(objpfx
)testobj4.so
$(objpfx
)testobj5.so
1597 LDFLAGS-multiload
= -rdynamic
1598 CFLAGS-multiload.c
+= -DOBJDIR
=\"$(elf-objpfx
)\"
1600 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
1602 LDFLAGS-origtest
= -rdynamic
1603 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
1605 $(objpfx
)resolvfail.out
: $(objpfx
)testobj1.so
1606 ifeq ($(have-thread-library
),yes
)
1607 $(objpfx
)resolvfail
: $(shared-thread-library
)
1610 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
1612 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
1613 $(objpfx
)circlemod1a.so
1615 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
1616 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
1617 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
1618 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
1620 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
1622 $(objpfx
)order-cmp.out
: $(objpfx
)order.out
1623 (echo
"0123456789" | cmp
$< -) > $@
; \
1626 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
1627 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
1628 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
1630 $(objpfx
)noload
: $(objpfx
)testobj1.so
1631 LDFLAGS-noload
= -rdynamic
-Wl
,--no-as-needed
1632 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
1634 $(objpfx
)noload-mem.out
: $(objpfx
)noload.out
1635 $(common-objpfx
)malloc
/mtrace
$(objpfx
)noload.mtrace
> $@
; \
1637 noload-ENV
= MALLOC_TRACE
=$(objpfx
)noload.mtrace \
1638 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
1640 LDFLAGS-nodelete
= -rdynamic
1641 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1642 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1643 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
1644 $(objpfx
)nodelmod3.so
1646 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
1647 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
1649 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
1650 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
1652 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
1653 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
1655 -L
$(subst :, -L
,$(rpath-link
)) \
1656 -Wl
,-rpath-link
=$(rpath-link
) \
1657 $< -Wl
,-F
,$(objpfx
)filtmod2.so
1658 $(objpfx
)filter: $(objpfx
)filtmod1.so
1660 # This does not link against libc.
1661 CFLAGS-filtmod1.c
+= $(no-stack-protector
)
1663 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
1665 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
1667 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
1669 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1671 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
1673 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
1674 LDFLAGS-next
= -Wl
,--no-as-needed
1676 $(objpfx
)tst-next-ver
: $(objpfx
)nextmod3.so
1677 LDFLAGS-tst-next-ver
= -Wl
,--no-as-needed
1679 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
1681 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
1683 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
1684 $(objpfx
)pathoptobj.so
1685 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
1686 '$(run-program-env)'; \
1689 $(objpfx
)tst-rtld-load-self.out
: tst-rtld-load-self.sh
$(objpfx
)ld.so
1690 $(SHELL
) $^
'$(test-wrapper)' '$(test-wrapper-env)' > $@
; \
1693 tst-rtld-preload-OBJS
= $(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1694 $(objpfx
)tst-rtld-preload.out
: tst-rtld-preload.sh
$(objpfx
)ld.so \
1695 $(objpfx
)preloadtest \
1696 $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1697 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)preloadtest \
1698 '$(test-wrapper-env)' '$(run_program_env)' \
1699 '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@
; \
1702 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
1704 $(objpfx
)global
: $(objpfx
)globalmod1.so
1705 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1707 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1709 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1711 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
1713 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
1715 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
1717 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
1719 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1720 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
1722 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
1724 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
1726 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
1728 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
1730 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
1732 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
1734 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
1736 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1738 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
$(objpfx
)tst-tlsmod7.so
1740 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
$(objpfx
)tst-tlsmod9.so
1742 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
$(objpfx
)tst-tlsmod11.so
1744 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
1746 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
1747 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
1749 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
1751 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
1755 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
1757 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
1758 $(patsubst %,$(objpfx
)%.os
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
1759 $(compile-command.c
) -DN
=$*
1760 $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
1761 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
))
1763 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
))
1764 $(patsubst %,$(objpfx
)%.os
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
1765 $(compile-command.c
) -DN
=$*
1766 $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
1768 $(objpfx
)tst-tls19.out
: $(objpfx
)tst-tls19mod1.so
1770 CFLAGS-tst-align.c
+= $(stack-align-test-flags
)
1771 CFLAGS-tst-align2.c
+= $(stack-align-test-flags
)
1772 CFLAGS-tst-alignmod.c
+= $(stack-align-test-flags
)
1773 CFLAGS-tst-alignmod2.c
+= $(stack-align-test-flags
)
1774 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
1775 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
1776 $(objpfx
)tst-align3
: $(objpfx
)tst-alignmod3.so
1777 ifeq (yes
,$(have-fpie
))
1778 CFLAGS-tst-align3.c
+= $(PIE-ccflag
)
1780 LDFLAGS-tst-align3
+= -Wl
,-z
,max-page-size
=0x200000
1781 LDFLAGS-tst-alignmod3.so
+= -Wl
,-z
,max-page-size
=0x200000
1782 $(objpfx
)tst-alignmod3.so
: $(libsupport
)
1784 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1785 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1787 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
1789 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1790 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1792 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
1793 $(objpfx
)unload6mod3.so
1795 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
1796 unload7-ENV
= MALLOC_PERTURB_
=85
1798 $(objpfx
)unload8.out
: $(objpfx
)unload8mod1.so
$(objpfx
)unload8mod1x.so
1800 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1802 ifeq ($(have-z-execstack
),yes
)
1803 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
1804 CPPFLAGS-tst-execstack.c
+= -DUSE_PTHREADS
=0
1805 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
1806 LDFLAGS-tst-execstack-mod.so
= -Wl
,-z
,execstack
1808 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
1809 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
1811 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
1812 CFLAGS-tst-execstack-prog.c
+= -Wno-trampolines
1813 CFLAGS-tst-execstack-mod.c
+= -Wno-trampolines
1816 LDFLAGS-tst-array2
= -Wl
,--no-as-needed
1817 LDFLAGS-tst-array5
= -Wl
,--no-as-needed
1819 $(objpfx
)tst-array1-cmp.out
: tst-array1.exp
$(objpfx
)tst-array1.out
1823 $(objpfx
)tst-array1-static-cmp.out
: tst-array1.exp \
1824 $(objpfx
)tst-array1-static.out
1828 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
1829 $(objpfx
)tst-array2-cmp.out
: tst-array2.exp
$(objpfx
)tst-array2.out
1833 $(objpfx
)tst-array3-cmp.out
: tst-array1.exp
$(objpfx
)tst-array3.out
1837 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array2dep.so
1838 $(objpfx
)tst-array4-cmp.out
: tst-array4.exp
$(objpfx
)tst-array4.out
1842 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
1843 $(objpfx
)tst-array5-cmp.out
: tst-array5.exp
$(objpfx
)tst-array5.out
1847 $(objpfx
)tst-array5-static-cmp.out
: tst-array5-static.exp \
1848 $(objpfx
)tst-array5-static.out
1852 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
1853 CFLAGS-tst-pie2.c
+= $(pie-ccflag
)
1855 $(objpfx
)tst-piemod1.so
: $(libsupport
)
1856 $(objpfx
)tst-pie1
: $(objpfx
)tst-piemod1.so
1857 $(objpfx
)tst-dlopen-pie.out
: $(objpfx
)tst-pie1
1859 ifeq (yes
,$(build-shared
))
1860 # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with
1861 # all-built-dso here.
1862 all-built-dso
:= $(common-objpfx
)elf
/ld.so
$(common-objpfx
)libc.so \
1863 $(filter-out $(common-objpfx
)linkobj
/libc.so
, \
1864 $(sort $(wildcard $(addprefix $(common-objpfx
), \
1868 $(all-built-dso
:=.dyn
): %.dyn
: %
1870 LC_ALL
=C
$(READELF
) -W
-d
$< > $@T
1873 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dyn
)
1875 $(objpfx
)check-textrel.out
: $(..
)scripts
/check-textrel.awk \
1876 $(all-built-dso
:=.dyn
)
1877 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1879 generated
+= check-textrel.out
1881 $(objpfx
)execstack-default
: $(first-word
$(wildcard $(sysdirs
:%=%/stackinfo.h
)))
1882 $(make-target-directory
)
1883 { echo
'#include <elf.h>'; \
1884 echo
'#include <stackinfo.h>'; \
1885 echo
'#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1886 echo
'@@@execstack-no@@@'; \
1888 echo
'@@@execstack-yes@@@'; \
1889 echo
'#endif'; } | \
1890 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -E
-x c-header
- | \
1891 sed
-n
-e
's/^@@@\(.*\)@@@/\1/p' > $@T
1893 generated
+= execstack-default
1895 $(all-built-dso
:=.phdr
): %.phdr
: %
1897 LC_ALL
=C
$(READELF
) -W
-l
$< > $@T
1900 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.phdr
)
1902 $(objpfx
)check-execstack.out
: $(..
)scripts
/check-execstack.awk \
1903 $(objpfx
)execstack-default \
1904 $(all-built-dso
:=.phdr
)
1905 LC_ALL
=C
$(AWK
) -v
"xfail=$(check-execstack-xfail)" -f
$^
> $@
; \
1907 generated
+= check-execstack.out
1909 $(objpfx
)check-wx-segment.out
: $(..
)scripts
/check-wx-segment.py \
1910 $(all-built-dso
:=.phdr
)
1911 $(PYTHON
) $^
--xfail
="$(check-wx-segment-xfail)" > $@
; \
1913 generated
+= check-wx-segment.out
1915 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
1917 $(all-built-dso
:=.jmprel
): %.jmprel
: % Makefile
1919 LC_ALL
=C
$(READELF
) -W
-S
-d
-r
$< > $@T
1922 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.jmprel
)
1924 localplt-built-dso
:= $(addprefix $(common-objpfx
),\
1929 resolv
/libresolv.so \
1931 ifeq ($(build-mathvec
),yes
)
1932 localplt-built-dso
+= $(addprefix $(common-objpfx
), mathvec
/libmvec.so
)
1934 ifeq ($(have-thread-library
),yes
)
1935 localplt-built-dso
+= $(filter-out %_nonshared.a
, $(shared-thread-library
))
1937 ifneq ($(pthread-in-libc
),yes
)
1938 localplt-built-dso
+= $(addprefix $(common-objpfx
), rt
/librt.so
)
1941 vpath localplt.data
$(+sysdep_dirs
)
1943 $(objpfx
)check-localplt.out
: $(..
)scripts
/check-localplt.awk \
1944 $(..
)scripts
/localplt.awk \
1945 $(localplt-built-dso
:=.jmprel
) \
1947 LC_ALL
=C
$(AWK
) -f
$(filter-out $< %localplt.data
,$^
) | \
1948 LC_ALL
=C
$(AWK
) -f
$< $(filter %localplt.data
,$^
) - \
1953 $(all-built-dso
:=.dynsym
): %.dynsym
: %
1955 LC_ALL
=C
$(READELF
) -W
--dyn-syms
$< > $@T
1958 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dynsym
)
1960 $(objpfx
)check-initfini.out
: $(..
)scripts
/check-initfini.awk \
1961 $(all-built-dso
:=.dynsym
)
1962 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1964 generated
+= check-initfini.out
1966 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
1967 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
1968 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
1969 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
1971 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
1972 $(objpfx
)tst-deep1
: $(objpfx
)tst-deep1mod1.so
1973 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
1974 LDFLAGS-tst-deep1
+= -rdynamic
1975 tst-deep1mod3.so-no-z-defs
= yes
1977 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
1979 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
1981 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
1983 $(objpfx
)tst-dlmopen4.out
: $(objpfx
)tst-dlmopen1mod.so
1985 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
1986 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1988 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
$(objpfx
)tst-auditmod9b.so
1989 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1990 CFLAGS-tst-audit2.c
+= -fno-builtin
1991 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1993 $(objpfx
)tst-audit9.out
: $(objpfx
)tst-auditmod9a.so
$(objpfx
)tst-auditmod9b.so
1994 tst-audit9-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod9a.so
1996 $(objpfx
)tst-audit8
: $(libm
)
1997 $(objpfx
)tst-audit8.out
: $(objpfx
)tst-auditmod1.so
1998 tst-audit8-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
2000 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
2002 $(objpfx
)tst-global2
: $(objpfx
)tst-globalmod2.so
2003 $(objpfx
)tst-global2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
2004 LDFLAGS-tst-global2
= -Wl
,--enable-new-dtags
2005 LDFLAGS-tst-globalmod2.so
= -Wl
,--enable-new-dtags
2007 $(objpfx
)order2.out
: $(objpfx
)order2mod1.so
$(objpfx
)order2mod2.so
2008 $(objpfx
)order2-cmp.out
: $(objpfx
)order2.out
2009 (echo
"12345" | cmp
$< -) > $@
; \
2011 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
2012 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
2013 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
2014 order2mod2.so-no-z-defs
= yes
2015 LDFLAGS-order2mod1.so
= -Wl
,--no-as-needed
2016 LDFLAGS-order2mod2.so
= -Wl
,--no-as-needed
2018 tst-stackguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
2019 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
2021 tst-ptrguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
2022 # When built statically, the pointer guard interface uses
2023 # __pointer_chk_guard_local.
2024 CFLAGS-tst-ptrguard1-static.c
+= -DPTRGUARD_LOCAL
2025 tst-ptrguard1-static-ARGS
= --command
"$(objpfx)tst-ptrguard1-static --child"
2027 $(objpfx
)tst-leaks1-mem.out
: $(objpfx
)tst-leaks1.out
2028 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
; \
2031 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace \
2032 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
2034 $(objpfx
)tst-thrlock
: $(shared-thread-library
)
2035 $(objpfx
)tst-thrlock.out
: $(libm
)
2036 $(objpfx
)tst-noload.out
: $(libm
)
2038 tst-tst-dlopen-tlsmodid-no-pie
= yes
2039 $(objpfx
)tst-dlopen-tlsmodid
: $(shared-thread-library
)
2040 $(objpfx
)tst-dlopen-tlsmodid.out
: $(objpfx
)tst-dlopen-self
2041 CFLAGS-tst-dlopen-tlsmodid-pie.c
+= $(pie-ccflag
)
2042 $(objpfx
)tst-dlopen-tlsmodid-pie
: $(shared-thread-library
)
2043 $(objpfx
)tst-dlopen-tlsmodid-pie.out
: $(objpfx
)tst-dlopen-self-pie
2044 $(objpfx
)tst-dlopen-tlsmodid-container
: $(shared-thread-library
)
2045 LDFLAGS-tst-dlopen-tlsmodid-container
+= -Wl
,-rpath
,\
$$ORIGIN
2047 tst-tst-dlopen-self-no-pie
= yes
2048 CFLAGS-tst-dlopen-self-pie.c
+= $(pie-ccflag
)
2049 LDFLAGS-tst-dlopen-self-container
+= -Wl
,-rpath
,\
$$ORIGIN
2051 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
2052 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
2053 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
2054 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
2055 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
2056 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
2057 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
2058 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
2059 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
2060 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
2061 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
2062 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
2063 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
2064 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
2065 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
2066 CFLAGS-ifuncmain9pic.c
+= $(pic-ccflag
)
2067 CFLAGS-ifuncmain9picstatic.c
+= $(pic-ccflag
)
2069 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
2071 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
2072 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
2073 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
2074 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
2075 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
2076 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
2077 CFLAGS-ifuncmain9pie.c
+= $(pie-ccflag
)
2078 CFLAGS-tst-ifunc-textrel.c
+= $(pic-ccflag
)
2080 LDFLAGS-ifuncmain6pie
= -Wl
,-z
,lazy
2082 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmod1.so
2083 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncdep1pic.o
2084 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmod1.so
2085 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmod5.so
2086 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmod6.so
2088 $(objpfx
)ifuncmain1
: $(addprefix $(objpfx
),ifuncmod1.so
)
2089 $(objpfx
)ifuncmain1pic
: $(addprefix $(objpfx
),ifuncmod1.so
)
2090 $(objpfx
)ifuncmain1staticpic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
2091 $(objpfx
)ifuncmain1static
: $(addprefix $(objpfx
),ifuncdep1.o
)
2092 $(objpfx
)ifuncmain1picstatic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
2093 $(objpfx
)ifuncmain1vis
: $(addprefix $(objpfx
),ifuncmod1.so
)
2094 $(objpfx
)ifuncmain1vispic
: $(addprefix $(objpfx
),ifuncmod1.so
)
2095 $(objpfx
)ifuncmain2
: $(addprefix $(objpfx
),ifuncdep2.o
)
2096 $(objpfx
)ifuncmain2pic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2097 $(objpfx
)ifuncmain2static
: $(addprefix $(objpfx
),ifuncdep2.o
)
2098 $(objpfx
)ifuncmain2picstatic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2100 $(objpfx
)ifuncmain3.out
: $(objpfx
)ifuncmod3.so
2102 $(objpfx
)ifuncmain5
: $(addprefix $(objpfx
),ifuncmod5.so
)
2103 $(objpfx
)ifuncmain5pic
: $(addprefix $(objpfx
),ifuncmod5.so
)
2104 $(objpfx
)ifuncmain5static
: $(addprefix $(objpfx
),ifuncdep5.o
)
2105 $(objpfx
)ifuncmain5staticpic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2106 $(objpfx
)ifuncmain5picstatic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2108 LDFLAGS-tst-ifunc-fault-lazy
= -Wl
,-z
,lazy
2109 LDFLAGS-tst-ifunc-fault-bindnow
= -Wl
,-z
,now
2110 define tst-ifunc-fault-script
2111 ( $(test-wrapper
) $(rtld-prefix
) --verify
$^ \
2112 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 $(rtld-prefix
) $^ \
2113 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 LD_DEBUG
=unused \
2115 ) > $@
; $(evaluate-test
)
2117 $(objpfx
)tst-ifunc-fault-lazy.out
: $(objpfx
)tst-ifunc-fault-lazy
$(objpfx
)ld.so
2118 $(tst-ifunc-fault-script
)
2119 $(objpfx
)tst-ifunc-fault-bindnow.out
: $(objpfx
)tst-ifunc-fault-bindnow \
2121 $(tst-ifunc-fault-script
)
2123 $(objpfx
)tst-unique1.out
: $(objpfx
)tst-unique1mod1.so \
2124 $(objpfx
)tst-unique1mod2.so
2126 $(objpfx
)tst-unique2
: $(objpfx
)tst-unique2mod1.so
2127 $(objpfx
)tst-unique2.out
: $(objpfx
)tst-unique2mod2.so
2129 $(objpfx
)tst-unique3
: $(objpfx
)tst-unique3lib.so
2130 $(objpfx
)tst-unique3.out
: $(objpfx
)tst-unique3lib2.so
2132 $(objpfx
)tst-unique4
: $(objpfx
)tst-unique4lib.so
2134 $(objpfx
)tst-nodelete.out
: $(objpfx
)tst-nodelete-uniquemod.so \
2135 $(objpfx
)tst-nodelete-rtldmod.so \
2136 $(objpfx
)tst-nodelete-zmod.so
2138 LDFLAGS-tst-nodelete
= -rdynamic
2139 LDFLAGS-tst-nodelete-zmod.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
2141 $(objpfx
)tst-nodelete2.out
: $(objpfx
)tst-nodelete2mod.so
2143 LDFLAGS-tst-nodelete2
= -rdynamic
2145 $(objpfx
)tst-initorder-cmp.out
: tst-initorder.exp
$(objpfx
)tst-initorder.out
2149 $(objpfx
)tst-initorder2
: $(objpfx
)tst-initorder2a.so
$(objpfx
)tst-initorder2d.so
$(objpfx
)tst-initorder2c.so
2150 $(objpfx
)tst-initorder2a.so
: $(objpfx
)tst-initorder2b.so
2151 $(objpfx
)tst-initorder2b.so
: $(objpfx
)tst-initorder2c.so
2152 $(objpfx
)tst-initorder2c.so
: $(objpfx
)tst-initorder2d.so
2153 LDFLAGS-tst-initorder2
= -Wl
,--no-as-needed
2154 LDFLAGS-tst-initorder2a.so
= -Wl
,--no-as-needed
2155 LDFLAGS-tst-initorder2b.so
= -Wl
,--no-as-needed
2156 LDFLAGS-tst-initorder2c.so
= -Wl
,--no-as-needed
2157 define o-iterator-doit
2158 $(objpfx
)tst-initorder2
$o.os
: tst-initorder2.c
; \
2159 $$(compile-command.c
) -DNAME
=\"$o\"
2161 object-suffixes-left
:= a b c d
2162 include $(o-iterator
)
2164 $(objpfx
)tst-initorder2-cmp.out
: tst-initorder2.exp
$(objpfx
)tst-initorder2.out
2168 $(objpfx
)tst-relsort1mod1.so
: $(libm
) $(objpfx
)tst-relsort1mod2.so
2169 $(objpfx
)tst-relsort1mod2.so
: $(libm
)
2170 $(objpfx
)tst-relsort1.out
: $(objpfx
)tst-relsort1mod1.so \
2171 $(objpfx
)tst-relsort1mod2.so
2173 $(objpfx
)tst-unused-dep.out
: $(objpfx
)testobj1.so
2174 $(test-wrapper-env
) \
2175 LD_TRACE_LOADED_OBJECTS
=1 \
2182 $(objpfx
)tst-unused-dep-cmp.out
: $(objpfx
)tst-unused-dep.out
2183 cmp
$< /dev
/null
> $@
; \
2186 $(objpfx
)tst-audit11.out
: $(objpfx
)tst-auditmod11.so
$(objpfx
)tst-audit11mod1.so
2187 tst-audit11-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod11.so
2188 $(objpfx
)tst-audit11mod1.so
: $(objpfx
)tst-audit11mod2.so
2189 LDFLAGS-tst-audit11mod2.so
= -Wl
,--version-script
=tst-audit11mod2.map
,-soname
,tst-audit11mod2.so
2191 $(objpfx
)tst-audit12.out
: $(objpfx
)tst-auditmod12.so
$(objpfx
)tst-audit12mod1.so
$(objpfx
)tst-audit12mod3.so
2192 tst-audit12-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod12.so
2193 $(objpfx
)tst-audit12mod1.so
: $(objpfx
)tst-audit12mod2.so
2194 LDFLAGS-tst-audit12mod2.so
= -Wl
,--version-script
=tst-audit12mod2.map
2196 $(objpfx
)tst-audit13.out
: $(objpfx
)tst-audit13mod1.so
2197 LDFLAGS-tst-audit13mod1.so
= -Wl
,-z
,lazy
2198 tst-audit13-ENV
= LD_AUDIT
=$(objpfx
)tst-audit13mod1.so
2200 $(objpfx
)tst-auditmany.out
: $(objpfx
)tst-auditmanymod1.so \
2201 $(objpfx
)tst-auditmanymod2.so
$(objpfx
)tst-auditmanymod3.so \
2202 $(objpfx
)tst-auditmanymod4.so
$(objpfx
)tst-auditmanymod5.so \
2203 $(objpfx
)tst-auditmanymod6.so
$(objpfx
)tst-auditmanymod7.so \
2204 $(objpfx
)tst-auditmanymod8.so
$(objpfx
)tst-auditmanymod9.so
2205 tst-auditmany-ENV
= \
2206 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
2208 LDFLAGS-tst-audit14
= -Wl
,--audit
=tst-auditlogmod-1.so
,--disable-new-dtags
2209 $(objpfx
)tst-auditlogmod-1.so
: $(libsupport
)
2210 $(objpfx
)tst-audit14.out
: $(objpfx
)tst-auditlogmod-1.so
2211 LDFLAGS-tst-audit14a
= -Wl
,--audit
=tst-auditlogmod-1.so
,--enable-new-dtags
2212 $(objpfx
)tst-audit14a.out
: $(objpfx
)tst-auditlogmod-1.so
2213 LDFLAGS-tst-audit15
= \
2214 -Wl
,--audit
=tst-auditlogmod-1.so
,--depaudit
=tst-auditlogmod-2.so
2215 $(objpfx
)tst-auditlogmod-2.so
: $(libsupport
)
2216 $(objpfx
)tst-audit15.out
: \
2217 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so
2218 LDFLAGS-tst-audit16
= \
2219 -Wl
,--audit
=tst-auditlogmod-1.so
:tst-auditlogmod-2.so \
2220 -Wl
,--depaudit
=tst-auditlogmod-3.so
2221 $(objpfx
)tst-auditlogmod-3.so
: $(libsupport
)
2222 $(objpfx
)tst-audit16.out
: \
2223 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so \
2224 $(objpfx
)tst-auditlogmod-3.so
2225 $(objpfx
)tst-audit17.out
: $(objpfx
)tst-auditmod17.so
2226 # The test check if a audit library without libc.so on DT_NEEDED works as
2227 # intended, so it uses an explicit link rule.
2228 $(objpfx
)tst-auditmod17.so
: $(objpfx
)tst-auditmod17.os
2229 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
2230 $(filter-out $(map-file
),$^
)
2231 $(call after-link
,$@.new
)
2233 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-auditmod17
)
2234 tst-audit17-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod17.so
2236 $(objpfx
)tst-audit14-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14.out
2239 $(objpfx
)tst-audit14a-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14a.out
2242 $(objpfx
)tst-audit15-cmp.out
: tst-audit15.exp
$(objpfx
)tst-audit15.out
2245 $(objpfx
)tst-audit16-cmp.out
: tst-audit16.exp
$(objpfx
)tst-audit16.out
2249 $(objpfx
)tst-audit18.out
: $(objpfx
)tst-auditmod18.so \
2250 $(objpfx
)tst-audit18mod.so
2251 tst-audit18-ARGS
= -- $(host-test-program-cmd
)
2253 $(objpfx
)tst-audit19a.out
: $(objpfx
)tst-auditmod19a.so
2254 tst-audit19a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod19a.so
2256 $(objpfx
)tst-audit19b.out
: $(objpfx
)tst-auditmod19b.so
2257 $(objpfx
)tst-audit19b
: $(objpfx
)tst-audit19bmod.so
2258 tst-audit19b-ARGS
= -- $(host-test-program-cmd
)
2260 $(objpfx
)tst-audit20.out
: $(objpfx
)tst-auditmod20.so
2261 tst-audit20-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod20.so
2263 $(objpfx
)tst-audit21
: $(shared-thread-library
)
2264 $(objpfx
)tst-audit21.out
: $(objpfx
)tst-auditmod21a.so
2265 $(objpfx
)tst-auditmod21a.so
: $(objpfx
)tst-auditmod21b.so
2266 tst-audit21-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod21a.so
2268 $(objpfx
)tst-audit22.out
: $(objpfx
)tst-auditmod22.so
2269 tst-audit22-ARGS
= -- $(host-test-program-cmd
)
2271 $(objpfx
)tst-audit23.out
: $(objpfx
)tst-auditmod23.so \
2272 $(objpfx
)tst-audit23mod.so
2273 tst-audit23-ARGS
= -- $(host-test-program-cmd
)
2275 $(objpfx
)tst-audit24a.out
: $(objpfx
)tst-auditmod24a.so
2276 $(objpfx
)tst-audit24a
: $(objpfx
)tst-audit24amod1.so \
2277 $(objpfx
)tst-audit24amod2.so
2278 tst-audit24a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24a.so
2279 LDFLAGS-tst-audit24a
= -Wl
,-z
,now
2281 $(objpfx
)tst-audit24b.out
: $(objpfx
)tst-auditmod24b.so
2282 $(objpfx
)tst-audit24b
: $(objpfx
)tst-audit24bmod1.so \
2283 $(objpfx
)tst-audit24bmod2.so
2284 $(objpfx
)tst-audit24bmod1
: $(objpfx
)tst-audit24bmod2.so
2285 # The test checks if a library without .gnu.version correctly calls the
2286 # audit callbacks. So it uses an explicit link rule to avoid linking
2288 $(objpfx
)tst-audit24bmod1.so
: $(objpfx
)tst-audit24bmod1.os
2289 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod1.os \
2291 $(call after-link
,$@.new
)
2293 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod1
)
2294 $(objpfx
)tst-audit24bmod2.so
: $(objpfx
)tst-audit24bmod2.os
2295 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod2.os
2296 $(call after-link
,$@.new
)
2298 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod2
)
2299 tst-audit24b-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24b.so
2300 LDFLAGS-tst-audit24b
= -Wl
,-z
,now
2302 # Same as tst-audit24a, but tests LD_BIND_NOW
2303 $(objpfx
)tst-audit24c.out
: $(objpfx
)tst-auditmod24c.so
2304 $(objpfx
)tst-audit24c
: $(objpfx
)tst-audit24amod1.so \
2305 $(objpfx
)tst-audit24amod2.so
2306 tst-audit24c-ENV
= LD_BIND_NOW
=1 LD_AUDIT
=$(objpfx
)tst-auditmod24c.so
2307 LDFLAGS-tst-audit24c
= -Wl
,-z
,lazy
2309 $(objpfx
)tst-audit24d.out
: $(objpfx
)tst-auditmod24d.so
2310 $(objpfx
)tst-audit24d
: $(objpfx
)tst-audit24dmod1.so \
2311 $(objpfx
)tst-audit24dmod2.so
2312 $(objpfx
)tst-audit24dmod1.so
: $(objpfx
)tst-audit24dmod3.so
2313 LDFLAGS-tst-audit24dmod1.so
= -Wl
,-z
,now
2314 $(objpfx
)tst-audit24dmod2.so
: $(objpfx
)tst-audit24dmod4.so
2315 LDFLAGS-tst-audit24dmod2.so
= -Wl
,-z
,lazy
2316 tst-audit24d-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24d.so
2317 LDFLAGS-tst-audit24d
= -Wl
,-z
,lazy
2319 $(objpfx
)tst-audit25a.out
: $(objpfx
)tst-auditmod25.so
2320 $(objpfx
)tst-audit25a
: $(objpfx
)tst-audit25mod1.so \
2321 $(objpfx
)tst-audit25mod2.so \
2322 $(objpfx
)tst-audit25mod3.so \
2323 $(objpfx
)tst-audit25mod4.so
2324 LDFLAGS-tst-audit25a
= -Wl
,-z
,lazy
2325 $(objpfx
)tst-audit25mod1.so
: $(objpfx
)tst-audit25mod3.so
2326 LDFLAGS-tst-audit25mod1.so
= -Wl
,-z
,now
2327 $(objpfx
)tst-audit25mod2.so
: $(objpfx
)tst-audit25mod4.so
2328 LDFLAGS-tst-audit25mod2.so
= -Wl
,-z
,lazy
2329 tst-audit25a-ARGS
= -- $(host-test-program-cmd
)
2331 $(objpfx
)tst-audit25b.out
: $(objpfx
)tst-auditmod25.so
2332 $(objpfx
)tst-audit25b
: $(objpfx
)tst-audit25mod1.so \
2333 $(objpfx
)tst-audit25mod2.so \
2334 $(objpfx
)tst-audit25mod3.so \
2335 $(objpfx
)tst-audit25mod4.so
2336 LDFLAGS-tst-audit25b
= -Wl
,-z
,now
2337 tst-audit25b-ARGS
= -- $(host-test-program-cmd
)
2339 $(objpfx
)tst-audit28.out
: $(objpfx
)tst-auditmod28.so
2340 $(objpfx
)tst-auditmod28.so
: $(libsupport
)
2341 tst-audit28-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod28.so
2343 # tst-sonamemove links against an older implementation of the library.
2344 LDFLAGS-tst-sonamemove-linkmod1.so
= \
2345 -Wl
,--version-script
=tst-sonamemove-linkmod1.map \
2346 -Wl
,-soname
,tst-sonamemove-runmod1.so
2347 LDFLAGS-tst-sonamemove-runmod1.so
= -Wl
,--no-as-needed \
2348 -Wl
,--version-script
=tst-sonamemove-runmod1.map \
2349 -Wl
,-soname
,tst-sonamemove-runmod1.so
2350 LDFLAGS-tst-sonamemove-runmod2.so
= \
2351 -Wl
,--version-script
=tst-sonamemove-runmod2.map \
2352 -Wl
,-soname
,tst-sonamemove-runmod2.so
2353 $(objpfx
)tst-sonamemove-runmod1.so
: $(objpfx
)tst-sonamemove-runmod2.so
2354 # Link against the link module, but depend on the run-time modules
2356 $(objpfx
)tst-sonamemove-link
: $(objpfx
)tst-sonamemove-linkmod1.so
2357 $(objpfx
)tst-sonamemove-link.out
: \
2358 $(objpfx
)tst-sonamemove-runmod1.so \
2359 $(objpfx
)tst-sonamemove-runmod2.so
2360 $(objpfx
)tst-sonamemove-dlopen.out
: \
2361 $(objpfx
)tst-sonamemove-runmod1.so \
2362 $(objpfx
)tst-sonamemove-runmod2.so
2364 $(objpfx
)tst-dlmopen-dlerror-mod.so
: $(libsupport
)
2365 $(objpfx
)tst-dlmopen-dlerror.out
: $(objpfx
)tst-dlmopen-dlerror-mod.so
2367 # Override -z defs, so that we can reference an undefined symbol.
2368 # Force lazy binding for the same reason.
2369 LDFLAGS-tst-latepthreadmod.so
= \
2370 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2371 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
2372 # function this_function_is_not_defined.
2373 CFLAGS-tst-latepthreadmod.c
+= -fno-optimize-sibling-calls
2374 $(objpfx
)tst-latepthreadmod.so
: $(shared-thread-library
)
2375 $(objpfx
)tst-latepthread.out
: $(objpfx
)tst-latepthreadmod.so
2377 # The test modules are parameterized by preprocessor macros.
2378 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules
)): \
2379 $(objpfx
)tst-tls-manydynamic
%mod.os
: tst-tls-manydynamicmod.c
2380 $(compile-command.c
) \
2381 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2382 $(objpfx
)tst-tls-manydynamic
: $(shared-thread-library
)
2383 $(objpfx
)tst-tls-manydynamic.out
: \
2384 $(patsubst %,$(objpfx
)%.so
,$(tst-tls-many-dynamic-modules
))
2386 $(objpfx
)tst-ldconfig-X.out
: tst-ldconfig-X.sh
$(objpfx
)ldconfig
2387 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
2388 '$(run-program-env)' > $@
; \
2391 $(objpfx
)tst-ldconfig-p.out
: tst-ldconfig-p.sh
$(objpfx
)ldconfig
2392 $(SHELL
) $< '$(common-objpfx)' '$(sysconfdir)' '$(test-wrapper-env)' \
2393 '$(run-program-env)' > $@
; \
2396 LDFLAGS-tst-ldconfig-soname-lib-with-soname.so
= \
2397 -Wl
,-soname
,libtst-ldconfig-soname-lib-with-soname.so
.1
2399 $(objpfx
)tst-ldconfig-soname.out
: tst-ldconfig-soname.sh \
2401 $(objpfx
)tst-ldconfig-soname-lib-with-soname.so \
2402 $(objpfx
)tst-ldconfig-soname-lib-without-soname.so
2403 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
2404 '$(run-program-env)' > $@
; \
2407 # Test static linking of all the libraries we can possibly link
2408 # together. Note that in some configurations this may be less than the
2409 # complete list of libraries we build but we try to maxmimize this list.
2410 ifeq ($(pthread-in-libc
),no
)
2411 $(objpfx
)tst-linkall-static
: \
2412 $(common-objpfx
)resolv
/libanl.a
2414 $(objpfx
)tst-linkall-static
: \
2415 $(common-objpfx
)math
/libm.a \
2416 $(common-objpfx
)resolv
/libresolv.a \
2417 $(common-objpfx
)login
/libutil.a \
2418 $(common-objpfx
)rt
/librt.a \
2419 $(static-thread-library
)
2421 LDFLAGS-nextmod3.so
= -Wl
,--version-script
=nextmod3.map
2423 # The application depends on the DSO, and the DSO loads the plugin.
2424 # The plugin also depends on the DSO. This creates the circular
2425 # dependency via dlopen that we're testing to make sure works.
2426 $(objpfx
)tst-nodelete-dlclose-plugin.so
: $(objpfx
)tst-nodelete-dlclose-dso.so
2427 $(objpfx
)tst-nodelete-dlclose
: $(objpfx
)tst-nodelete-dlclose-dso.so
2428 $(objpfx
)tst-nodelete-dlclose.out
: $(objpfx
)tst-nodelete-dlclose-dso.so \
2429 $(objpfx
)tst-nodelete-dlclose-plugin.so
2431 tst-env-setuid-ENV
= MALLOC_CHECK_
=2 MALLOC_MMAP_THRESHOLD_
=4096 \
2434 $(objpfx
)tst-debug1.out
: $(objpfx
)tst-debug1mod1.so
2436 $(objpfx
)tst-debug1mod1.so
: $(objpfx
)testobj1.so
2437 $(OBJCOPY
) --only-keep-debug
$< $@
2439 $(objpfx
)tst-main1
: $(objpfx
)tst-main1mod.so
2440 CRT-tst-main1
:= $(csu-objpfx
)crt1.o
2441 tst-main1-no-pie
= yes
2442 LDLIBS-tst-main1
= $(libsupport
)
2443 tst-main1mod.so-no-z-defs
= yes
2445 LDLIBS-tst-absolute-sym-lib.so
= tst-absolute-sym-lib.lds
2446 $(objpfx
)tst-absolute-sym-lib.so
: $(LDLIBS-tst-absolute-sym-lib.so
)
2447 $(objpfx
)tst-absolute-sym
: $(objpfx
)tst-absolute-sym-lib.so
2449 LDLIBS-tst-absolute-zero-lib.so
= tst-absolute-zero-lib.lds
2450 $(objpfx
)tst-absolute-zero-lib.so
: $(LDLIBS-tst-absolute-zero-lib.so
)
2451 $(objpfx
)tst-absolute-zero
: $(objpfx
)tst-absolute-zero-lib.so
2453 $(objpfx
)tst-big-note
: $(objpfx
)tst-big-note-lib.so
2454 # Avoid creating an ABI tag note, which may come before the
2455 # artificial, large note in tst-big-note-lib.o and invalidate the
2457 $(objpfx
)tst-big-note-lib.so
: $(objpfx
)tst-big-note-lib.o
2458 $(LINK.o
) -shared
-o
$@
$(LDFLAGS.so
) $(dt-relr-ldflag
) $<
2460 $(objpfx
)tst-unwind-ctor
: $(objpfx
)tst-unwind-ctor-lib.so
2462 CFLAGS-tst-unwind-main.c
+= -funwind-tables
-DUSE_PTHREADS
=0
2464 $(objpfx
)tst-initfinilazyfail.out
: \
2465 $(objpfx
)tst-initlazyfailmod.so
$(objpfx
)tst-finilazyfailmod.so
2466 # Override -z defs, so that we can reference an undefined symbol.
2467 # Force lazy binding for the same reason.
2468 LDFLAGS-tst-initlazyfailmod.so
= \
2469 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2470 LDFLAGS-tst-finilazyfailmod.so
= \
2471 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2473 $(objpfx
)tst-dlopenfail.out
: \
2474 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so
2475 # Order matters here. tst-dlopenfaillinkmod.so's soname ensures a
2476 # run-time loader failure. --as-needed breaks this test because
2477 # nothing actually references tst-dlopenfailmod2.so (with its soname
2478 # tst-dlopenfail-missingmod.so).
2479 LDFLAGS-tst-dlopenfailmod1.so
= -Wl
,--no-as-needed
2480 $(objpfx
)tst-dlopenfailmod1.so
: \
2481 $(shared-thread-library
) $(objpfx
)tst-dlopenfaillinkmod.so
2482 LDFLAGS-tst-dlopenfaillinkmod.so
= -Wl
,-soname
,tst-dlopenfail-missingmod.so
2483 $(objpfx
)tst-dlopenfailmod2.so
: $(objpfx
)tst-dlopenfailnodelmod.so
2484 $(objpfx
)tst-dlopenfail-2.out
: \
2485 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so \
2486 $(objpfx
)tst-dlopenfailmod3.so
2487 # tst-dlopenfailnodelmod.so emulates how libpthread was linked.
2488 $(objpfx
)tst-dlopenfailnodelmod.so
: $(libsupport
)
2489 LDFLAGS-tst-dlopenfailnodelmod.so
= \
2490 -Wl
,--enable-new-dtags
,-z
,nodelete
,-z
,initfirst
2491 # tst-dlopenfail should export the libsupport symbols, so that
2492 # tst-dlopenfailnodelmod.so uses them for error reporting.
2493 LDFLAGS-tst-dlopenfail
= -Wl
,-E
2495 $(objpfx
)tst-dlopen-nodelete-reloc.out
: \
2496 $(objpfx
)tst-dlopen-nodelete-reloc-mod1.so \
2497 $(objpfx
)tst-dlopen-nodelete-reloc-mod2.so \
2498 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so \
2499 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so \
2500 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so \
2501 $(objpfx
)tst-dlopen-nodelete-reloc-mod6.so \
2502 $(objpfx
)tst-dlopen-nodelete-reloc-mod7.so \
2503 $(objpfx
)tst-dlopen-nodelete-reloc-mod8.so \
2504 $(objpfx
)tst-dlopen-nodelete-reloc-mod9.so \
2505 $(objpfx
)tst-dlopen-nodelete-reloc-mod10.so \
2506 $(objpfx
)tst-dlopen-nodelete-reloc-mod11.so \
2507 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so \
2508 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so \
2509 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so \
2510 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2511 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so \
2512 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
2513 tst-dlopen-nodelete-reloc-mod2.so-no-z-defs
= yes
2514 LDFLAGS-tst-dlopen-nodelete-reloc-mod2.so
= -Wl
,-z
,nodelete
2515 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
: \
2516 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so
2517 LDFLAGS-tst-dlopen-nodelete-reloc-mod4.so
= -Wl
,--no-as-needed
2518 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so
: \
2519 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
2520 LDFLAGS-tst-dlopen-nodelete-reloc-mod5.so
= -Wl
,-z
,nodelete
,--no-as-needed
2521 tst-dlopen-nodelete-reloc-mod5.so-no-z-defs
= yes
2522 tst-dlopen-nodelete-reloc-mod7.so-no-z-defs
= yes
2523 tst-dlopen-nodelete-reloc-mod11.so-no-z-defs
= yes
2524 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so
: \
2525 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so
2526 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
: \
2527 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so
2528 tst-dlopen-nodelete-reloc-mod16.so-no-z-defs
= yes
2529 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
: \
2530 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
2531 LDFLAGS-tst-dlopen-nodelete-reloc-mod16.so
= -Wl
,--no-as-needed
2532 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
: \
2533 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2534 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
2535 LDFLAGS-tst-dlopen-nodelete-reloc-mod17.so
= -Wl
,--no-as-needed
2537 $(objpfx
)tst-ldconfig-ld_so_conf-update.out
: $(objpfx
)tst-ldconfig-ld-mod.so
2539 LDFLAGS-tst-filterobj-flt.so
= -Wl
,--filter=$(objpfx
)tst-filterobj-filtee.so
2540 $(objpfx
)tst-filterobj
: $(objpfx
)tst-filterobj-flt.so
2541 $(objpfx
)tst-filterobj.out
: $(objpfx
)tst-filterobj-filtee.so
2542 $(objpfx
)tst-filterobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2544 LDFLAGS-tst-filterobj-aux.so
= -Wl
,--auxiliary
=$(objpfx
)tst-filterobj-filtee.so
2545 $(objpfx
)tst-auxobj
: $(objpfx
)tst-filterobj-aux.so
2546 $(objpfx
)tst-auxobj.out
: $(objpfx
)tst-filterobj-filtee.so
2547 $(objpfx
)tst-auxobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2549 $(objpfx
)tst-single_threaded
: $(objpfx
)tst-single_threaded-mod1.so
2550 $(objpfx
)tst-single_threaded.out
: \
2551 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so
2552 $(objpfx
)tst-single_threaded-static-dlopen
: \
2553 $(objpfx
)tst-single_threaded-mod1.o
2554 $(objpfx
)tst-single_threaded-static-dlopen.out
: \
2555 $(objpfx
)tst-single_threaded-mod2.so
2556 $(objpfx
)tst-single_threaded-pthread
: \
2557 $(objpfx
)tst-single_threaded-mod1.so
$(shared-thread-library
)
2558 $(objpfx
)tst-single_threaded-pthread.out
: \
2559 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so \
2560 $(objpfx
)tst-single_threaded-mod4.so
2561 $(objpfx
)tst-single_threaded-pthread-static
: $(static-thread-library
)
2563 $(objpfx
)tst-tls-ie
: $(shared-thread-library
)
2564 $(objpfx
)tst-tls-ie.out
: \
2565 $(objpfx
)tst-tls-ie-mod0.so \
2566 $(objpfx
)tst-tls-ie-mod1.so \
2567 $(objpfx
)tst-tls-ie-mod2.so \
2568 $(objpfx
)tst-tls-ie-mod3.so \
2569 $(objpfx
)tst-tls-ie-mod4.so \
2570 $(objpfx
)tst-tls-ie-mod5.so \
2571 $(objpfx
)tst-tls-ie-mod6.so
2573 $(objpfx
)tst-tls-ie-dlmopen
: $(shared-thread-library
)
2574 $(objpfx
)tst-tls-ie-dlmopen.out
: \
2575 $(objpfx
)tst-tls-ie-mod0.so \
2576 $(objpfx
)tst-tls-ie-mod1.so \
2577 $(objpfx
)tst-tls-ie-mod2.so \
2578 $(objpfx
)tst-tls-ie-mod3.so \
2579 $(objpfx
)tst-tls-ie-mod4.so \
2580 $(objpfx
)tst-tls-ie-mod5.so \
2581 $(objpfx
)tst-tls-ie-mod6.so
2583 $(objpfx
)argv0test.out
: tst-rtld-argv0.sh
$(objpfx
)ld.so \
2585 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)argv0test \
2586 '$(test-wrapper-env)' '$(run_program_env)' \
2587 '$(rpath-link)' 'test-argv0' > $@
; \
2590 # A list containing the name of the most likely searched subdirectory
2591 # of the glibc-hwcaps directory, for each supported architecture (in
2592 # other words, the oldest hardware level recognized by the
2593 # glibc-hwcaps mechanism for this architecture). Used to obtain test
2594 # coverage for some glibc-hwcaps tests for the widest possible range
2596 glibc-hwcaps-first-subdirs-for-tests
= power9 x86-64-v2 z13
2598 # The test modules are parameterized by preprocessor macros.
2599 LDFLAGS-libmarkermod1-1.so
+= -Wl
,-soname
,libmarkermod1.so
2600 LDFLAGS-libmarkermod2-1.so
+= -Wl
,-soname
,libmarkermod2.so
2601 LDFLAGS-libmarkermod3-1.so
+= -Wl
,-soname
,libmarkermod3.so
2602 LDFLAGS-libmarkermod4-1.so
+= -Wl
,-soname
,libmarkermod4.so
2603 LDFLAGS-libmarkermod5-1.so
+= -Wl
,-soname
,libmarkermod5.so
2604 $(objpfx
)libmarkermod
%.os
: markermodMARKER-VALUE.c
2605 $(compile-command.c
) \
2606 -DMARKER
=marker
$(firstword $(subst -, ,$*)) \
2607 -DVALUE
=$(lastword
$(subst -, ,$*))
2608 $(objpfx
)libmarkermod1.so
: $(objpfx
)libmarkermod1-1.so
2610 $(objpfx
)libmarkermod2.so
: $(objpfx
)libmarkermod2-1.so
2612 $(objpfx
)libmarkermod3.so
: $(objpfx
)libmarkermod3-1.so
2614 $(objpfx
)libmarkermod4.so
: $(objpfx
)libmarkermod4-1.so
2616 $(objpfx
)libmarkermod5.so
: $(objpfx
)libmarkermod5-1.so
2619 # tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is
2620 # preferred over auto-detected subdirectories.
2621 $(objpfx
)tst-glibc-hwcaps-prepend
: $(objpfx
)libmarkermod1-1.so
2622 $(objpfx
)glibc-hwcaps
/prepend-markermod1
/libmarkermod1.so
: \
2623 $(objpfx
)libmarkermod1-2.so
2624 $(make-target-directory
)
2626 $(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
: $(objpfx
)libmarkermod1-3.so
2627 $(make-target-directory
)
2629 $(objpfx
)tst-glibc-hwcaps-prepend.out
: \
2630 $(objpfx
)tst-glibc-hwcaps-prepend
$(objpfx
)libmarkermod1.so \
2631 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,prepend-markermod1 \
2632 $(glibc-hwcaps-first-subdirs-for-tests
))
2633 $(test-wrapper
) $(rtld-prefix
) \
2634 --glibc-hwcaps-prepend prepend-markermod1 \
2638 # Like tst-glibc-hwcaps-prepend, but uses a container and loads the
2639 # library via ld.so.cache. Test setup is contained in the test
2641 $(objpfx
)tst-glibc-hwcaps-prepend-cache.out
: \
2642 $(objpfx
)tst-glibc-hwcaps-prepend-cache
$(objpfx
)libmarkermod1-1.so \
2643 $(objpfx
)libmarkermod1-2.so
$(objpfx
)libmarkermod1-3.so
2645 # tst-glibc-hwcaps-mask checks that --glibc-hwcaps-mask can be used to
2646 # suppress all auto-detected subdirectories.
2647 $(objpfx
)tst-glibc-hwcaps-mask
: $(objpfx
)libmarkermod1-1.so
2648 $(objpfx
)tst-glibc-hwcaps-mask.out
: \
2649 $(objpfx
)tst-glibc-hwcaps-mask
$(objpfx
)libmarkermod1.so \
2650 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,\
2651 $(glibc-hwcaps-first-subdirs-for-tests
))
2652 $(test-wrapper
) $(rtld-prefix
) \
2653 --glibc-hwcaps-mask does-not-exist \
2657 # Generic dependency for sysdeps implementation of
2658 # tst-glibc-hwcaps-cache.
2659 $(objpfx
)tst-glibc-hwcaps-cache.out
: $(objpfx
)tst-glibc-hwcaps
2661 $(objpfx
)list-tunables.out
: tst-rtld-list-tunables.sh
$(objpfx
)ld.so
2662 $(SHELL
) $< $(objpfx
)ld.so
'$(test-wrapper-env)' \
2663 '$(run_program_env)' > $(objpfx
)/tst-rtld-list-tunables.out
2664 cmp tst-rtld-list-tunables.exp \
2665 $(objpfx
)/tst-rtld-list-tunables.out
> $@
; \
2668 tst-dst-static-ENV
= LD_LIBRARY_PATH
='$$ORIGIN'
2670 $(objpfx
)tst-rtld-help.out
: $(objpfx
)ld.so
2671 $(test-wrapper
) $(rtld-prefix
) --help
> $@
; \
2673 echo
"info: ld.so exit status: $$status" >> $@
; \
2677 # Reuses tst-tls-many-dynamic-modules
2678 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep
)): \
2679 $(objpfx
)tst-tls-manydynamic
%mod-dep.os
: tst-tls-manydynamicmod.c
2680 $(compile-command.c
) \
2681 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2682 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep-bad
)): \
2683 $(objpfx
)tst-tls-manydynamic
%mod-dep-bad.os
: tst-tls-manydynamicmod.c
2684 $(compile-command.c
) \
2685 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2686 tst-tls20mod-bad.so-no-z-defs
= yes
2687 # Single dependency.
2688 $(objpfx
)tst-tls-manydynamic0mod-dep.so
: $(objpfx
)tst-tls-manydynamic1mod-dep.so
2689 # Double dependencies.
2690 $(objpfx
)tst-tls-manydynamic2mod-dep.so
: $(objpfx
)tst-tls-manydynamic3mod-dep.so \
2691 $(objpfx
)tst-tls-manydynamic4mod-dep.so
2692 # Double dependencies with each dependency dependent of another module.
2693 $(objpfx
)tst-tls-manydynamic5mod-dep.so
: $(objpfx
)tst-tls-manydynamic6mod-dep.so \
2694 $(objpfx
)tst-tls-manydynamic7mod-dep.so
2695 $(objpfx
)tst-tls-manydynamic6mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2696 $(objpfx
)tst-tls-manydynamic7mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2697 # Long chain with one double dependency in the middle
2698 $(objpfx
)tst-tls-manydynamic9mod-dep.so
: $(objpfx
)tst-tls-manydynamic10mod-dep.so \
2699 $(objpfx
)tst-tls-manydynamic11mod-dep.so
2700 $(objpfx
)tst-tls-manydynamic10mod-dep.so
: $(objpfx
)tst-tls-manydynamic12mod-dep.so
2701 $(objpfx
)tst-tls-manydynamic12mod-dep.so
: $(objpfx
)tst-tls-manydynamic13mod-dep.so
2702 # Long chain with two double dependencies in the middle
2703 $(objpfx
)tst-tls-manydynamic14mod-dep.so
: $(objpfx
)tst-tls-manydynamic15mod-dep.so
2704 $(objpfx
)tst-tls-manydynamic15mod-dep.so
: $(objpfx
)tst-tls-manydynamic16mod-dep.so \
2705 $(objpfx
)tst-tls-manydynamic17mod-dep.so
2706 $(objpfx
)tst-tls-manydynamic16mod-dep.so
: $(objpfx
)tst-tls-manydynamic18mod-dep.so \
2707 $(objpfx
)tst-tls-manydynamic19mod-dep.so
2708 # Same but with an invalid module.
2709 # Single dependency.
2710 $(objpfx
)tst-tls-manydynamic0mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2711 LDFLAGS-tst-tls-manydynamic0mod-dep-bad.so
= -Wl
,--no-as-needed
2712 # Double dependencies.
2713 $(objpfx
)tst-tls-manydynamic1mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic2mod-dep-bad.so \
2714 $(objpfx
)tst-tls20mod-bad.so
2715 LDFLAGS-tst-tls-manydynamic1mod-dep-bad.so
= -Wl
,--no-as-needed
2716 # Double dependencies with each dependency dependent of another module.
2717 $(objpfx
)tst-tls-manydynamic3mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so \
2718 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
2719 LDFLAGS-tst-tls-manydynamic3mod-dep-bad.so
= -Wl
,--no-as-needed
2720 $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2721 LDFLAGS-tst-tls-manydynamic4mod-dep-bad.so
= -Wl
,--no-as-needed
2722 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2723 LDFLAGS-tst-tls-manydynamic5mod-dep-bad.so
= -Wl
,--no-as-needed
2724 # Long chain with one double dependency in the middle
2725 $(objpfx
)tst-tls-manydynamic6mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so \
2726 $(objpfx
)tst-tls-manydynamic8mod-dep-bad.so
2727 LDFLAGS-tst-tls-manydynamic6mod-dep-bad.so
= -Wl
,--no-as-needed
2728 $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
2729 LDFLAGS-tst-tls-manydynamic7mod-dep-bad.so
= -Wl
,--no-as-needed
2730 $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2731 LDFLAGS-tst-tls-manydynamic9mod-dep-bad.so
= -Wl
,--no-as-needed
2732 # Long chain with two double dependencies in the middle
2733 $(objpfx
)tst-tls-manydynamic10mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
2734 LDFLAGS-tst-tls-manydynamic10mod-dep-bad.so
= -Wl
,--no-as-needed
2735 $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so \
2736 $(objpfx
)tst-tls-manydynamic13mod-dep-bad.so
2737 LDFLAGS-tst-tls-manydynamic11mod-dep-bad.so
= -Wl
,--no-as-needed
2738 $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic14mod-dep-bad.so \
2739 $(objpfx
)tst-tls20mod-bad.so
2740 LDFLAGS-tst-tls-manydynamic12mod-dep-bad.so
= -Wl
,--no-as-needed
2741 $(objpfx
)tst-tls20
: $(shared-thread-library
)
2742 $(objpfx
)tst-tls20.out
: $(objpfx
)tst-tls20mod-bad.so \
2743 $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
) \
2744 $(tst-tls-many-dynamic-modules-dep
:%=$(objpfx
)%.so
) \
2745 $(tst-tls-many-dynamic-modules-dep-bad
:%=$(objpfx
)%.so
) \
2747 # Reuses tst-tls-many-dynamic-modules
2748 $(objpfx
)tst-tls21
: $(shared-thread-library
)
2749 $(objpfx
)tst-tls21.out
: $(objpfx
)tst-tls21mod.so
2750 $(objpfx
)tst-tls21mod.so
: $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
)
2752 $(objpfx
)tst-getauxval-static.out
: $(objpfx
)tst-auxvalmod.so
2753 tst-getauxval-static-ENV
= LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
)
2755 $(objpfx
)tst-dlmopen-gethostbyname.out
: $(objpfx
)tst-dlmopen-gethostbyname-mod.so
2757 $(objpfx
)tst-ro-dynamic
: $(objpfx
)tst-ro-dynamic-mod.so
2758 $(objpfx
)tst-ro-dynamic-mod.so
: $(objpfx
)tst-ro-dynamic-mod.os \
2759 tst-ro-dynamic-mod.map
2760 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@ \
2762 -Wl
,--script
=tst-ro-dynamic-mod.map \
2763 $(objpfx
)tst-ro-dynamic-mod.os
2765 $(objpfx
)tst-rtld-list-diagnostics.out
: tst-rtld-list-diagnostics.py \
2766 $(..
)manual
/dynlink.texi
$(objpfx
)$(rtld-installed-name
)
2767 $(PYTHON
) tst-rtld-list-diagnostics.py \
2768 --manual
=$(..
)manual
/dynlink.texi \
2769 "$(test-wrapper-env) $(objpfx)$(rtld-installed-name) --list-diagnostics" \
2773 $(objpfx
)tst-rtld-run-static.out
: $(objpfx
)/ldconfig
2775 $(objpfx
)tst-dl_find_object.out
: \
2776 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2777 $(objpfx
)tst-dl_find_object-static.out
: \
2778 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2779 tst-dl_find_object-static-ENV
= $(static-dlopen-environment
)
2780 CFLAGS-tst-dl_find_object.c
+= -funwind-tables
2781 CFLAGS-tst-dl_find_object-static.c
+= -funwind-tables
2782 LDFLAGS-tst-dl_find_object-static
+= -Wl
,--eh-frame-hdr
2783 CFLAGS-tst-dl_find_object-mod1.c
+= -funwind-tables
2784 CFLAGS-tst-dl_find_object-mod2.c
+= -funwind-tables
2785 LDFLAGS-tst-dl_find_object-mod2.so
+= -Wl
,--enable-new-dtags
,-z
,nodelete
2786 $(objpfx
)tst-dl_find_object-threads
: $(shared-thread-library
)
2787 CFLAGS-tst-dl_find_object-threads.c
+= -funwind-tables
2788 $(objpfx
)tst-dl_find_object-threads.out
: \
2789 $(objpfx
)tst-dl_find_object-mod1.so \
2790 $(objpfx
)tst-dl_find_object-mod2.so \
2791 $(objpfx
)tst-dl_find_object-mod3.so \
2792 $(objpfx
)tst-dl_find_object-mod4.so \
2793 $(objpfx
)tst-dl_find_object-mod5.so \
2794 $(objpfx
)tst-dl_find_object-mod6.so \
2795 $(objpfx
)tst-dl_find_object-mod7.so \
2796 $(objpfx
)tst-dl_find_object-mod8.so \
2797 $(objpfx
)tst-dl_find_object-mod9.so
2798 CFLAGS-tst-dl_find_object-mod3.c
+= -funwind-tables
2799 CFLAGS-tst-dl_find_object-mod4.c
+= -funwind-tables
2800 CFLAGS-tst-dl_find_object-mod5.c
+= -funwind-tables
2801 CFLAGS-tst-dl_find_object-mod6.c
+= -funwind-tables
2802 CFLAGS-tst-dl_find_object-mod7.c
+= -funwind-tables
2803 CFLAGS-tst-dl_find_object-mod8.c
+= -funwind-tables
2804 CFLAGS-tst-dl_find_object-mod9.c
+= -funwind-tables
2806 $(objpfx
)tst-p_alignmod-base.so
: $(libsupport
)
2807 LDFLAGS-tst-p_alignmod-base.so
+= -Wl
,-z
,max-page-size
=0x200000
2809 $(objpfx
)tst-p_align1
: $(objpfx
)tst-p_alignmod1.so
2811 # Make a copy of tst-p_alignmod-base.so and lower p_align of the first
2813 $(objpfx
)tst-p_alignmod1.so
: $(objpfx
)tst-p_alignmod-base.so
2815 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2816 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a half
$@
2818 $(objpfx
)tst-p_align2
: $(objpfx
)tst-p_alignmod2.so
2820 # Make a copy of tst-p_alignmod-base.so and update p_align of the first
2822 $(objpfx
)tst-p_alignmod2.so
: $(objpfx
)tst-p_alignmod-base.so
2824 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2825 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a
1 $@
2827 LDFLAGS-tst-p_alignmod3.so
+= -Wl
,-z
,max-page-size
=0x100,-z
,common-page-size
=0x100
2829 $(objpfx
)tst-p_align3
: $(objpfx
)tst-p_alignmod3.so
2830 $(objpfx
)tst-p_align3.out
: tst-p_align3.sh
$(objpfx
)tst-p_align3
2831 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)'; \
2834 $(objpfx
)check-abi-version-libc.out
: $(common-objpfx
)libc.so
2835 LC_ALL
=C
$(READELF
) -V
-W
$< \
2836 | sed
-ne
'/.gnu.version_d/, /.gnu.version_r/ p' \
2837 | grep GLIBC_ABI_DT_RELR
> $@
; \
2840 $(objpfx
)check-tst-relr-pie.out
: $(objpfx
)tst-relr-pie
2841 LC_ALL
=C
$(OBJDUMP
) -p
$< \
2842 | sed
-ne
'/required from libc.so/,$$ p' \
2843 | grep GLIBC_ABI_DT_RELR
> $@
; \
2846 # The test checks if a DT_RELR shared library without DT_NEEDED works as
2847 # intended, so it uses an explicit link rule.
2848 $(objpfx
)tst-relr2
: $(objpfx
)tst-relr-mod2.so
2849 $(objpfx
)tst-relr-mod2.so
: $(objpfx
)tst-relr-mod2.os
2850 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2851 $(LDFLAGS-soname-fname
) \
2852 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2853 $(call after-link
,$@.new
)
2856 # The test checks if a DT_RELR shared library without DT_VERNEED works as
2857 # intended, so it uses an explicit link rule.
2858 $(objpfx
)tst-relr3
: $(objpfx
)tst-relr-mod3a.so
2859 $(objpfx
)tst-relr-mod3b.so
: $(objpfx
)tst-relr-mod3b.os
2860 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2861 $(LDFLAGS-soname-fname
) \
2862 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2863 $(call after-link
,$@.new
)
2866 $(objpfx
)tst-relr-mod3a.so
: $(objpfx
)tst-relr-mod3a.os \
2867 $(objpfx
)tst-relr-mod3b.so
2868 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2869 $(LDFLAGS-soname-fname
) $(LDFLAGS-rpath-ORIGIN
) \
2870 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2871 $(call after-link
,$@.new
)
2874 # The test checks if a DT_RELR shared library without libc.so on DT_NEEDED
2875 # works as intended, so it uses an explicit link rule.
2876 $(objpfx
)tst-relr4
: $(objpfx
)tst-relr-mod4a.so
2877 $(objpfx
)tst-relr-mod4b.so
: $(objpfx
)tst-relr-mod4b.os
2878 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2879 $(LDFLAGS-soname-fname
) \
2880 -Wl
,--version-script
=tst-relr-mod4b.map \
2881 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2882 $(call after-link
,$@.new
)
2885 $(objpfx
)tst-relr-mod4a.so
: $(objpfx
)tst-relr-mod4a.os \
2886 $(objpfx
)tst-relr-mod4b.so
2887 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2888 $(LDFLAGS-soname-fname
) $(LDFLAGS-rpath-ORIGIN
) \
2889 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2890 $(call after-link
,$@.new
)
2893 LDFLAGS-libtracemod1-1.so
+= -Wl
,-soname
,libtracemod1.so
2894 LDFLAGS-libtracemod2-1.so
+= -Wl
,-soname
,libtracemod2.so
2895 LDFLAGS-libtracemod3-1.so
+= -Wl
,-soname
,libtracemod3.so
2896 LDFLAGS-libtracemod4-1.so
+= -Wl
,-soname
,libtracemod4.so
2897 LDFLAGS-libtracemod5-1.so
+= -Wl
,-soname
,libtracemod5.so
2899 $(objpfx
)libtracemod1-1.so
: $(objpfx
)libtracemod2-1.so \
2900 $(objpfx
)libtracemod3-1.so
2901 $(objpfx
)libtracemod2-1.so
: $(objpfx
)libtracemod4-1.so \
2902 $(objpfx
)libtracemod5-1.so
2904 define libtracemod-x
2905 $(objpfx
)libtracemod
$(1)/libtracemod
$(1).so
: $(objpfx
)libtracemod
$(1)-1.so
2906 $$(make-target-directory
)
2909 libtracemod-suffixes
= 1 2 3 4 5
2910 $(foreach i
,$(libtracemod-suffixes
), $(eval
$(call libtracemod-x
,$(i
))))
2912 define tst-trace-skeleton
2913 $(objpfx
)tst-trace
$(1).out
: $(objpfx
)libtracemod1
/libtracemod1.so \
2914 $(objpfx
)libtracemod2
/libtracemod2.so \
2915 $(objpfx
)libtracemod3
/libtracemod3.so \
2916 $(objpfx
)libtracemod4
/libtracemod4.so \
2917 $(objpfx
)libtracemod5
/libtracemod5.so \
2918 $(..
)scripts
/tst-ld-trace.py \
2920 ${ $(PYTHON
) $(..
)scripts
/tst-ld-trace.py \
2921 "$(test-wrapper-env) $(elf-objpfx)$(rtld-installed-name) \
2922 --library-path $(common-objpfx):$(strip $(2)) \
2923 $(objpfx)libtracemod1/libtracemod1.so" tst-trace
$(1).exp \
2924 } > $$@
; $$(evaluate-test
)
2927 $(eval
$(call tst-trace-skeleton
,1,))
2928 $(eval
$(call tst-trace-skeleton
,2,\
2929 $(objpfx
)libtracemod2
))
2930 $(eval
$(call tst-trace-skeleton
,3,\
2931 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
))
2932 $(eval
$(call tst-trace-skeleton
,4,\
2933 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
:$(objpfx
)libtracemod4
))
2934 $(eval
$(call tst-trace-skeleton
,5,\
2935 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
:$(objpfx
)libtracemod4
:$(objpfx
)libtracemod5
))
2937 $(objpfx
)tst-tls-allocation-failure-static-patched
: \
2938 $(objpfx
)tst-tls-allocation-failure-static
$(..
)scripts
/tst-elf-edit.py
2940 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
--maximize-tls-size
$@
2942 $(objpfx
)tst-tls-allocation-failure-static-patched.out
: \
2943 $(objpfx
)tst-tls-allocation-failure-static-patched
2944 $< > $@
2>&1; echo
"status: $$?" >> $@
2945 grep
-q
'^Fatal glibc error: Cannot allocate TLS block$$' $@ \
2946 && grep
-q
'^status: 127$$' $@
; \
2949 $(objpfx
)tst-audit-tlsdesc
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
2950 $(objpfx
)tst-audit-tlsdesc-mod2.so \
2951 $(shared-thread-library
)
2952 ifeq (yes
,$(have-mtls-dialect-gnu2
))
2953 # The test is valid for all TLS types, but we want to exercise GNU2
2955 CFLAGS-tst-audit-tlsdesc-mod1.c
+= -mtls-dialect
=gnu2
2956 CFLAGS-tst-audit-tlsdesc-mod2.c
+= -mtls-dialect
=gnu2
2958 $(objpfx
)tst-audit-tlsdesc-dlopen
: $(shared-thread-library
)
2959 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
2960 $(objpfx
)tst-audit-tlsdesc-mod2.so
2961 $(objpfx
)tst-audit-tlsdesc-mod1.so
: $(objpfx
)tst-audit-tlsdesc-mod2.so
2962 $(objpfx
)tst-audit-tlsdesc.out
: $(objpfx
)tst-auditmod-tlsdesc.so
2963 tst-audit-tlsdesc-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
2964 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-auditmod-tlsdesc.so
2965 tst-audit-tlsdesc-dlopen-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
2967 $(objpfx
)tst-dlmopen-twice.out
: \
2968 $(objpfx
)tst-dlmopen-twice-mod1.so \
2969 $(objpfx
)tst-dlmopen-twice-mod2.so
2971 LDFLAGS-tst-sprof-mod.so
= -Wl
,-soname
,tst-sprof-mod.so
2972 $(objpfx
)tst-sprof-basic
: $(objpfx
)tst-sprof-mod.so
2973 $(objpfx
)tst-sprof-basic.out
: tst-sprof-basic.sh
$(objpfx
)tst-sprof-basic
2974 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
2975 '$(run-program-env)' > $@
; \
2977 generated
+= tst-sprof-mod.so.profile
2979 LDFLAGS-tst-dlclose-lazy-mod1.so
= -Wl
,-z
,lazy
,--no-as-needed
2980 $(objpfx
)tst-dlclose-lazy-mod1.so
: $(objpfx
)tst-dlclose-lazy-mod2.so
2981 $(objpfx
)tst-dlclose-lazy.out
: \
2982 $(objpfx
)tst-dlclose-lazy-mod1.so
$(objpfx
)tst-dlclose-lazy-mod2.so