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
314 $(tests-static-internal
) \
318 tests-static
:= $(tests-static-normal
) $(tests-static-internal
)
320 ifeq (yes
,$(build-shared
))
322 tst-single_threaded-static-dlopen \
326 static-dlopen-environment
= \
327 LD_LIBRARY_PATH
=$(ld-library-path
):$(common-objpfx
)dlfcn
328 tst-tls9-static-ENV
= $(static-dlopen-environment
)
329 tst-single_threaded-static-dlopen-ENV
= $(static-dlopen-environment
)
330 tst-rootdir-ENV
= LD_LIBRARY_PATH
=/
371 tst-audit-tlsdesc-dlopen \
402 tst-dlmopen-dlerror \
403 tst-dlmopen-gethostbyname \
409 tst-dlopen-tlsmodid \
415 tst-filterobj-dlopen \
417 tst-glibc-hwcaps-mask \
418 tst-glibc-hwcaps-prepend \
421 tst-initfinilazyfail \
427 tst-nodelete-dlclose \
428 tst-nodelete-opened \
437 tst-rtld-run-static \
438 tst-single_threaded \
439 tst-single_threaded-pthread \
440 tst-sonamemove-dlopen \
441 tst-sonamemove-link \
446 tst-tls-manydynamic \
462 tst-tlsalign-extern \
476 tst-dlopen-nodelete-reloc \
482 tests
+= $(if
$(CXX
),$(tests-cxx
))
493 tst-dl-hwcaps_split \
495 tst-dl_find_object-threads \
509 tst-dlopen-self-container \
510 tst-dlopen-tlsmodid-container \
512 tst-preload-pthread-libc \
521 ifeq (yes
,$(have-fpie
))
522 tests-pie
+= tst-align3
524 selinux-enabled
:= $(shell cat
/selinux
/enforce
2> /dev
/null
)
526 ifneq ($(selinux-enabled
),1)
527 tests-execstack-yes
= \
529 tst-execstack-needed \
531 # tests-execstack-yes
533 ifeq ($(have-depaudit
),yes
)
540 ifeq ($(run-built-tests
),yes
)
542 $(objpfx
)tst-audit14-cmp.out \
543 $(objpfx
)tst-audit14a-cmp.out \
544 $(objpfx
)tst-audit15-cmp.out \
545 $(objpfx
)tst-audit16-cmp.out \
549 ifeq ($(have-dt-relr
),yes
)
556 modules-names-dt-relr
= \
562 # modules-names-dt-relr
563 modules-names
+= $(modules-names-dt-relr
)
564 # These shared libraries have special build rules.
565 modules-names-nobuild
+= $(modules-names-dt-relr
)
566 ifeq ($(have-fpie
),yes
)
574 $(objpfx
)check-tst-relr-pie.out \
577 CFLAGS-tst-relr-pie.c
+= $(pie-ccflag
)
578 LDFLAGS-tst-relr
+= -Wl
,-z
,pack-relative-relocs
579 LDFLAGS-tst-relr-pie
+= -Wl
,-z
,pack-relative-relocs
580 CFLAGS-tst-relr-mod2.c
+= $(no-stack-protector
)
581 CFLAGS-tst-relr-mod3a.c
+= $(no-stack-protector
)
582 CFLAGS-tst-relr-mod3b.c
+= $(no-stack-protector
)
583 CFLAGS-tst-relr-mod4a.c
+= $(no-stack-protector
)
584 CFLAGS-tst-relr-mod4b.c
+= $(no-stack-protector
)
588 tests-special
+= $(objpfx
)tst-relro-ldso.out
$(objpfx
)tst-relro-libc.out
589 $(objpfx
)tst-relro-ldso.out
: tst-relro-symbols.py
$(..
)/scripts
/glibcelf.py \
591 $(PYTHON
) tst-relro-symbols.py
$(objpfx
)ld.so \
592 --required
=_rtld_global_ro \
593 > $@
2>&1; $(evaluate-test
)
594 # The optional symbols are present in libc only if the architecture has
595 # the GLIBC_2.0 symbol set in libc.
596 $(objpfx
)tst-relro-libc.out
: tst-relro-symbols.py
$(..
)/scripts
/glibcelf.py \
597 $(common-objpfx
)libc.so
598 $(PYTHON
) tst-relro-symbols.py
$(common-objpfx
)libc.so \
599 --required
=_IO_file_jumps \
600 --required
=_IO_wfile_jumps \
601 --required
=__io_vtables \
602 > $@
2>&1; $(evaluate-test
)
604 ifeq ($(run-built-tests
),yes
)
605 tests-special
+= $(objpfx
)tst-valgrind-smoke.out
607 $(objpfx
)tst-valgrind-smoke.out
: tst-valgrind-smoke.sh
$(objpfx
)ld.so
$(objpfx
)valgrind-test
608 $(SHELL
) $< $(objpfx
)ld.so
$(rtlddir
)/$(rtld-installed-name
) '$(test-wrapper-env)' \
609 '$(run-program-env)' '$(rpath-link)' $(objpfx
)valgrind-test
> $@
; $(evaluate-test
)
611 tests
+= $(tests-execstack-
$(have-z-execstack
))
612 ifeq ($(run-built-tests
),yes
)
614 $(objpfx
)noload-mem.out \
615 $(objpfx
)tst-ldconfig-X.out \
616 $(objpfx
)tst-ldconfig-p.out \
617 $(objpfx
)tst-ldconfig-soname.out \
618 $(objpfx
)tst-leaks1-mem.out \
619 $(objpfx
)tst-rtld-help.out \
622 tlsmod17a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
623 tlsmod18a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
624 tlsmod17a-modules
= $(addprefix tst-tlsmod17a
, $(tlsmod17a-suffixes
))
625 tlsmod18a-modules
= $(addprefix tst-tlsmod18a
, $(tlsmod17a-suffixes
))
626 one-hundred
= $(foreach x
,0 1 2 3 4 5 6 7 8 9, \
627 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
628 tst-tls-many-dynamic-modules
:= \
629 $(foreach n
,$(one-hundred
),tst-tls-manydynamic
$(n
)mod
)
630 tst-tls-many-dynamic-modules-dep-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 \
632 tst-tls-many-dynamic-modules-dep
= \
633 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-suffixes
),tst-tls-manydynamic
$(n
)mod-dep
)
634 tst-tls-many-dynamic-modules-dep-bad-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
635 tst-tls-many-dynamic-modules-dep-bad
= \
636 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-bad-suffixes
),tst-tls-manydynamic
$(n
)mod-dep-bad
)
638 $(tlsmod17a-modules
:=.os
) \
639 $(tlsmod18a-modules
:=.os
) \
640 tst-tlsalign-vars.o \
745 tst-absolute-sym-lib \
746 tst-absolute-zero-lib \
752 tst-audit-tlsdesc-mod1 \
753 tst-audit-tlsdesc-mod2 \
787 tst-auditmod-tlsdesc \
812 tst-dl_find_object-mod1 \
813 tst-dl_find_object-mod2 \
814 tst-dl_find_object-mod3 \
815 tst-dl_find_object-mod4 \
816 tst-dl_find_object-mod5 \
817 tst-dl_find_object-mod6 \
818 tst-dl_find_object-mod7 \
819 tst-dl_find_object-mod8 \
820 tst-dl_find_object-mod9 \
821 tst-dlclose-lazy-mod1 \
822 tst-dlclose-lazy-mod2 \
823 tst-dlmopen-dlerror-mod \
824 tst-dlmopen-gethostbyname-mod \
825 tst-dlmopen-twice-mod1 \
826 tst-dlmopen-twice-mod2 \
828 tst-dlopenfaillinkmod \
832 tst-dlopenfailnodelmod \
835 tst-filterobj-filtee \
837 tst-finilazyfailmod \
839 tst-initlazyfailmod \
851 tst-ldconfig-ld-mod \
852 tst-ldconfig-soname-lib-with-soname \
853 tst-ldconfig-soname-lib-without-soname \
855 tst-nodelete-dlclose-dso \
856 tst-nodelete-dlclose-plugin \
857 tst-nodelete-opened-lib \
860 tst-p_alignmod-base \
866 tst-single_threaded-mod1 \
867 tst-single_threaded-mod2 \
868 tst-single_threaded-mod3 \
869 tst-single_threaded-mod4 \
870 tst-sonamemove-linkmod1 \
871 tst-sonamemove-runmod1 \
872 tst-sonamemove-runmod2 \
912 tst-unwind-ctor-lib \
938 modules-names-cxx
= \
939 tst-dlopen-nodelete-reloc-mod1 \
940 tst-dlopen-nodelete-reloc-mod2 \
941 tst-dlopen-nodelete-reloc-mod3 \
942 tst-dlopen-nodelete-reloc-mod4 \
943 tst-dlopen-nodelete-reloc-mod5 \
944 tst-dlopen-nodelete-reloc-mod6 \
945 tst-dlopen-nodelete-reloc-mod7 \
946 tst-dlopen-nodelete-reloc-mod8 \
947 tst-dlopen-nodelete-reloc-mod9 \
948 tst-dlopen-nodelete-reloc-mod10 \
949 tst-dlopen-nodelete-reloc-mod11 \
950 tst-dlopen-nodelete-reloc-mod12 \
951 tst-dlopen-nodelete-reloc-mod13 \
952 tst-dlopen-nodelete-reloc-mod14 \
953 tst-dlopen-nodelete-reloc-mod15 \
954 tst-dlopen-nodelete-reloc-mod16 \
955 tst-dlopen-nodelete-reloc-mod17 \
956 tst-nodelete-rtldmod \
957 tst-nodelete-uniquemod \
965 $(if
$(CXX
),$(modules-names-cxx
)) \
966 $(modules-execstack-
$(have-z-execstack
)) \
967 $(tlsmod17a-modules
) \
968 $(tlsmod18a-modules
) \
969 $(tst-tls-many-dynamic-modules
) \
970 $(tst-tls-many-dynamic-modules-dep
) \
971 $(tst-tls-many-dynamic-modules-dep-bad
) \
974 # Most modules build with _ISOMAC defined, but those filtered out
975 # depend on internal headers.
976 modules-names-tests
= $(filter-out ifuncmod
% tst-tlsmod
%,\
979 # For +depfiles in Makerules.
980 extra-test-objs
+= tst-auditmod17.os
982 ifeq (yes
,$(have-mtls-dialect-gnu2
))
983 tests
+= tst-gnu2-tls1
984 modules-names
+= tst-gnu2-tls1mod
985 $(objpfx
)tst-gnu2-tls1
: $(objpfx
)tst-gnu2-tls1mod.so
986 tst-gnu2-tls1mod.so-no-z-defs
= yes
987 CFLAGS-tst-gnu2-tls1mod.c
+= -mtls-dialect
=gnu2
988 endif # $(have-mtls-dialect-gnu2)
990 ifeq (yes
,$(have-protected-data
))
991 modules-names
+= tst-protected1moda tst-protected1modb
992 tests
+= tst-protected1a tst-protected1b
993 $(objpfx
)tst-protected1a
: $(addprefix $(objpfx
),tst-protected1moda.so tst-protected1modb.so
)
994 $(objpfx
)tst-protected1b
: $(addprefix $(objpfx
),tst-protected1modb.so tst-protected1moda.so
)
995 tst-protected1modb.so-no-z-defs
= yes
996 # These tests fail with GCC versions prior to 5.1 and with some versions
997 # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
998 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
999 # Perhaps in future we can make these XFAILs conditional on some detection
1000 # of compiler/linker behavior/version.
1001 test-xfail-tst-protected1a
= yes
1002 test-xfail-tst-protected1b
= yes
1004 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1005 modules-names
+= tst-piemod1
1006 tests
+= tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \
1008 tests-pie
+= tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie
1009 ifeq (yes
,$(have-protected-data
))
1011 tests-pie
+= vismain
1012 CFLAGS-vismain.c
+= $(PIE-ccflag
)
1015 modules-execstack-yes
= tst-execstack-mod
1016 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
1018 # filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special
1020 modules-names-nobuild
+= \
1025 tst-ro-dynamic-mod \
1026 # modules-names-nobuild
1028 tests
+= $(tests-static
)
1030 ifeq (yes
,$(have-ifunc
))
1031 tests-ifuncstatic
:= \
1032 ifuncmain1picstatic \
1034 ifuncmain2picstatic \
1036 ifuncmain4picstatic \
1038 ifuncmain5picstatic \
1040 ifuncmain7picstatic \
1043 ifeq (yes
,$(have-gcc-ifunc
))
1044 tests-ifuncstatic
+= ifuncmain9static ifuncmain9picstatic
1046 tests-static
+= $(tests-ifuncstatic
)
1047 tests-internal
+= $(tests-ifuncstatic
)
1048 ifeq (yes
,$(build-shared
))
1050 tst-ifunc-fault-bindnow \
1051 tst-ifunc-fault-lazy \
1053 # Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8.
1056 ifuncmain1staticpic \
1063 ifuncmain5staticpic \
1067 ifeq (no
,$(with-lld
))
1074 ifeq (yes
,$(have-gcc-ifunc
))
1080 ifunc-test-modules
= \
1087 # ifunc-test-modules
1088 extra-test-objs
+= $(ifunc-test-modules
:=.o
)
1089 test-internal-extras
+= $(ifunc-test-modules
)
1090 ifeq (yes
,$(have-fpie
))
1093 ifuncmain1staticpie \
1098 ifeq (yes
,$(have-gcc-ifunc
))
1099 ifunc-pie-tests
+= ifuncmain9pie
1101 ifeq (no
,$(with-lld
))
1102 ifunc-pie-tests
+= ifuncmain5pie
1104 ifeq (yes
,$(have-textrel_ifunc
))
1105 ifunc-pie-tests
+= tst-ifunc-textrel
1107 tests-internal
+= $(ifunc-pie-tests
)
1108 tests-pie
+= $(ifunc-pie-tests
)
1115 ifeq (no
,$(with-lld
))
1116 modules-names
+= ifuncmod5
1121 ifeq (yes
,$(build-shared
))
1122 ifeq ($(run-built-tests
),yes
)
1124 $(objpfx
)argv0test.out \
1125 $(objpfx
)tst-pathopt.out \
1126 $(objpfx
)tst-rtld-help.out \
1127 $(objpfx
)tst-rtld-list-diagnostics.out \
1128 $(objpfx
)tst-rtld-load-self.out \
1129 $(objpfx
)tst-rtld-preload.out \
1130 $(objpfx
)tst-sprof-basic.out \
1134 $(objpfx
)check-execstack.out \
1135 $(objpfx
)check-initfini.out \
1136 $(objpfx
)check-localplt.out \
1137 $(objpfx
)check-textrel.out \
1138 $(objpfx
)check-wx-segment.out \
1142 ifeq ($(run-built-tests
),yes
)
1144 $(objpfx
)order-cmp.out \
1145 $(objpfx
)order2-cmp.out \
1146 $(objpfx
)tst-array1-cmp.out \
1147 $(objpfx
)tst-array1-static-cmp.out \
1148 $(objpfx
)tst-array2-cmp.out \
1149 $(objpfx
)tst-array3-cmp.out \
1150 $(objpfx
)tst-array4-cmp.out \
1151 $(objpfx
)tst-array5-cmp.out \
1152 $(objpfx
)tst-array5-static-cmp.out \
1153 $(objpfx
)tst-initorder-cmp.out \
1154 $(objpfx
)tst-initorder2-cmp.out \
1155 $(objpfx
)tst-trace1.out \
1156 $(objpfx
)tst-trace2.out \
1157 $(objpfx
)tst-trace3.out \
1158 $(objpfx
)tst-trace4.out \
1159 $(objpfx
)tst-trace5.out \
1160 $(objpfx
)tst-unused-dep-cmp.out \
1161 $(objpfx
)tst-unused-dep.out \
1165 ifndef avoid-generated
1166 # DSO sorting tests:
1167 # The dso-ordering-test.py script generates testcase source files in $(objpfx),
1168 # creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a
1169 # Makefile fragment to be included.
1170 define include_dsosort_tests
1171 $(objpfx
)$(1).generated-makefile
: $(1)
1172 $(PYTHON
) $(..
)scripts
/dso-ordering-test.py \
1173 --description-file
$$< --objpfx
$(objpfx
) --output-makefile
$$@T
1175 -include $(objpfx
)$(1).generated-makefile
1179 postclean-generated
+= $(objpfx
)/dso-sort-tests-2.generated-makefile \
1180 $(objpfx
)/dso-sort-tests-2.generated-makefile
1182 # Generate from each testcase description file
1183 $(eval
$(call include_dsosort_tests
,dso-sort-tests-1.def
))
1184 $(eval
$(call include_dsosort_tests
,dso-sort-tests-2.def
))
1186 # BZ15311 is intentionally underlinked.
1187 LDFLAGS-tst-bz15311-b.so
+= -Wl
,-z
,lazy
1188 LDFLAGS-tst-bz15311-c.so
+= -Wl
,-z
,lazy
1189 LDFLAGS-tst-bz15311-d.so
+= -Wl
,-z
,lazy
1191 check-abi
: $(objpfx
)check-abi-ld.out \
1192 $(objpfx
)check-abi-version-libc.out
1194 $(objpfx
)check-abi-ld.out \
1195 $(objpfx
)check-abi-version-libc.out \
1197 update-abi
: update-abi-ld
1198 update-all-abi
: update-all-abi-ld
1200 tests-special
+= $(objpfx
)tst-glibcelf.out
1201 $(objpfx
)tst-glibcelf.out
: tst-glibcelf.py elf.h
$(..
)/scripts
/glibcelf.py \
1202 $(..
)/scripts
/glibcextract.py
1203 PYTHONPATH
=$(..
)scripts
$(PYTHON
) tst-glibcelf.py \
1204 --cc="$(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS))" \
1205 < /dev
/null
> $@
2>&1; $(evaluate-test
)
1207 ifeq ($(run-built-tests
),yes
)
1208 tests-special
+= $(objpfx
)tst-tls-allocation-failure-static-patched.out
1211 # The test requires shared _and_ PIE because the executable
1212 # unit test driver must be able to link with the shared object
1213 # that is going to eventually go into an installed DSO.
1214 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1215 tests-internal
+= tst-_dl_addr_inside_object
1216 tests-pie
+= tst-_dl_addr_inside_object
1217 $(objpfx
)tst-_dl_addr_inside_object
: $(objpfx
)dl-addr-obj.os
1218 CFLAGS-tst-_dl_addr_inside_object.c
+= $(PIE-ccflag
)
1223 ifeq (yes
,$(build-shared
))
1224 # Make sure these things are built in the `make lib' pass so they can be used
1225 # to run programs during the `make others' pass.
1226 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
1227 $(addprefix $(objpfx
),$(extra-objs
))
1230 # Command to link into a larger single relocatable object.
1231 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
1233 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
1234 $(reloc-link
) -o
$@
$^
1236 # Link together the dynamic linker into a single relocatable object.
1237 # First we do a link against libc_pic.a just to get a link map,
1238 # and discard the object produced by that link. From the link map
1239 # we can glean all the libc modules that need to go into the dynamic
1240 # linker. Then we do a recursive make that goes into all the subdirs
1241 # those modules come from and builds special rtld-foo.os versions that
1242 # are compiled with special flags, and puts these modules into rtld-libc.a
1243 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
1245 # These symbols need to be stubbed out during symbol discovery because
1246 # their implementation is provided differently in rtld, and the symbol
1247 # discovery mechanism is not compatible with the libc implementation
1248 # when compiled for libc.
1249 rtld-stubbed-symbols
= \
1250 __GI___pthread_disable_asynccancel \
1251 __GI___pthread_enable_asynccancel \
1252 __libc_assert_fail \
1253 __pthread_disable_asynccancel \
1254 __pthread_enable_asynccancel \
1259 # rtld-stubbed-symbols
1261 ifeq ($(have-ssp
),yes
)
1262 # rtld is not built with the stack protector, so these references will
1263 # go away in the rebuilds.
1264 rtld-stubbed-symbols
+= __stack_chk_fail __stack_chk_fail_local
1267 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
1269 for symbol in
$(rtld-stubbed-symbols
); do \
1270 echo
".globl $$symbol"; \
1272 done |
$(CC
) -o
$@T.o
$(ASFLAGS
) -c
-x assembler
-
1273 $(reloc-link
) -o
$@.o
$@T.o
'-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
1277 # For lld, skip preceding addresses and values before matching the archive and the member.
1278 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
1280 sed
-n
's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
1282 while read lib file
; do \
1285 LC_ALL
=C grep
-F
-l
/$$file \
1286 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
1288 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
1291 echo rtld-
$${lib
%%/*} += $$file ;; \
1292 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
1295 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
1296 | LC_ALL=C sort -u` >> $@T
1299 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
1300 $(MAKE
) -f
$< -f rtld-Rules
1302 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
1303 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
1306 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
1308 z-now-yes
= -Wl
,-z
,now
1310 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
1311 # Link into a temporary file so that we don't touch $@ at all
1312 # if the sanity check below fails.
1313 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
1314 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
1316 $(filter-out $(map-file
),$^
) $(load-map-file
) \
1317 -Wl
,-soname
=$(rtld-installed-name
)
1318 $(call after-link
,$@.new
)
1319 $(READELF
) -s
$@.new \
1320 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
1323 ifeq (yes
,$(build-shared
))
1324 # interp.c exists just to get the runtime linker path into libc.so.
1325 $(objpfx
)interp.os
: $(common-objpfx
)runtime-linker.h
1328 ifneq (ld.so
,$(rtld-installed-name
))
1329 # Make sure ld.so.1 exists in the build directory so we can link
1331 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
1333 generated
+= $(rtld-installed-name
)
1336 # Build a file mentioning all trustworthy directories to look for shared
1337 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
1338 # add directories to the list by defining $(user-defined-trusted-dirs)
1339 # before starting make.
1340 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
1341 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
1342 $(make-target-directory
)
1343 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
1344 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
1345 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
1346 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
1348 CPPFLAGS-dl-load.c
+= -I
$(objpfx
).
-I
$(csu-objpfx
).
1350 ifeq (yes
,$(build-shared
))
1351 $(inst_rtlddir
)/$(rtld-installed-name
): $(objpfx
)ld.so
$(+force)
1352 $(make-target-directory
)
1353 $(do-install-program
)
1355 # Creates the relative /usr/bin/ld.so symbolic link.
1356 $(inst_bindir
)/ld.so
: $(inst_rtlddir
)/$(rtld-installed-name
)
1357 $(make-target-directory
)
1360 # Special target called by parent to install just the dynamic linker.
1361 .PHONY
: ldso_install
1362 ldso_install
: $(inst_rtlddir
)/$(rtld-installed-name
)
1363 endif # $(build-shared)
1366 # Workarounds for ${exec_prefix} expansion in configure variables.
1367 # config.status cannot be used directly for processing ldd.bash.in or
1368 # expanding variables such as sysconfdir because the expansion
1369 # contains the literal string ${exec_prefix}, which is not valid in C
1370 # headers or installed shell scripts.
1372 ldd-rewrite
= -e
's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
1373 -e
's%@VERSION@%$(version)%g' \
1374 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
1375 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
1376 -e
's%@TEXTDOMAINDIR@%$(localedir)%g'
1378 ifeq ($(ldd-rewrite-script
),no
)
1380 LC_ALL
=C sed
$(ldd-rewrite
) < $< > $@.new
1384 LC_ALL
=C sed
$(ldd-rewrite
) < $< \
1385 | LC_ALL
=C sed
-f
$(patsubst $(..
)/%,/%,$(..
)$(ldd-rewrite-script
)) > $@.new
1389 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
1390 $(common-objpfx
)config.make
1395 $(objpfx
)sln
: $(sln-modules
:%=$(objpfx
)%.o
)
1397 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
1399 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
1400 CFLAGS-ldconfig.c
+= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
1401 -D
'SLIBDIR="$(slibdir)"'
1402 libof-ldconfig
= ldconfig
1403 CFLAGS-dl-cache.c
+= $(SYSCONF-FLAGS
)
1404 CFLAGS-cache.c
+= $(SYSCONF-FLAGS
)
1405 CFLAGS-rtld.c
+= $(SYSCONF-FLAGS
)
1406 CFLAGS-dl-usage.c
+= $(SYSCONF-FLAGS
) \
1407 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1408 CFLAGS-dl-diagnostics.c
+= $(SYSCONF-FLAGS
) \
1409 -D
'PREFIX="$(prefix)"' \
1410 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1412 cpp-srcs-left
:= $(all-rtld-routines
:=.os
)
1414 include $(patsubst %,$(..
)libof-iterator.mk
,$(cpp-srcs-left
))
1416 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
1417 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
1419 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
1420 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
1421 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
1422 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
1423 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
1424 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
1425 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
1426 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
1427 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
1428 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
1429 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1430 $(objpfx
)neededobj3.so
1431 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
1432 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
1433 $(objpfx
)firstobj.so
: $(shared-thread-library
)
1434 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
1435 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
1436 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
1437 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
1438 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
1439 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
1440 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
1441 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
1442 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
1443 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
1444 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
1445 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
1446 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
1447 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
1448 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
1449 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
1450 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
1451 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
1452 $(objpfx
)tst-tls19mod1.so
: $(objpfx
)tst-tls19mod2.so
$(objpfx
)tst-tls19mod3.so
1453 $(objpfx
)tst-tls19mod3.so
: $(objpfx
)ld.so
1454 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
1455 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
1456 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
1457 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
1458 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
1459 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
1460 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
1461 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
1462 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
1463 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
1464 $(objpfx
)unload8mod1.so
: $(objpfx
)unload8mod2.so
1465 $(objpfx
)unload8mod2.so
: $(objpfx
)unload8mod3.so
1466 $(objpfx
)tst-initordera2.so
: $(objpfx
)tst-initordera1.so
1467 $(objpfx
)tst-initorderb2.so
: $(objpfx
)tst-initorderb1.so
$(objpfx
)tst-initordera2.so
1468 $(objpfx
)tst-initordera3.so
: $(objpfx
)tst-initorderb2.so
$(objpfx
)tst-initorderb1.so
1469 $(objpfx
)tst-initordera4.so
: $(objpfx
)tst-initordera3.so
1470 $(objpfx
)tst-initorder
: $(objpfx
)tst-initordera4.so
$(objpfx
)tst-initordera1.so
$(objpfx
)tst-initorderb2.so
1471 $(objpfx
)tst-null-argv
: $(objpfx
)tst-null-argv-lib.so
1472 $(objpfx
)tst-tlsalign
: $(objpfx
)tst-tlsalign-lib.so
1473 $(objpfx
)tst-nodelete-opened.out
: $(objpfx
)tst-nodelete-opened-lib.so
1475 $(objpfx
)tst-tlsalign-extern
: $(objpfx
)tst-tlsalign-vars.o
1476 $(objpfx
)tst-tlsalign-extern-static
: $(objpfx
)tst-tlsalign-vars.o
1478 tst-null-argv-ENV
= LD_DEBUG
=all LD_DEBUG_OUTPUT
=$(objpfx
)tst-null-argv.debug.out
1479 LDFLAGS-nodel2mod3.so
= -Wl
,--no-as-needed
1480 LDFLAGS-reldepmod5.so
= -Wl
,--no-as-needed
1481 LDFLAGS-reldep6mod1.so
= -Wl
,--no-as-needed
1482 LDFLAGS-reldep6mod4.so
= -Wl
,--no-as-needed
1483 LDFLAGS-reldep8mod3.so
= -Wl
,--no-as-needed
1484 LDFLAGS-unload4mod1.so
= -Wl
,--no-as-needed
1485 LDFLAGS-unload4mod2.so
= -Wl
,--no-as-needed
1486 LDFLAGS-tst-initorder
= -Wl
,--no-as-needed
1487 LDFLAGS-tst-initordera2.so
= -Wl
,--no-as-needed
1488 LDFLAGS-tst-initordera3.so
= -Wl
,--no-as-needed
1489 LDFLAGS-tst-initordera4.so
= -Wl
,--no-as-needed
1490 LDFLAGS-tst-initorderb2.so
= -Wl
,--no-as-needed
1491 LDFLAGS-tst-tlsmod5.so
= -nostdlib
-Wl
,--no-as-needed
1492 LDFLAGS-tst-tlsmod6.so
= -nostdlib
-Wl
,--no-as-needed
1494 # The following tests are underlinked, and rely on late loading. On toolchains
1495 # that set -z now by default, this leads to failures to load or fix up the
1496 # executables being tested.
1497 LDFLAGS-circlemod2.so
= -Wl
,-z
,lazy
1498 LDFLAGS-tst-tls20mod-bad.so
= -Wl
,-z
,lazy
1499 LDFLAGS-reldep6mod1.so
+= -Wl
,-z
,lazy
1500 LDFLAGS-constload2.so
= -Wl
,-z
,lazy
1501 LDFLAGS-constload3.so
= -Wl
,-z
,lazy
1502 LDFLAGS-dblloadmod3.so
= -Wl
,-z
,lazy
1503 LDFLAGS-ifuncmod6.so
= -Wl
,-z
,lazy
1504 LDFLAGS-ltglobmod2.so
= -Wl
,-z
,lazy
1505 LDFLAGS-testobj1.so
= -Wl
,-z
,lazy
1506 LDFLAGS-testobj6.so
= -Wl
,-z
,lazy
1508 testobj1.so-no-z-defs
= yes
1509 testobj3.so-no-z-defs
= yes
1510 testobj4.so-no-z-defs
= yes
1511 testobj5.so-no-z-defs
= yes
1512 testobj6.so-no-z-defs
= yes
1513 failobj.so-no-z-defs
= yes
1514 constload2.so-no-z-defs
= yes
1515 constload3.so-no-z-defs
= yes
1516 nodelmod1.so-no-z-defs
= yes
1517 nodelmod2.so-no-z-defs
= yes
1518 nodelmod4.so-no-z-defs
= yes
1519 nodel2mod2.so-no-z-defs
= yes
1520 reldepmod2.so-no-z-defs
= yes
1521 reldepmod3.so-no-z-defs
= yes
1522 reldepmod4.so-no-z-defs
= yes
1523 reldep4mod4.so-no-z-defs
= yes
1524 reldep4mod2.so-no-z-defs
= yes
1525 ltglobmod2.so-no-z-defs
= yes
1526 dblloadmod3.so-no-z-defs
= yes
1527 tst-tlsmod1.so-no-z-defs
= yes
1528 tst-tlsmod2.so-no-z-defs
= yes
1529 tst-tlsmod3.so-no-z-defs
= yes
1530 tst-tlsmod4.so-no-z-defs
= yes
1531 tst-tlsmod7.so-no-z-defs
= yes
1532 tst-tlsmod8.so-no-z-defs
= yes
1533 tst-tlsmod9.so-no-z-defs
= yes
1534 tst-tlsmod10.so-no-z-defs
= yes
1535 tst-tlsmod12.so-no-z-defs
= yes
1536 tst-tlsmod14a.so-no-z-defs
= yes
1537 tst-tlsmod14b.so-no-z-defs
= yes
1538 tst-tlsmod15a.so-no-z-defs
= yes
1539 tst-tlsmod16b.so-no-z-defs
= yes
1540 circlemod2.so-no-z-defs
= yes
1541 circlemod3.so-no-z-defs
= yes
1542 circlemod3a.so-no-z-defs
= yes
1543 reldep8mod2.so-no-z-defs
= yes
1544 reldep9mod1.so-no-z-defs
= yes
1545 unload3mod4.so-no-z-defs
= yes
1546 unload4mod1.so-no-z-defs
= yes
1547 ifuncmod1.so-no-z-defs
= yes
1548 ifuncmod5.so-no-z-defs
= yes
1549 ifuncmod6.so-no-z-defs
= yes
1550 tst-auditmod9a.so-no-z-defs
= yes
1551 tst-auditmod9b.so-no-z-defs
= yes
1552 tst-nodelete-uniquemod.so-no-z-defs
= yes
1553 tst-nodelete-rtldmod.so-no-z-defs
= yes
1554 tst-nodelete-zmod.so-no-z-defs
= yes
1555 tst-nodelete2mod.so-no-z-defs
= yes
1557 ifeq ($(build-shared
),yes
)
1558 # Build all the modules even when not actually running test programs.
1559 tests
: $(test-modules
)
1562 LDFLAGS-loadtest
= -rdynamic
1564 $(objpfx
)loadtest.out
: $(test-modules
)
1566 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1567 $(objpfx
)neededobj3.so
1569 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1570 $(objpfx
)neededobj3.so
1572 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1573 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
1575 $(objpfx
)neededtest4
: $(objpfx
)neededobj1.so
1576 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
1578 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
1579 LDFLAGS-restest1
= -rdynamic
1581 LDFLAGS-restest2
= -rdynamic
1583 $(objpfx
)restest1.out
: $(test-modules
)
1585 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
1586 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
1587 LDFLAGS-preloadtest
= -rdynamic
1588 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1590 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1592 LDFLAGS-loadfail
= -rdynamic
1594 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
$(objpfx
)testobj1.so \
1595 $(objpfx
)testobj2.so
$(objpfx
)testobj3.so \
1596 $(objpfx
)testobj4.so
$(objpfx
)testobj5.so
1598 LDFLAGS-multiload
= -rdynamic
1599 CFLAGS-multiload.c
+= -DOBJDIR
=\"$(elf-objpfx
)\"
1601 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
1603 LDFLAGS-origtest
= -rdynamic
1604 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
1606 $(objpfx
)resolvfail.out
: $(objpfx
)testobj1.so
1607 ifeq ($(have-thread-library
),yes
)
1608 $(objpfx
)resolvfail
: $(shared-thread-library
)
1611 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
1613 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
1614 $(objpfx
)circlemod1a.so
1616 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
1617 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
1618 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
1619 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
1621 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
1623 $(objpfx
)order-cmp.out
: $(objpfx
)order.out
1624 (echo
"0123456789" | cmp
$< -) > $@
; \
1627 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
1628 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
1629 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
1631 $(objpfx
)noload
: $(objpfx
)testobj1.so
1632 LDFLAGS-noload
= -rdynamic
-Wl
,--no-as-needed
1633 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
1635 $(objpfx
)noload-mem.out
: $(objpfx
)noload.out
1636 $(common-objpfx
)malloc
/mtrace
$(objpfx
)noload.mtrace
> $@
; \
1638 noload-ENV
= MALLOC_TRACE
=$(objpfx
)noload.mtrace \
1639 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
1641 LDFLAGS-nodelete
= -rdynamic
1642 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1643 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1644 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
1645 $(objpfx
)nodelmod3.so
1647 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
1648 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
1650 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
1651 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
1653 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
1654 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
1656 -L
$(subst :, -L
,$(rpath-link
)) \
1657 -Wl
,-rpath-link
=$(rpath-link
) \
1658 $< -Wl
,-F
,$(objpfx
)filtmod2.so
1659 $(objpfx
)filter: $(objpfx
)filtmod1.so
1661 # This does not link against libc.
1662 CFLAGS-filtmod1.c
+= $(no-stack-protector
)
1664 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
1666 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
1668 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
1670 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1672 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
1674 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
1675 LDFLAGS-next
= -Wl
,--no-as-needed
1677 $(objpfx
)tst-next-ver
: $(objpfx
)nextmod3.so
1678 LDFLAGS-tst-next-ver
= -Wl
,--no-as-needed
1680 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
1682 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
1684 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
1685 $(objpfx
)pathoptobj.so
1686 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
1687 '$(run-program-env)'; \
1690 $(objpfx
)tst-rtld-load-self.out
: tst-rtld-load-self.sh
$(objpfx
)ld.so
1691 $(SHELL
) $^
'$(test-wrapper)' '$(test-wrapper-env)' > $@
; \
1694 tst-rtld-preload-OBJS
= $(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1695 $(objpfx
)tst-rtld-preload.out
: tst-rtld-preload.sh
$(objpfx
)ld.so \
1696 $(objpfx
)preloadtest \
1697 $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1698 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)preloadtest \
1699 '$(test-wrapper-env)' '$(run_program_env)' \
1700 '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@
; \
1703 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
1705 $(objpfx
)global
: $(objpfx
)globalmod1.so
1706 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1708 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1710 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1712 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
1714 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
1716 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
1718 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
1720 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1721 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
1723 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
1725 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
1727 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
1729 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
1731 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
1733 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
1735 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
1737 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1739 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
$(objpfx
)tst-tlsmod7.so
1741 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
$(objpfx
)tst-tlsmod9.so
1743 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
$(objpfx
)tst-tlsmod11.so
1745 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
1747 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
1748 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
1750 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
1752 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
1756 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
1758 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
1759 $(patsubst %,$(objpfx
)%.os
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
1760 $(compile-command.c
) -DN
=$*
1761 $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
1762 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
))
1764 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
))
1765 $(patsubst %,$(objpfx
)%.os
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
1766 $(compile-command.c
) -DN
=$*
1767 $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
1769 $(objpfx
)tst-tls19.out
: $(objpfx
)tst-tls19mod1.so
1771 CFLAGS-tst-align.c
+= $(stack-align-test-flags
)
1772 CFLAGS-tst-align2.c
+= $(stack-align-test-flags
)
1773 CFLAGS-tst-alignmod.c
+= $(stack-align-test-flags
)
1774 CFLAGS-tst-alignmod2.c
+= $(stack-align-test-flags
)
1775 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
1776 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
1777 $(objpfx
)tst-align3
: $(objpfx
)tst-alignmod3.so
1778 ifeq (yes
,$(have-fpie
))
1779 CFLAGS-tst-align3.c
+= $(PIE-ccflag
)
1781 LDFLAGS-tst-align3
+= -Wl
,-z
,max-page-size
=0x200000
1782 LDFLAGS-tst-alignmod3.so
+= -Wl
,-z
,max-page-size
=0x200000
1783 $(objpfx
)tst-alignmod3.so
: $(libsupport
)
1785 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1786 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1788 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
1790 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1791 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1793 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
1794 $(objpfx
)unload6mod3.so
1796 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
1797 unload7-ENV
= MALLOC_PERTURB_
=85
1799 $(objpfx
)unload8.out
: $(objpfx
)unload8mod1.so
$(objpfx
)unload8mod1x.so
1801 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1803 ifeq ($(have-z-execstack
),yes
)
1804 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
1805 CPPFLAGS-tst-execstack.c
+= -DUSE_PTHREADS
=0
1806 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
1807 LDFLAGS-tst-execstack-mod.so
= -Wl
,-z
,execstack
1809 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
1810 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
1812 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
1813 CFLAGS-tst-execstack-prog.c
+= -Wno-trampolines
1814 CFLAGS-tst-execstack-mod.c
+= -Wno-trampolines
1817 LDFLAGS-tst-array2
= -Wl
,--no-as-needed
1818 LDFLAGS-tst-array5
= -Wl
,--no-as-needed
1820 $(objpfx
)tst-array1-cmp.out
: tst-array1.exp
$(objpfx
)tst-array1.out
1824 $(objpfx
)tst-array1-static-cmp.out
: tst-array1.exp \
1825 $(objpfx
)tst-array1-static.out
1829 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
1830 $(objpfx
)tst-array2-cmp.out
: tst-array2.exp
$(objpfx
)tst-array2.out
1834 $(objpfx
)tst-array3-cmp.out
: tst-array1.exp
$(objpfx
)tst-array3.out
1838 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array2dep.so
1839 $(objpfx
)tst-array4-cmp.out
: tst-array4.exp
$(objpfx
)tst-array4.out
1843 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
1844 $(objpfx
)tst-array5-cmp.out
: tst-array5.exp
$(objpfx
)tst-array5.out
1848 $(objpfx
)tst-array5-static-cmp.out
: tst-array5-static.exp \
1849 $(objpfx
)tst-array5-static.out
1853 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
1854 CFLAGS-tst-pie2.c
+= $(pie-ccflag
)
1856 $(objpfx
)tst-piemod1.so
: $(libsupport
)
1857 $(objpfx
)tst-pie1
: $(objpfx
)tst-piemod1.so
1858 $(objpfx
)tst-dlopen-pie.out
: $(objpfx
)tst-pie1
1860 ifeq (yes
,$(build-shared
))
1861 # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with
1862 # all-built-dso here.
1863 all-built-dso
:= $(common-objpfx
)elf
/ld.so
$(common-objpfx
)libc.so \
1864 $(filter-out $(common-objpfx
)linkobj
/libc.so
, \
1865 $(sort $(wildcard $(addprefix $(common-objpfx
), \
1869 $(all-built-dso
:=.dyn
): %.dyn
: %
1871 LC_ALL
=C
$(READELF
) -W
-d
$< > $@T
1874 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dyn
)
1876 $(objpfx
)check-textrel.out
: $(..
)scripts
/check-textrel.awk \
1877 $(all-built-dso
:=.dyn
)
1878 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1880 generated
+= check-textrel.out
1882 $(objpfx
)execstack-default
: $(first-word
$(wildcard $(sysdirs
:%=%/stackinfo.h
)))
1883 $(make-target-directory
)
1884 { echo
'#include <elf.h>'; \
1885 echo
'#include <stackinfo.h>'; \
1886 echo
'#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1887 echo
'@@@execstack-no@@@'; \
1889 echo
'@@@execstack-yes@@@'; \
1890 echo
'#endif'; } | \
1891 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -E
-x c-header
- | \
1892 sed
-n
-e
's/^@@@\(.*\)@@@/\1/p' > $@T
1894 generated
+= execstack-default
1896 $(all-built-dso
:=.phdr
): %.phdr
: %
1898 LC_ALL
=C
$(READELF
) -W
-l
$< > $@T
1901 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.phdr
)
1903 $(objpfx
)check-execstack.out
: $(..
)scripts
/check-execstack.awk \
1904 $(objpfx
)execstack-default \
1905 $(all-built-dso
:=.phdr
)
1906 LC_ALL
=C
$(AWK
) -v
"xfail=$(check-execstack-xfail)" -f
$^
> $@
; \
1908 generated
+= check-execstack.out
1910 $(objpfx
)check-wx-segment.out
: $(..
)scripts
/check-wx-segment.py \
1911 $(all-built-dso
:=.phdr
)
1912 $(PYTHON
) $^
--xfail
="$(check-wx-segment-xfail)" > $@
; \
1914 generated
+= check-wx-segment.out
1916 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
1918 $(all-built-dso
:=.jmprel
): %.jmprel
: % Makefile
1920 LC_ALL
=C
$(READELF
) -W
-S
-d
-r
$< > $@T
1923 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.jmprel
)
1925 localplt-built-dso
:= $(addprefix $(common-objpfx
),\
1930 resolv
/libresolv.so \
1932 ifeq ($(build-mathvec
),yes
)
1933 localplt-built-dso
+= $(addprefix $(common-objpfx
), mathvec
/libmvec.so
)
1935 ifeq ($(have-thread-library
),yes
)
1936 localplt-built-dso
+= $(filter-out %_nonshared.a
, $(shared-thread-library
))
1938 ifneq ($(pthread-in-libc
),yes
)
1939 localplt-built-dso
+= $(addprefix $(common-objpfx
), rt
/librt.so
)
1942 vpath localplt.data
$(+sysdep_dirs
)
1944 $(objpfx
)check-localplt.out
: $(..
)scripts
/check-localplt.awk \
1945 $(..
)scripts
/localplt.awk \
1946 $(localplt-built-dso
:=.jmprel
) \
1948 LC_ALL
=C
$(AWK
) -f
$(filter-out $< %localplt.data
,$^
) | \
1949 LC_ALL
=C
$(AWK
) -f
$< $(filter %localplt.data
,$^
) - \
1954 $(all-built-dso
:=.dynsym
): %.dynsym
: %
1956 LC_ALL
=C
$(READELF
) -W
--dyn-syms
$< > $@T
1959 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dynsym
)
1961 $(objpfx
)check-initfini.out
: $(..
)scripts
/check-initfini.awk \
1962 $(all-built-dso
:=.dynsym
)
1963 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1965 generated
+= check-initfini.out
1967 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
1968 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
1969 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
1970 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
1972 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
1973 $(objpfx
)tst-deep1
: $(objpfx
)tst-deep1mod1.so
1974 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
1975 LDFLAGS-tst-deep1
+= -rdynamic
1976 tst-deep1mod3.so-no-z-defs
= yes
1978 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
1980 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
1982 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
1984 $(objpfx
)tst-dlmopen4.out
: $(objpfx
)tst-dlmopen1mod.so
1986 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
1987 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1989 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
$(objpfx
)tst-auditmod9b.so
1990 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1991 CFLAGS-tst-audit2.c
+= -fno-builtin
1992 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1994 $(objpfx
)tst-audit9.out
: $(objpfx
)tst-auditmod9a.so
$(objpfx
)tst-auditmod9b.so
1995 tst-audit9-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod9a.so
1997 $(objpfx
)tst-audit8
: $(libm
)
1998 $(objpfx
)tst-audit8.out
: $(objpfx
)tst-auditmod1.so
1999 tst-audit8-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
2001 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
2003 $(objpfx
)tst-global2
: $(objpfx
)tst-globalmod2.so
2004 $(objpfx
)tst-global2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
2005 LDFLAGS-tst-global2
= -Wl
,--enable-new-dtags
2006 LDFLAGS-tst-globalmod2.so
= -Wl
,--enable-new-dtags
2008 $(objpfx
)order2.out
: $(objpfx
)order2mod1.so
$(objpfx
)order2mod2.so
2009 $(objpfx
)order2-cmp.out
: $(objpfx
)order2.out
2010 (echo
"12345" | cmp
$< -) > $@
; \
2012 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
2013 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
2014 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
2015 order2mod2.so-no-z-defs
= yes
2016 LDFLAGS-order2mod1.so
= -Wl
,--no-as-needed
2017 LDFLAGS-order2mod2.so
= -Wl
,--no-as-needed
2019 tst-stackguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
2020 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
2022 tst-ptrguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
2023 # When built statically, the pointer guard interface uses
2024 # __pointer_chk_guard_local.
2025 CFLAGS-tst-ptrguard1-static.c
+= -DPTRGUARD_LOCAL
2026 tst-ptrguard1-static-ARGS
= --command
"$(objpfx)tst-ptrguard1-static --child"
2028 $(objpfx
)tst-leaks1-mem.out
: $(objpfx
)tst-leaks1.out
2029 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
; \
2032 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace \
2033 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
2035 $(objpfx
)tst-thrlock
: $(shared-thread-library
)
2036 $(objpfx
)tst-thrlock.out
: $(libm
)
2037 $(objpfx
)tst-noload.out
: $(libm
)
2039 tst-tst-dlopen-tlsmodid-no-pie
= yes
2040 $(objpfx
)tst-dlopen-tlsmodid
: $(shared-thread-library
)
2041 $(objpfx
)tst-dlopen-tlsmodid.out
: $(objpfx
)tst-dlopen-self
2042 CFLAGS-tst-dlopen-tlsmodid-pie.c
+= $(pie-ccflag
)
2043 $(objpfx
)tst-dlopen-tlsmodid-pie
: $(shared-thread-library
)
2044 $(objpfx
)tst-dlopen-tlsmodid-pie.out
: $(objpfx
)tst-dlopen-self-pie
2045 $(objpfx
)tst-dlopen-tlsmodid-container
: $(shared-thread-library
)
2046 LDFLAGS-tst-dlopen-tlsmodid-container
+= -Wl
,-rpath
,\
$$ORIGIN
2048 tst-tst-dlopen-self-no-pie
= yes
2049 CFLAGS-tst-dlopen-self-pie.c
+= $(pie-ccflag
)
2050 LDFLAGS-tst-dlopen-self-container
+= -Wl
,-rpath
,\
$$ORIGIN
2052 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
2053 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
2054 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
2055 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
2056 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
2057 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
2058 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
2059 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
2060 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
2061 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
2062 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
2063 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
2064 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
2065 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
2066 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
2067 CFLAGS-ifuncmain9pic.c
+= $(pic-ccflag
)
2068 CFLAGS-ifuncmain9picstatic.c
+= $(pic-ccflag
)
2070 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
2072 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
2073 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
2074 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
2075 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
2076 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
2077 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
2078 CFLAGS-ifuncmain9pie.c
+= $(pie-ccflag
)
2079 CFLAGS-tst-ifunc-textrel.c
+= $(pic-ccflag
)
2081 LDFLAGS-ifuncmain6pie
= -Wl
,-z
,lazy
2083 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmod1.so
2084 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncdep1pic.o
2085 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmod1.so
2086 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmod5.so
2087 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmod6.so
2089 $(objpfx
)ifuncmain1
: $(addprefix $(objpfx
),ifuncmod1.so
)
2090 $(objpfx
)ifuncmain1pic
: $(addprefix $(objpfx
),ifuncmod1.so
)
2091 $(objpfx
)ifuncmain1staticpic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
2092 $(objpfx
)ifuncmain1static
: $(addprefix $(objpfx
),ifuncdep1.o
)
2093 $(objpfx
)ifuncmain1picstatic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
2094 $(objpfx
)ifuncmain1vis
: $(addprefix $(objpfx
),ifuncmod1.so
)
2095 $(objpfx
)ifuncmain1vispic
: $(addprefix $(objpfx
),ifuncmod1.so
)
2096 $(objpfx
)ifuncmain2
: $(addprefix $(objpfx
),ifuncdep2.o
)
2097 $(objpfx
)ifuncmain2pic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2098 $(objpfx
)ifuncmain2static
: $(addprefix $(objpfx
),ifuncdep2.o
)
2099 $(objpfx
)ifuncmain2picstatic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2101 $(objpfx
)ifuncmain3.out
: $(objpfx
)ifuncmod3.so
2103 $(objpfx
)ifuncmain5
: $(addprefix $(objpfx
),ifuncmod5.so
)
2104 $(objpfx
)ifuncmain5pic
: $(addprefix $(objpfx
),ifuncmod5.so
)
2105 $(objpfx
)ifuncmain5static
: $(addprefix $(objpfx
),ifuncdep5.o
)
2106 $(objpfx
)ifuncmain5staticpic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2107 $(objpfx
)ifuncmain5picstatic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2109 LDFLAGS-tst-ifunc-fault-lazy
= -Wl
,-z
,lazy
2110 LDFLAGS-tst-ifunc-fault-bindnow
= -Wl
,-z
,now
2111 define tst-ifunc-fault-script
2112 ( $(test-wrapper
) $(rtld-prefix
) --verify
$^ \
2113 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 $(rtld-prefix
) $^ \
2114 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 LD_DEBUG
=unused \
2116 ) > $@
; $(evaluate-test
)
2118 $(objpfx
)tst-ifunc-fault-lazy.out
: $(objpfx
)tst-ifunc-fault-lazy
$(objpfx
)ld.so
2119 $(tst-ifunc-fault-script
)
2120 $(objpfx
)tst-ifunc-fault-bindnow.out
: $(objpfx
)tst-ifunc-fault-bindnow \
2122 $(tst-ifunc-fault-script
)
2124 $(objpfx
)tst-unique1.out
: $(objpfx
)tst-unique1mod1.so \
2125 $(objpfx
)tst-unique1mod2.so
2127 $(objpfx
)tst-unique2
: $(objpfx
)tst-unique2mod1.so
2128 $(objpfx
)tst-unique2.out
: $(objpfx
)tst-unique2mod2.so
2130 $(objpfx
)tst-unique3
: $(objpfx
)tst-unique3lib.so
2131 $(objpfx
)tst-unique3.out
: $(objpfx
)tst-unique3lib2.so
2133 $(objpfx
)tst-unique4
: $(objpfx
)tst-unique4lib.so
2135 $(objpfx
)tst-nodelete.out
: $(objpfx
)tst-nodelete-uniquemod.so \
2136 $(objpfx
)tst-nodelete-rtldmod.so \
2137 $(objpfx
)tst-nodelete-zmod.so
2139 LDFLAGS-tst-nodelete
= -rdynamic
2140 LDFLAGS-tst-nodelete-zmod.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
2142 $(objpfx
)tst-nodelete2.out
: $(objpfx
)tst-nodelete2mod.so
2144 LDFLAGS-tst-nodelete2
= -rdynamic
2146 $(objpfx
)tst-initorder-cmp.out
: tst-initorder.exp
$(objpfx
)tst-initorder.out
2150 $(objpfx
)tst-initorder2
: $(objpfx
)tst-initorder2a.so
$(objpfx
)tst-initorder2d.so
$(objpfx
)tst-initorder2c.so
2151 $(objpfx
)tst-initorder2a.so
: $(objpfx
)tst-initorder2b.so
2152 $(objpfx
)tst-initorder2b.so
: $(objpfx
)tst-initorder2c.so
2153 $(objpfx
)tst-initorder2c.so
: $(objpfx
)tst-initorder2d.so
2154 LDFLAGS-tst-initorder2
= -Wl
,--no-as-needed
2155 LDFLAGS-tst-initorder2a.so
= -Wl
,--no-as-needed
2156 LDFLAGS-tst-initorder2b.so
= -Wl
,--no-as-needed
2157 LDFLAGS-tst-initorder2c.so
= -Wl
,--no-as-needed
2158 define o-iterator-doit
2159 $(objpfx
)tst-initorder2
$o.os
: tst-initorder2.c
; \
2160 $$(compile-command.c
) -DNAME
=\"$o\"
2162 object-suffixes-left
:= a b c d
2163 include $(o-iterator
)
2165 $(objpfx
)tst-initorder2-cmp.out
: tst-initorder2.exp
$(objpfx
)tst-initorder2.out
2169 $(objpfx
)tst-relsort1mod1.so
: $(libm
) $(objpfx
)tst-relsort1mod2.so
2170 $(objpfx
)tst-relsort1mod2.so
: $(libm
)
2171 $(objpfx
)tst-relsort1.out
: $(objpfx
)tst-relsort1mod1.so \
2172 $(objpfx
)tst-relsort1mod2.so
2174 $(objpfx
)tst-unused-dep.out
: $(objpfx
)testobj1.so
2175 $(test-wrapper-env
) \
2176 LD_TRACE_LOADED_OBJECTS
=1 \
2183 $(objpfx
)tst-unused-dep-cmp.out
: $(objpfx
)tst-unused-dep.out
2184 cmp
$< /dev
/null
> $@
; \
2187 $(objpfx
)tst-audit11.out
: $(objpfx
)tst-auditmod11.so
$(objpfx
)tst-audit11mod1.so
2188 tst-audit11-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod11.so
2189 $(objpfx
)tst-audit11mod1.so
: $(objpfx
)tst-audit11mod2.so
2190 LDFLAGS-tst-audit11mod2.so
= -Wl
,--version-script
=tst-audit11mod2.map
,-soname
,tst-audit11mod2.so
2192 $(objpfx
)tst-audit12.out
: $(objpfx
)tst-auditmod12.so
$(objpfx
)tst-audit12mod1.so
$(objpfx
)tst-audit12mod3.so
2193 tst-audit12-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod12.so
2194 $(objpfx
)tst-audit12mod1.so
: $(objpfx
)tst-audit12mod2.so
2195 LDFLAGS-tst-audit12mod2.so
= -Wl
,--version-script
=tst-audit12mod2.map
2197 $(objpfx
)tst-audit13.out
: $(objpfx
)tst-audit13mod1.so
2198 LDFLAGS-tst-audit13mod1.so
= -Wl
,-z
,lazy
2199 tst-audit13-ENV
= LD_AUDIT
=$(objpfx
)tst-audit13mod1.so
2201 $(objpfx
)tst-auditmany.out
: $(objpfx
)tst-auditmanymod1.so \
2202 $(objpfx
)tst-auditmanymod2.so
$(objpfx
)tst-auditmanymod3.so \
2203 $(objpfx
)tst-auditmanymod4.so
$(objpfx
)tst-auditmanymod5.so \
2204 $(objpfx
)tst-auditmanymod6.so
$(objpfx
)tst-auditmanymod7.so \
2205 $(objpfx
)tst-auditmanymod8.so
$(objpfx
)tst-auditmanymod9.so
2206 tst-auditmany-ENV
= \
2207 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
2209 LDFLAGS-tst-audit14
= -Wl
,--audit
=tst-auditlogmod-1.so
,--disable-new-dtags
2210 $(objpfx
)tst-auditlogmod-1.so
: $(libsupport
)
2211 $(objpfx
)tst-audit14.out
: $(objpfx
)tst-auditlogmod-1.so
2212 LDFLAGS-tst-audit14a
= -Wl
,--audit
=tst-auditlogmod-1.so
,--enable-new-dtags
2213 $(objpfx
)tst-audit14a.out
: $(objpfx
)tst-auditlogmod-1.so
2214 LDFLAGS-tst-audit15
= \
2215 -Wl
,--audit
=tst-auditlogmod-1.so
,--depaudit
=tst-auditlogmod-2.so
2216 $(objpfx
)tst-auditlogmod-2.so
: $(libsupport
)
2217 $(objpfx
)tst-audit15.out
: \
2218 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so
2219 LDFLAGS-tst-audit16
= \
2220 -Wl
,--audit
=tst-auditlogmod-1.so
:tst-auditlogmod-2.so \
2221 -Wl
,--depaudit
=tst-auditlogmod-3.so
2222 $(objpfx
)tst-auditlogmod-3.so
: $(libsupport
)
2223 $(objpfx
)tst-audit16.out
: \
2224 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so \
2225 $(objpfx
)tst-auditlogmod-3.so
2226 $(objpfx
)tst-audit17.out
: $(objpfx
)tst-auditmod17.so
2227 # The test check if a audit library without libc.so on DT_NEEDED works as
2228 # intended, so it uses an explicit link rule.
2229 $(objpfx
)tst-auditmod17.so
: $(objpfx
)tst-auditmod17.os
2230 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
2231 $(filter-out $(map-file
),$^
)
2232 $(call after-link
,$@.new
)
2234 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-auditmod17
)
2235 tst-audit17-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod17.so
2237 $(objpfx
)tst-audit14-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14.out
2240 $(objpfx
)tst-audit14a-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14a.out
2243 $(objpfx
)tst-audit15-cmp.out
: tst-audit15.exp
$(objpfx
)tst-audit15.out
2246 $(objpfx
)tst-audit16-cmp.out
: tst-audit16.exp
$(objpfx
)tst-audit16.out
2250 $(objpfx
)tst-audit18.out
: $(objpfx
)tst-auditmod18.so \
2251 $(objpfx
)tst-audit18mod.so
2252 tst-audit18-ARGS
= -- $(host-test-program-cmd
)
2254 $(objpfx
)tst-audit19a.out
: $(objpfx
)tst-auditmod19a.so
2255 tst-audit19a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod19a.so
2257 $(objpfx
)tst-audit19b.out
: $(objpfx
)tst-auditmod19b.so
2258 $(objpfx
)tst-audit19b
: $(objpfx
)tst-audit19bmod.so
2259 tst-audit19b-ARGS
= -- $(host-test-program-cmd
)
2261 $(objpfx
)tst-audit20.out
: $(objpfx
)tst-auditmod20.so
2262 tst-audit20-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod20.so
2264 $(objpfx
)tst-audit21
: $(shared-thread-library
)
2265 $(objpfx
)tst-audit21.out
: $(objpfx
)tst-auditmod21a.so
2266 $(objpfx
)tst-auditmod21a.so
: $(objpfx
)tst-auditmod21b.so
2267 tst-audit21-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod21a.so
2269 $(objpfx
)tst-audit22.out
: $(objpfx
)tst-auditmod22.so
2270 tst-audit22-ARGS
= -- $(host-test-program-cmd
)
2272 $(objpfx
)tst-audit23.out
: $(objpfx
)tst-auditmod23.so \
2273 $(objpfx
)tst-audit23mod.so
2274 tst-audit23-ARGS
= -- $(host-test-program-cmd
)
2276 $(objpfx
)tst-audit24a.out
: $(objpfx
)tst-auditmod24a.so
2277 $(objpfx
)tst-audit24a
: $(objpfx
)tst-audit24amod1.so \
2278 $(objpfx
)tst-audit24amod2.so
2279 tst-audit24a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24a.so
2280 LDFLAGS-tst-audit24a
= -Wl
,-z
,now
2282 $(objpfx
)tst-audit24b.out
: $(objpfx
)tst-auditmod24b.so
2283 $(objpfx
)tst-audit24b
: $(objpfx
)tst-audit24bmod1.so \
2284 $(objpfx
)tst-audit24bmod2.so
2285 $(objpfx
)tst-audit24bmod1
: $(objpfx
)tst-audit24bmod2.so
2286 # The test checks if a library without .gnu.version correctly calls the
2287 # audit callbacks. So it uses an explicit link rule to avoid linking
2289 $(objpfx
)tst-audit24bmod1.so
: $(objpfx
)tst-audit24bmod1.os
2290 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod1.os \
2292 $(call after-link
,$@.new
)
2294 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod1
)
2295 $(objpfx
)tst-audit24bmod2.so
: $(objpfx
)tst-audit24bmod2.os
2296 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod2.os
2297 $(call after-link
,$@.new
)
2299 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod2
)
2300 tst-audit24b-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24b.so
2301 LDFLAGS-tst-audit24b
= -Wl
,-z
,now
2303 # Same as tst-audit24a, but tests LD_BIND_NOW
2304 $(objpfx
)tst-audit24c.out
: $(objpfx
)tst-auditmod24c.so
2305 $(objpfx
)tst-audit24c
: $(objpfx
)tst-audit24amod1.so \
2306 $(objpfx
)tst-audit24amod2.so
2307 tst-audit24c-ENV
= LD_BIND_NOW
=1 LD_AUDIT
=$(objpfx
)tst-auditmod24c.so
2308 LDFLAGS-tst-audit24c
= -Wl
,-z
,lazy
2310 $(objpfx
)tst-audit24d.out
: $(objpfx
)tst-auditmod24d.so
2311 $(objpfx
)tst-audit24d
: $(objpfx
)tst-audit24dmod1.so \
2312 $(objpfx
)tst-audit24dmod2.so
2313 $(objpfx
)tst-audit24dmod1.so
: $(objpfx
)tst-audit24dmod3.so
2314 LDFLAGS-tst-audit24dmod1.so
= -Wl
,-z
,now
2315 $(objpfx
)tst-audit24dmod2.so
: $(objpfx
)tst-audit24dmod4.so
2316 LDFLAGS-tst-audit24dmod2.so
= -Wl
,-z
,lazy
2317 tst-audit24d-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24d.so
2318 LDFLAGS-tst-audit24d
= -Wl
,-z
,lazy
2320 $(objpfx
)tst-audit25a.out
: $(objpfx
)tst-auditmod25.so
2321 $(objpfx
)tst-audit25a
: $(objpfx
)tst-audit25mod1.so \
2322 $(objpfx
)tst-audit25mod2.so \
2323 $(objpfx
)tst-audit25mod3.so \
2324 $(objpfx
)tst-audit25mod4.so
2325 LDFLAGS-tst-audit25a
= -Wl
,-z
,lazy
2326 $(objpfx
)tst-audit25mod1.so
: $(objpfx
)tst-audit25mod3.so
2327 LDFLAGS-tst-audit25mod1.so
= -Wl
,-z
,now
2328 $(objpfx
)tst-audit25mod2.so
: $(objpfx
)tst-audit25mod4.so
2329 LDFLAGS-tst-audit25mod2.so
= -Wl
,-z
,lazy
2330 tst-audit25a-ARGS
= -- $(host-test-program-cmd
)
2332 $(objpfx
)tst-audit25b.out
: $(objpfx
)tst-auditmod25.so
2333 $(objpfx
)tst-audit25b
: $(objpfx
)tst-audit25mod1.so \
2334 $(objpfx
)tst-audit25mod2.so \
2335 $(objpfx
)tst-audit25mod3.so \
2336 $(objpfx
)tst-audit25mod4.so
2337 LDFLAGS-tst-audit25b
= -Wl
,-z
,now
2338 tst-audit25b-ARGS
= -- $(host-test-program-cmd
)
2340 $(objpfx
)tst-audit28.out
: $(objpfx
)tst-auditmod28.so
2341 $(objpfx
)tst-auditmod28.so
: $(libsupport
)
2342 tst-audit28-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod28.so
2344 # tst-sonamemove links against an older implementation of the library.
2345 LDFLAGS-tst-sonamemove-linkmod1.so
= \
2346 -Wl
,--version-script
=tst-sonamemove-linkmod1.map \
2347 -Wl
,-soname
,tst-sonamemove-runmod1.so
2348 LDFLAGS-tst-sonamemove-runmod1.so
= -Wl
,--no-as-needed \
2349 -Wl
,--version-script
=tst-sonamemove-runmod1.map \
2350 -Wl
,-soname
,tst-sonamemove-runmod1.so
2351 LDFLAGS-tst-sonamemove-runmod2.so
= \
2352 -Wl
,--version-script
=tst-sonamemove-runmod2.map \
2353 -Wl
,-soname
,tst-sonamemove-runmod2.so
2354 $(objpfx
)tst-sonamemove-runmod1.so
: $(objpfx
)tst-sonamemove-runmod2.so
2355 # Link against the link module, but depend on the run-time modules
2357 $(objpfx
)tst-sonamemove-link
: $(objpfx
)tst-sonamemove-linkmod1.so
2358 $(objpfx
)tst-sonamemove-link.out
: \
2359 $(objpfx
)tst-sonamemove-runmod1.so \
2360 $(objpfx
)tst-sonamemove-runmod2.so
2361 $(objpfx
)tst-sonamemove-dlopen.out
: \
2362 $(objpfx
)tst-sonamemove-runmod1.so \
2363 $(objpfx
)tst-sonamemove-runmod2.so
2365 $(objpfx
)tst-dlmopen-dlerror-mod.so
: $(libsupport
)
2366 $(objpfx
)tst-dlmopen-dlerror.out
: $(objpfx
)tst-dlmopen-dlerror-mod.so
2368 # Override -z defs, so that we can reference an undefined symbol.
2369 # Force lazy binding for the same reason.
2370 LDFLAGS-tst-latepthreadmod.so
= \
2371 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2372 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
2373 # function this_function_is_not_defined.
2374 CFLAGS-tst-latepthreadmod.c
+= -fno-optimize-sibling-calls
2375 $(objpfx
)tst-latepthreadmod.so
: $(shared-thread-library
)
2376 $(objpfx
)tst-latepthread.out
: $(objpfx
)tst-latepthreadmod.so
2378 # The test modules are parameterized by preprocessor macros.
2379 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules
)): \
2380 $(objpfx
)tst-tls-manydynamic
%mod.os
: tst-tls-manydynamicmod.c
2381 $(compile-command.c
) \
2382 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2383 $(objpfx
)tst-tls-manydynamic
: $(shared-thread-library
)
2384 $(objpfx
)tst-tls-manydynamic.out
: \
2385 $(patsubst %,$(objpfx
)%.so
,$(tst-tls-many-dynamic-modules
))
2387 $(objpfx
)tst-ldconfig-X.out
: tst-ldconfig-X.sh
$(objpfx
)ldconfig
2388 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
2389 '$(run-program-env)' > $@
; \
2392 $(objpfx
)tst-ldconfig-p.out
: tst-ldconfig-p.sh
$(objpfx
)ldconfig
2393 $(SHELL
) $< '$(common-objpfx)' '$(sysconfdir)' '$(test-wrapper-env)' \
2394 '$(run-program-env)' > $@
; \
2397 LDFLAGS-tst-ldconfig-soname-lib-with-soname.so
= \
2398 -Wl
,-soname
,libtst-ldconfig-soname-lib-with-soname.so
.1
2400 $(objpfx
)tst-ldconfig-soname.out
: tst-ldconfig-soname.sh \
2402 $(objpfx
)tst-ldconfig-soname-lib-with-soname.so \
2403 $(objpfx
)tst-ldconfig-soname-lib-without-soname.so
2404 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
2405 '$(run-program-env)' > $@
; \
2408 # Test static linking of all the libraries we can possibly link
2409 # together. Note that in some configurations this may be less than the
2410 # complete list of libraries we build but we try to maxmimize this list.
2411 ifeq ($(pthread-in-libc
),no
)
2412 $(objpfx
)tst-linkall-static
: \
2413 $(common-objpfx
)resolv
/libanl.a
2415 $(objpfx
)tst-linkall-static
: \
2416 $(common-objpfx
)math
/libm.a \
2417 $(common-objpfx
)resolv
/libresolv.a \
2418 $(common-objpfx
)login
/libutil.a \
2419 $(common-objpfx
)rt
/librt.a \
2420 $(static-thread-library
)
2422 LDFLAGS-nextmod3.so
= -Wl
,--version-script
=nextmod3.map
2424 # The application depends on the DSO, and the DSO loads the plugin.
2425 # The plugin also depends on the DSO. This creates the circular
2426 # dependency via dlopen that we're testing to make sure works.
2427 $(objpfx
)tst-nodelete-dlclose-plugin.so
: $(objpfx
)tst-nodelete-dlclose-dso.so
2428 $(objpfx
)tst-nodelete-dlclose
: $(objpfx
)tst-nodelete-dlclose-dso.so
2429 $(objpfx
)tst-nodelete-dlclose.out
: $(objpfx
)tst-nodelete-dlclose-dso.so \
2430 $(objpfx
)tst-nodelete-dlclose-plugin.so
2432 tst-env-setuid-ENV
= MALLOC_CHECK_
=2 MALLOC_MMAP_THRESHOLD_
=4096 \
2435 $(objpfx
)tst-debug1.out
: $(objpfx
)tst-debug1mod1.so
2437 $(objpfx
)tst-debug1mod1.so
: $(objpfx
)testobj1.so
2438 $(OBJCOPY
) --only-keep-debug
$< $@
2440 $(objpfx
)tst-main1
: $(objpfx
)tst-main1mod.so
2441 CRT-tst-main1
:= $(csu-objpfx
)crt1.o
2442 tst-main1-no-pie
= yes
2443 LDLIBS-tst-main1
= $(libsupport
)
2444 tst-main1mod.so-no-z-defs
= yes
2446 LDLIBS-tst-absolute-sym-lib.so
= tst-absolute-sym-lib.lds
2447 $(objpfx
)tst-absolute-sym-lib.so
: $(LDLIBS-tst-absolute-sym-lib.so
)
2448 $(objpfx
)tst-absolute-sym
: $(objpfx
)tst-absolute-sym-lib.so
2450 LDLIBS-tst-absolute-zero-lib.so
= tst-absolute-zero-lib.lds
2451 $(objpfx
)tst-absolute-zero-lib.so
: $(LDLIBS-tst-absolute-zero-lib.so
)
2452 $(objpfx
)tst-absolute-zero
: $(objpfx
)tst-absolute-zero-lib.so
2454 $(objpfx
)tst-big-note
: $(objpfx
)tst-big-note-lib.so
2455 # Avoid creating an ABI tag note, which may come before the
2456 # artificial, large note in tst-big-note-lib.o and invalidate the
2458 $(objpfx
)tst-big-note-lib.so
: $(objpfx
)tst-big-note-lib.o
2459 $(LINK.o
) -shared
-o
$@
$(LDFLAGS.so
) $(dt-relr-ldflag
) $<
2461 $(objpfx
)tst-unwind-ctor
: $(objpfx
)tst-unwind-ctor-lib.so
2463 CFLAGS-tst-unwind-main.c
+= -funwind-tables
-DUSE_PTHREADS
=0
2465 $(objpfx
)tst-initfinilazyfail.out
: \
2466 $(objpfx
)tst-initlazyfailmod.so
$(objpfx
)tst-finilazyfailmod.so
2467 # Override -z defs, so that we can reference an undefined symbol.
2468 # Force lazy binding for the same reason.
2469 LDFLAGS-tst-initlazyfailmod.so
= \
2470 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2471 LDFLAGS-tst-finilazyfailmod.so
= \
2472 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2474 $(objpfx
)tst-dlopenfail.out
: \
2475 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so
2476 # Order matters here. tst-dlopenfaillinkmod.so's soname ensures a
2477 # run-time loader failure. --as-needed breaks this test because
2478 # nothing actually references tst-dlopenfailmod2.so (with its soname
2479 # tst-dlopenfail-missingmod.so).
2480 LDFLAGS-tst-dlopenfailmod1.so
= -Wl
,--no-as-needed
2481 $(objpfx
)tst-dlopenfailmod1.so
: \
2482 $(shared-thread-library
) $(objpfx
)tst-dlopenfaillinkmod.so
2483 LDFLAGS-tst-dlopenfaillinkmod.so
= -Wl
,-soname
,tst-dlopenfail-missingmod.so
2484 $(objpfx
)tst-dlopenfailmod2.so
: $(objpfx
)tst-dlopenfailnodelmod.so
2485 $(objpfx
)tst-dlopenfail-2.out
: \
2486 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so \
2487 $(objpfx
)tst-dlopenfailmod3.so
2488 # tst-dlopenfailnodelmod.so emulates how libpthread was linked.
2489 $(objpfx
)tst-dlopenfailnodelmod.so
: $(libsupport
)
2490 LDFLAGS-tst-dlopenfailnodelmod.so
= \
2491 -Wl
,--enable-new-dtags
,-z
,nodelete
,-z
,initfirst
2492 # tst-dlopenfail should export the libsupport symbols, so that
2493 # tst-dlopenfailnodelmod.so uses them for error reporting.
2494 LDFLAGS-tst-dlopenfail
= -Wl
,-E
2496 $(objpfx
)tst-dlopen-nodelete-reloc.out
: \
2497 $(objpfx
)tst-dlopen-nodelete-reloc-mod1.so \
2498 $(objpfx
)tst-dlopen-nodelete-reloc-mod2.so \
2499 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so \
2500 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so \
2501 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so \
2502 $(objpfx
)tst-dlopen-nodelete-reloc-mod6.so \
2503 $(objpfx
)tst-dlopen-nodelete-reloc-mod7.so \
2504 $(objpfx
)tst-dlopen-nodelete-reloc-mod8.so \
2505 $(objpfx
)tst-dlopen-nodelete-reloc-mod9.so \
2506 $(objpfx
)tst-dlopen-nodelete-reloc-mod10.so \
2507 $(objpfx
)tst-dlopen-nodelete-reloc-mod11.so \
2508 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so \
2509 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so \
2510 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so \
2511 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2512 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so \
2513 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
2514 tst-dlopen-nodelete-reloc-mod2.so-no-z-defs
= yes
2515 LDFLAGS-tst-dlopen-nodelete-reloc-mod2.so
= -Wl
,-z
,nodelete
2516 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
: \
2517 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so
2518 LDFLAGS-tst-dlopen-nodelete-reloc-mod4.so
= -Wl
,--no-as-needed
2519 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so
: \
2520 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
2521 LDFLAGS-tst-dlopen-nodelete-reloc-mod5.so
= -Wl
,-z
,nodelete
,--no-as-needed
2522 tst-dlopen-nodelete-reloc-mod5.so-no-z-defs
= yes
2523 tst-dlopen-nodelete-reloc-mod7.so-no-z-defs
= yes
2524 tst-dlopen-nodelete-reloc-mod11.so-no-z-defs
= yes
2525 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so
: \
2526 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so
2527 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
: \
2528 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so
2529 tst-dlopen-nodelete-reloc-mod16.so-no-z-defs
= yes
2530 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
: \
2531 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
2532 LDFLAGS-tst-dlopen-nodelete-reloc-mod16.so
= -Wl
,--no-as-needed
2533 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
: \
2534 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2535 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
2536 LDFLAGS-tst-dlopen-nodelete-reloc-mod17.so
= -Wl
,--no-as-needed
2538 $(objpfx
)tst-ldconfig-ld_so_conf-update.out
: $(objpfx
)tst-ldconfig-ld-mod.so
2540 LDFLAGS-tst-filterobj-flt.so
= -Wl
,--filter=$(objpfx
)tst-filterobj-filtee.so
2541 $(objpfx
)tst-filterobj
: $(objpfx
)tst-filterobj-flt.so
2542 $(objpfx
)tst-filterobj.out
: $(objpfx
)tst-filterobj-filtee.so
2543 $(objpfx
)tst-filterobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2545 LDFLAGS-tst-filterobj-aux.so
= -Wl
,--auxiliary
=$(objpfx
)tst-filterobj-filtee.so
2546 $(objpfx
)tst-auxobj
: $(objpfx
)tst-filterobj-aux.so
2547 $(objpfx
)tst-auxobj.out
: $(objpfx
)tst-filterobj-filtee.so
2548 $(objpfx
)tst-auxobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2550 $(objpfx
)tst-single_threaded
: $(objpfx
)tst-single_threaded-mod1.so
2551 $(objpfx
)tst-single_threaded.out
: \
2552 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so
2553 $(objpfx
)tst-single_threaded-static-dlopen
: \
2554 $(objpfx
)tst-single_threaded-mod1.o
2555 $(objpfx
)tst-single_threaded-static-dlopen.out
: \
2556 $(objpfx
)tst-single_threaded-mod2.so
2557 $(objpfx
)tst-single_threaded-pthread
: \
2558 $(objpfx
)tst-single_threaded-mod1.so
$(shared-thread-library
)
2559 $(objpfx
)tst-single_threaded-pthread.out
: \
2560 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so \
2561 $(objpfx
)tst-single_threaded-mod4.so
2562 $(objpfx
)tst-single_threaded-pthread-static
: $(static-thread-library
)
2564 $(objpfx
)tst-tls-ie
: $(shared-thread-library
)
2565 $(objpfx
)tst-tls-ie.out
: \
2566 $(objpfx
)tst-tls-ie-mod0.so \
2567 $(objpfx
)tst-tls-ie-mod1.so \
2568 $(objpfx
)tst-tls-ie-mod2.so \
2569 $(objpfx
)tst-tls-ie-mod3.so \
2570 $(objpfx
)tst-tls-ie-mod4.so \
2571 $(objpfx
)tst-tls-ie-mod5.so \
2572 $(objpfx
)tst-tls-ie-mod6.so
2574 $(objpfx
)tst-tls-ie-dlmopen
: $(shared-thread-library
)
2575 $(objpfx
)tst-tls-ie-dlmopen.out
: \
2576 $(objpfx
)tst-tls-ie-mod0.so \
2577 $(objpfx
)tst-tls-ie-mod1.so \
2578 $(objpfx
)tst-tls-ie-mod2.so \
2579 $(objpfx
)tst-tls-ie-mod3.so \
2580 $(objpfx
)tst-tls-ie-mod4.so \
2581 $(objpfx
)tst-tls-ie-mod5.so \
2582 $(objpfx
)tst-tls-ie-mod6.so
2584 $(objpfx
)argv0test.out
: tst-rtld-argv0.sh
$(objpfx
)ld.so \
2586 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)argv0test \
2587 '$(test-wrapper-env)' '$(run_program_env)' \
2588 '$(rpath-link)' 'test-argv0' > $@
; \
2591 # A list containing the name of the most likely searched subdirectory
2592 # of the glibc-hwcaps directory, for each supported architecture (in
2593 # other words, the oldest hardware level recognized by the
2594 # glibc-hwcaps mechanism for this architecture). Used to obtain test
2595 # coverage for some glibc-hwcaps tests for the widest possible range
2597 glibc-hwcaps-first-subdirs-for-tests
= power9 x86-64-v2 z13
2599 # The test modules are parameterized by preprocessor macros.
2600 LDFLAGS-libmarkermod1-1.so
+= -Wl
,-soname
,libmarkermod1.so
2601 LDFLAGS-libmarkermod2-1.so
+= -Wl
,-soname
,libmarkermod2.so
2602 LDFLAGS-libmarkermod3-1.so
+= -Wl
,-soname
,libmarkermod3.so
2603 LDFLAGS-libmarkermod4-1.so
+= -Wl
,-soname
,libmarkermod4.so
2604 LDFLAGS-libmarkermod5-1.so
+= -Wl
,-soname
,libmarkermod5.so
2605 $(objpfx
)libmarkermod
%.os
: markermodMARKER-VALUE.c
2606 $(compile-command.c
) \
2607 -DMARKER
=marker
$(firstword $(subst -, ,$*)) \
2608 -DVALUE
=$(lastword
$(subst -, ,$*))
2609 $(objpfx
)libmarkermod1.so
: $(objpfx
)libmarkermod1-1.so
2611 $(objpfx
)libmarkermod2.so
: $(objpfx
)libmarkermod2-1.so
2613 $(objpfx
)libmarkermod3.so
: $(objpfx
)libmarkermod3-1.so
2615 $(objpfx
)libmarkermod4.so
: $(objpfx
)libmarkermod4-1.so
2617 $(objpfx
)libmarkermod5.so
: $(objpfx
)libmarkermod5-1.so
2620 # tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is
2621 # preferred over auto-detected subdirectories.
2622 $(objpfx
)tst-glibc-hwcaps-prepend
: $(objpfx
)libmarkermod1-1.so
2623 $(objpfx
)glibc-hwcaps
/prepend-markermod1
/libmarkermod1.so
: \
2624 $(objpfx
)libmarkermod1-2.so
2625 $(make-target-directory
)
2627 $(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
: $(objpfx
)libmarkermod1-3.so
2628 $(make-target-directory
)
2630 $(objpfx
)tst-glibc-hwcaps-prepend.out
: \
2631 $(objpfx
)tst-glibc-hwcaps-prepend
$(objpfx
)libmarkermod1.so \
2632 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,prepend-markermod1 \
2633 $(glibc-hwcaps-first-subdirs-for-tests
))
2634 $(test-wrapper
) $(rtld-prefix
) \
2635 --glibc-hwcaps-prepend prepend-markermod1 \
2639 # Like tst-glibc-hwcaps-prepend, but uses a container and loads the
2640 # library via ld.so.cache. Test setup is contained in the test
2642 $(objpfx
)tst-glibc-hwcaps-prepend-cache.out
: \
2643 $(objpfx
)tst-glibc-hwcaps-prepend-cache
$(objpfx
)libmarkermod1-1.so \
2644 $(objpfx
)libmarkermod1-2.so
$(objpfx
)libmarkermod1-3.so
2646 # tst-glibc-hwcaps-mask checks that --glibc-hwcaps-mask can be used to
2647 # suppress all auto-detected subdirectories.
2648 $(objpfx
)tst-glibc-hwcaps-mask
: $(objpfx
)libmarkermod1-1.so
2649 $(objpfx
)tst-glibc-hwcaps-mask.out
: \
2650 $(objpfx
)tst-glibc-hwcaps-mask
$(objpfx
)libmarkermod1.so \
2651 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,\
2652 $(glibc-hwcaps-first-subdirs-for-tests
))
2653 $(test-wrapper
) $(rtld-prefix
) \
2654 --glibc-hwcaps-mask does-not-exist \
2658 # Generic dependency for sysdeps implementation of
2659 # tst-glibc-hwcaps-cache.
2660 $(objpfx
)tst-glibc-hwcaps-cache.out
: $(objpfx
)tst-glibc-hwcaps
2662 $(objpfx
)list-tunables.out
: tst-rtld-list-tunables.sh
$(objpfx
)ld.so
2663 $(SHELL
) $< $(objpfx
)ld.so
'$(test-wrapper-env)' \
2664 '$(run_program_env)' > $(objpfx
)/tst-rtld-list-tunables.out
2665 cmp tst-rtld-list-tunables.exp \
2666 $(objpfx
)/tst-rtld-list-tunables.out
> $@
; \
2669 tst-dst-static-ENV
= LD_LIBRARY_PATH
='$$ORIGIN'
2671 $(objpfx
)tst-rtld-help.out
: $(objpfx
)ld.so
2672 $(test-wrapper
) $(rtld-prefix
) --help
> $@
; \
2674 echo
"info: ld.so exit status: $$status" >> $@
; \
2678 # Reuses tst-tls-many-dynamic-modules
2679 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep
)): \
2680 $(objpfx
)tst-tls-manydynamic
%mod-dep.os
: tst-tls-manydynamicmod.c
2681 $(compile-command.c
) \
2682 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2683 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep-bad
)): \
2684 $(objpfx
)tst-tls-manydynamic
%mod-dep-bad.os
: tst-tls-manydynamicmod.c
2685 $(compile-command.c
) \
2686 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2687 tst-tls20mod-bad.so-no-z-defs
= yes
2688 # Single dependency.
2689 $(objpfx
)tst-tls-manydynamic0mod-dep.so
: $(objpfx
)tst-tls-manydynamic1mod-dep.so
2690 # Double dependencies.
2691 $(objpfx
)tst-tls-manydynamic2mod-dep.so
: $(objpfx
)tst-tls-manydynamic3mod-dep.so \
2692 $(objpfx
)tst-tls-manydynamic4mod-dep.so
2693 # Double dependencies with each dependency dependent of another module.
2694 $(objpfx
)tst-tls-manydynamic5mod-dep.so
: $(objpfx
)tst-tls-manydynamic6mod-dep.so \
2695 $(objpfx
)tst-tls-manydynamic7mod-dep.so
2696 $(objpfx
)tst-tls-manydynamic6mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2697 $(objpfx
)tst-tls-manydynamic7mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2698 # Long chain with one double dependency in the middle
2699 $(objpfx
)tst-tls-manydynamic9mod-dep.so
: $(objpfx
)tst-tls-manydynamic10mod-dep.so \
2700 $(objpfx
)tst-tls-manydynamic11mod-dep.so
2701 $(objpfx
)tst-tls-manydynamic10mod-dep.so
: $(objpfx
)tst-tls-manydynamic12mod-dep.so
2702 $(objpfx
)tst-tls-manydynamic12mod-dep.so
: $(objpfx
)tst-tls-manydynamic13mod-dep.so
2703 # Long chain with two double dependencies in the middle
2704 $(objpfx
)tst-tls-manydynamic14mod-dep.so
: $(objpfx
)tst-tls-manydynamic15mod-dep.so
2705 $(objpfx
)tst-tls-manydynamic15mod-dep.so
: $(objpfx
)tst-tls-manydynamic16mod-dep.so \
2706 $(objpfx
)tst-tls-manydynamic17mod-dep.so
2707 $(objpfx
)tst-tls-manydynamic16mod-dep.so
: $(objpfx
)tst-tls-manydynamic18mod-dep.so \
2708 $(objpfx
)tst-tls-manydynamic19mod-dep.so
2709 # Same but with an invalid module.
2710 # Single dependency.
2711 $(objpfx
)tst-tls-manydynamic0mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2712 LDFLAGS-tst-tls-manydynamic0mod-dep-bad.so
= -Wl
,--no-as-needed
2713 # Double dependencies.
2714 $(objpfx
)tst-tls-manydynamic1mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic2mod-dep-bad.so \
2715 $(objpfx
)tst-tls20mod-bad.so
2716 LDFLAGS-tst-tls-manydynamic1mod-dep-bad.so
= -Wl
,--no-as-needed
2717 # Double dependencies with each dependency dependent of another module.
2718 $(objpfx
)tst-tls-manydynamic3mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so \
2719 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
2720 LDFLAGS-tst-tls-manydynamic3mod-dep-bad.so
= -Wl
,--no-as-needed
2721 $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2722 LDFLAGS-tst-tls-manydynamic4mod-dep-bad.so
= -Wl
,--no-as-needed
2723 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2724 LDFLAGS-tst-tls-manydynamic5mod-dep-bad.so
= -Wl
,--no-as-needed
2725 # Long chain with one double dependency in the middle
2726 $(objpfx
)tst-tls-manydynamic6mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so \
2727 $(objpfx
)tst-tls-manydynamic8mod-dep-bad.so
2728 LDFLAGS-tst-tls-manydynamic6mod-dep-bad.so
= -Wl
,--no-as-needed
2729 $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
2730 LDFLAGS-tst-tls-manydynamic7mod-dep-bad.so
= -Wl
,--no-as-needed
2731 $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2732 LDFLAGS-tst-tls-manydynamic9mod-dep-bad.so
= -Wl
,--no-as-needed
2733 # Long chain with two double dependencies in the middle
2734 $(objpfx
)tst-tls-manydynamic10mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
2735 LDFLAGS-tst-tls-manydynamic10mod-dep-bad.so
= -Wl
,--no-as-needed
2736 $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so \
2737 $(objpfx
)tst-tls-manydynamic13mod-dep-bad.so
2738 LDFLAGS-tst-tls-manydynamic11mod-dep-bad.so
= -Wl
,--no-as-needed
2739 $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic14mod-dep-bad.so \
2740 $(objpfx
)tst-tls20mod-bad.so
2741 LDFLAGS-tst-tls-manydynamic12mod-dep-bad.so
= -Wl
,--no-as-needed
2742 $(objpfx
)tst-tls20
: $(shared-thread-library
)
2743 $(objpfx
)tst-tls20.out
: $(objpfx
)tst-tls20mod-bad.so \
2744 $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
) \
2745 $(tst-tls-many-dynamic-modules-dep
:%=$(objpfx
)%.so
) \
2746 $(tst-tls-many-dynamic-modules-dep-bad
:%=$(objpfx
)%.so
) \
2748 # Reuses tst-tls-many-dynamic-modules
2749 $(objpfx
)tst-tls21
: $(shared-thread-library
)
2750 $(objpfx
)tst-tls21.out
: $(objpfx
)tst-tls21mod.so
2751 $(objpfx
)tst-tls21mod.so
: $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
)
2753 $(objpfx
)tst-getauxval-static.out
: $(objpfx
)tst-auxvalmod.so
2754 tst-getauxval-static-ENV
= LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
)
2756 $(objpfx
)tst-dlmopen-gethostbyname.out
: $(objpfx
)tst-dlmopen-gethostbyname-mod.so
2758 $(objpfx
)tst-ro-dynamic
: $(objpfx
)tst-ro-dynamic-mod.so
2759 $(objpfx
)tst-ro-dynamic-mod.so
: $(objpfx
)tst-ro-dynamic-mod.os \
2760 tst-ro-dynamic-mod.map
2761 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@ \
2763 -Wl
,--script
=tst-ro-dynamic-mod.map \
2764 $(objpfx
)tst-ro-dynamic-mod.os
2766 $(objpfx
)tst-rtld-list-diagnostics.out
: tst-rtld-list-diagnostics.py \
2767 $(..
)manual
/dynlink.texi
$(objpfx
)$(rtld-installed-name
)
2768 $(PYTHON
) tst-rtld-list-diagnostics.py \
2769 --manual
=$(..
)manual
/dynlink.texi \
2770 "$(test-wrapper-env) $(objpfx)$(rtld-installed-name) --list-diagnostics" \
2774 $(objpfx
)tst-rtld-run-static.out
: $(objpfx
)/ldconfig
2776 $(objpfx
)tst-dl_find_object.out
: \
2777 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2778 $(objpfx
)tst-dl_find_object-static.out
: \
2779 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2780 tst-dl_find_object-static-ENV
= $(static-dlopen-environment
)
2781 CFLAGS-tst-dl_find_object.c
+= -funwind-tables
2782 CFLAGS-tst-dl_find_object-static.c
+= -funwind-tables
2783 LDFLAGS-tst-dl_find_object-static
+= -Wl
,--eh-frame-hdr
2784 CFLAGS-tst-dl_find_object-mod1.c
+= -funwind-tables
2785 CFLAGS-tst-dl_find_object-mod2.c
+= -funwind-tables
2786 LDFLAGS-tst-dl_find_object-mod2.so
+= -Wl
,--enable-new-dtags
,-z
,nodelete
2787 $(objpfx
)tst-dl_find_object-threads
: $(shared-thread-library
)
2788 CFLAGS-tst-dl_find_object-threads.c
+= -funwind-tables
2789 $(objpfx
)tst-dl_find_object-threads.out
: \
2790 $(objpfx
)tst-dl_find_object-mod1.so \
2791 $(objpfx
)tst-dl_find_object-mod2.so \
2792 $(objpfx
)tst-dl_find_object-mod3.so \
2793 $(objpfx
)tst-dl_find_object-mod4.so \
2794 $(objpfx
)tst-dl_find_object-mod5.so \
2795 $(objpfx
)tst-dl_find_object-mod6.so \
2796 $(objpfx
)tst-dl_find_object-mod7.so \
2797 $(objpfx
)tst-dl_find_object-mod8.so \
2798 $(objpfx
)tst-dl_find_object-mod9.so
2799 CFLAGS-tst-dl_find_object-mod3.c
+= -funwind-tables
2800 CFLAGS-tst-dl_find_object-mod4.c
+= -funwind-tables
2801 CFLAGS-tst-dl_find_object-mod5.c
+= -funwind-tables
2802 CFLAGS-tst-dl_find_object-mod6.c
+= -funwind-tables
2803 CFLAGS-tst-dl_find_object-mod7.c
+= -funwind-tables
2804 CFLAGS-tst-dl_find_object-mod8.c
+= -funwind-tables
2805 CFLAGS-tst-dl_find_object-mod9.c
+= -funwind-tables
2807 $(objpfx
)tst-p_alignmod-base.so
: $(libsupport
)
2808 LDFLAGS-tst-p_alignmod-base.so
+= -Wl
,-z
,max-page-size
=0x200000
2810 $(objpfx
)tst-p_align1
: $(objpfx
)tst-p_alignmod1.so
2812 # Make a copy of tst-p_alignmod-base.so and lower p_align of the first
2814 $(objpfx
)tst-p_alignmod1.so
: $(objpfx
)tst-p_alignmod-base.so
2816 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2817 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a half
$@
2819 $(objpfx
)tst-p_align2
: $(objpfx
)tst-p_alignmod2.so
2821 # Make a copy of tst-p_alignmod-base.so and update p_align of the first
2823 $(objpfx
)tst-p_alignmod2.so
: $(objpfx
)tst-p_alignmod-base.so
2825 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2826 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a
1 $@
2828 LDFLAGS-tst-p_alignmod3.so
+= -Wl
,-z
,max-page-size
=0x100,-z
,common-page-size
=0x100
2830 $(objpfx
)tst-p_align3
: $(objpfx
)tst-p_alignmod3.so
2831 $(objpfx
)tst-p_align3.out
: tst-p_align3.sh
$(objpfx
)tst-p_align3
2832 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)'; \
2835 $(objpfx
)check-abi-version-libc.out
: $(common-objpfx
)libc.so
2836 LC_ALL
=C
$(READELF
) -V
-W
$< \
2837 | sed
-ne
'/.gnu.version_d/, /.gnu.version_r/ p' \
2838 | grep GLIBC_ABI_DT_RELR
> $@
; \
2841 $(objpfx
)check-tst-relr-pie.out
: $(objpfx
)tst-relr-pie
2842 LC_ALL
=C
$(OBJDUMP
) -p
$< \
2843 | sed
-ne
'/required from libc.so/,$$ p' \
2844 | grep GLIBC_ABI_DT_RELR
> $@
; \
2847 # The test checks if a DT_RELR shared library without DT_NEEDED works as
2848 # intended, so it uses an explicit link rule.
2849 $(objpfx
)tst-relr2
: $(objpfx
)tst-relr-mod2.so
2850 $(objpfx
)tst-relr-mod2.so
: $(objpfx
)tst-relr-mod2.os
2851 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2852 $(LDFLAGS-soname-fname
) \
2853 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2854 $(call after-link
,$@.new
)
2857 # The test checks if a DT_RELR shared library without DT_VERNEED works as
2858 # intended, so it uses an explicit link rule.
2859 $(objpfx
)tst-relr3
: $(objpfx
)tst-relr-mod3a.so
2860 $(objpfx
)tst-relr-mod3b.so
: $(objpfx
)tst-relr-mod3b.os
2861 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2862 $(LDFLAGS-soname-fname
) \
2863 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2864 $(call after-link
,$@.new
)
2867 $(objpfx
)tst-relr-mod3a.so
: $(objpfx
)tst-relr-mod3a.os \
2868 $(objpfx
)tst-relr-mod3b.so
2869 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2870 $(LDFLAGS-soname-fname
) $(LDFLAGS-rpath-ORIGIN
) \
2871 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2872 $(call after-link
,$@.new
)
2875 # The test checks if a DT_RELR shared library without libc.so on DT_NEEDED
2876 # works as intended, so it uses an explicit link rule.
2877 $(objpfx
)tst-relr4
: $(objpfx
)tst-relr-mod4a.so
2878 $(objpfx
)tst-relr-mod4b.so
: $(objpfx
)tst-relr-mod4b.os
2879 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2880 $(LDFLAGS-soname-fname
) \
2881 -Wl
,--version-script
=tst-relr-mod4b.map \
2882 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2883 $(call after-link
,$@.new
)
2886 $(objpfx
)tst-relr-mod4a.so
: $(objpfx
)tst-relr-mod4a.os \
2887 $(objpfx
)tst-relr-mod4b.so
2888 $(LINK.o
) -nostdlib
-nostartfiles
-Wl
,-z
,pack-relative-relocs \
2889 $(LDFLAGS-soname-fname
) $(LDFLAGS-rpath-ORIGIN
) \
2890 -shared
-o
$@.new
$(filter-out $(map-file
),$^
)
2891 $(call after-link
,$@.new
)
2894 LDFLAGS-libtracemod1-1.so
+= -Wl
,-soname
,libtracemod1.so
2895 LDFLAGS-libtracemod2-1.so
+= -Wl
,-soname
,libtracemod2.so
2896 LDFLAGS-libtracemod3-1.so
+= -Wl
,-soname
,libtracemod3.so
2897 LDFLAGS-libtracemod4-1.so
+= -Wl
,-soname
,libtracemod4.so
2898 LDFLAGS-libtracemod5-1.so
+= -Wl
,-soname
,libtracemod5.so
2900 $(objpfx
)libtracemod1-1.so
: $(objpfx
)libtracemod2-1.so \
2901 $(objpfx
)libtracemod3-1.so
2902 $(objpfx
)libtracemod2-1.so
: $(objpfx
)libtracemod4-1.so \
2903 $(objpfx
)libtracemod5-1.so
2905 define libtracemod-x
2906 $(objpfx
)libtracemod
$(1)/libtracemod
$(1).so
: $(objpfx
)libtracemod
$(1)-1.so
2907 $$(make-target-directory
)
2910 libtracemod-suffixes
= 1 2 3 4 5
2911 $(foreach i
,$(libtracemod-suffixes
), $(eval
$(call libtracemod-x
,$(i
))))
2913 define tst-trace-skeleton
2914 $(objpfx
)tst-trace
$(1).out
: $(objpfx
)libtracemod1
/libtracemod1.so \
2915 $(objpfx
)libtracemod2
/libtracemod2.so \
2916 $(objpfx
)libtracemod3
/libtracemod3.so \
2917 $(objpfx
)libtracemod4
/libtracemod4.so \
2918 $(objpfx
)libtracemod5
/libtracemod5.so \
2919 $(..
)scripts
/tst-ld-trace.py \
2921 ${ $(PYTHON
) $(..
)scripts
/tst-ld-trace.py \
2922 "$(test-wrapper-env) $(elf-objpfx)$(rtld-installed-name) \
2923 --library-path $(common-objpfx):$(strip $(2)) \
2924 $(objpfx)libtracemod1/libtracemod1.so" tst-trace
$(1).exp \
2925 } > $$@
; $$(evaluate-test
)
2928 $(eval
$(call tst-trace-skeleton
,1,))
2929 $(eval
$(call tst-trace-skeleton
,2,\
2930 $(objpfx
)libtracemod2
))
2931 $(eval
$(call tst-trace-skeleton
,3,\
2932 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
))
2933 $(eval
$(call tst-trace-skeleton
,4,\
2934 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
:$(objpfx
)libtracemod4
))
2935 $(eval
$(call tst-trace-skeleton
,5,\
2936 $(objpfx
)libtracemod2
:$(objpfx
)libtracemod3
:$(objpfx
)libtracemod4
:$(objpfx
)libtracemod5
))
2938 $(objpfx
)tst-tls-allocation-failure-static-patched
: \
2939 $(objpfx
)tst-tls-allocation-failure-static
$(..
)scripts
/tst-elf-edit.py
2941 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
--maximize-tls-size
$@
2943 $(objpfx
)tst-tls-allocation-failure-static-patched.out
: \
2944 $(objpfx
)tst-tls-allocation-failure-static-patched
2945 $< > $@
2>&1; echo
"status: $$?" >> $@
2946 grep
-q
'^Fatal glibc error: Cannot allocate TLS block$$' $@ \
2947 && grep
-q
'^status: 127$$' $@
; \
2950 $(objpfx
)tst-audit-tlsdesc
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
2951 $(objpfx
)tst-audit-tlsdesc-mod2.so \
2952 $(shared-thread-library
)
2953 ifeq (yes
,$(have-mtls-dialect-gnu2
))
2954 # The test is valid for all TLS types, but we want to exercise GNU2
2956 CFLAGS-tst-audit-tlsdesc-mod1.c
+= -mtls-dialect
=gnu2
2957 CFLAGS-tst-audit-tlsdesc-mod2.c
+= -mtls-dialect
=gnu2
2959 $(objpfx
)tst-audit-tlsdesc-dlopen
: $(shared-thread-library
)
2960 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
2961 $(objpfx
)tst-audit-tlsdesc-mod2.so
2962 $(objpfx
)tst-audit-tlsdesc-mod1.so
: $(objpfx
)tst-audit-tlsdesc-mod2.so
2963 $(objpfx
)tst-audit-tlsdesc.out
: $(objpfx
)tst-auditmod-tlsdesc.so
2964 tst-audit-tlsdesc-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
2965 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-auditmod-tlsdesc.so
2966 tst-audit-tlsdesc-dlopen-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
2968 $(objpfx
)tst-dlmopen-twice.out
: \
2969 $(objpfx
)tst-dlmopen-twice-mod1.so \
2970 $(objpfx
)tst-dlmopen-twice-mod2.so
2972 LDFLAGS-tst-sprof-mod.so
= -Wl
,-soname
,tst-sprof-mod.so
2973 $(objpfx
)tst-sprof-basic
: $(objpfx
)tst-sprof-mod.so
2974 $(objpfx
)tst-sprof-basic.out
: tst-sprof-basic.sh
$(objpfx
)tst-sprof-basic
2975 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
2976 '$(run-program-env)' > $@
; \
2978 generated
+= tst-sprof-mod.so.profile
2980 LDFLAGS-tst-dlclose-lazy-mod1.so
= -Wl
,-z
,lazy
,--no-as-needed
2981 $(objpfx
)tst-dlclose-lazy-mod1.so
: $(objpfx
)tst-dlclose-lazy-mod2.so
2982 $(objpfx
)tst-dlclose-lazy.out
: \
2983 $(objpfx
)tst-dlclose-lazy-mod1.so
$(objpfx
)tst-dlclose-lazy-mod2.so
2985 $(objpfx
)tst-decorate-maps
: $(shared-thread-library
)
2987 tst-decorate-maps-ENV
= \
2988 GLIBC_TUNABLES
=glibc.malloc.arena_max
=8:glibc.malloc.mmap_threshold
=1024
2989 tst-decorate-maps-ARGS
= 8