1 # Copyright (C) 1995-2022 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
18 # Makefile for elf subdirectory of GNU C Library.
27 bits
/link_lavcurrent.h \
51 # The core dynamic linking functions are in libc for the static and
54 dl-call-libc-early-init \
79 dl-thread_gscope_wait \
87 ifeq (yes
,$(use-ldconfig
))
88 dl-routines
+= dl-cache
91 ifneq (no
,$(have-tunables
))
92 dl-routines
+= dl-tunables
93 tunables-type
= $(addprefix TUNABLES_FRONTEND_
,$(have-tunables
))
94 CPPFLAGS-dl-tunables.c
+= -DTUNABLES_FRONTEND
=$(tunables-type
)
96 ifeq (yesyes
,$(build-shared
)$(run-built-tests
))
97 tests-special
+= $(objpfx
)list-tunables.out
100 # Make sure that the compiler does not insert any library calls in tunables
102 ifeq (yes
,$(have-loop-to-function
))
103 CFLAGS-dl-tunables.c
+= -fno-tree-loop-distribute-patterns
107 all-dl-routines
= $(dl-routines
) $(sysdep-dl-routines
)
108 # But they are absent from the shared libc, because that code is in ld.so.
109 elide-routines.os
= \
113 dl-reloc-static-pie \
121 # These object files are only included in the dynamically-linked libc.
122 shared-only-routines
= libc-dl_find_object
124 # ld.so uses those routines, plus some special stuff for being the program
125 # interpreter and operating independent of libc.
132 dl-diagnostics-kernel \
146 all-rtld-routines
= $(rtld-routines
) $(sysdep-rtld-routines
)
148 CFLAGS-dl-runtime.c
+= -fexceptions
-fasynchronous-unwind-tables
149 CFLAGS-dl-lookup.c
+= -fexceptions
-fasynchronous-unwind-tables
150 CFLAGS-dl-iteratephdr.c
+= $(uses-callbacks
)
152 # Called during static library initialization, so turn stack-protection
153 # off for non-shared builds.
154 CFLAGS-dl-minimal-malloc.o
= $(no-stack-protector
)
155 CFLAGS-dl-minimal-malloc.op
= $(no-stack-protector
)
157 # On targets without __builtin_memset, rtld.c uses a hand-coded loop
158 # in _dl_start. Make sure this isn't turned into a call to regular memset.
159 ifeq (yes
,$(have-loop-to-function
))
160 CFLAGS-rtld.c
+= -fno-tree-loop-distribute-patterns
163 ifeq (yes
,$(have-loop-to-function
))
164 # Likewise, during static library startup, memset is not yet available.
165 CFLAGS-dl-support.c
= -fno-tree-loop-distribute-patterns
168 # Compile rtld itself without stack protection.
169 # Also compile all routines in the static library that are elided from
170 # the shared libc because they are in libc.a in the same way.
172 CFLAGS-.o
+= $(call elide-stack-protector
,.o
,$(elide-routines.os
))
173 CFLAGS-.op
+= $(call elide-stack-protector
,.op
,$(elide-routines.os
))
174 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,$(all-rtld-routines
))
176 # Add the requested compiler flags to the early startup code.
177 CFLAGS-dl-printf.os
+= $(rtld-early-cflags
)
178 CFLAGS-dl-setup_hash.os
+= $(rtld-early-cflags
)
179 CFLAGS-dl-sysdep.os
+= $(rtld-early-cflags
)
180 CFLAGS-dl-tunables.os
+= $(rtld-early-cflags
)
181 CFLAGS-dl-write.os
+= $(rtld-early-cflags
)
182 CFLAGS-dl-writev.os
+= $(rtld-early-cflags
)
183 CFLAGS-rtld.os
+= $(rtld-early-cflags
)
185 ifeq ($(unwind-find-fde
),yes
)
186 routines
+= unwind-dw2-fde-glibc
187 shared-only-routines
+= unwind-dw2-fde-glibc
190 before-compile
+= $(objpfx
)trusted-dirs.h
191 generated
+= trusted-dirs.h trusted-dirs.st for-renamed
/renamed.so
192 generated-dirs
+= for-renamed
194 ifeq ($(build-shared
),yes
)
195 ld-map
= $(common-objpfx
)ld.map
198 ifeq (yes
,$(build-shared
))
200 $(all-rtld-routines
:%=%.os
) \
209 install-others
= $(inst_rtlddir
)/$(rtld-installed-name
) $(inst_bindir
)/ld.so
210 install-bin-script
= ldd
216 install-rootsbin
= sln
217 sln-modules
:= static-stubs
218 extra-objs
+= $(sln-modules
:=.o
)
220 ifeq (yes
,$(use-ldconfig
))
221 ifeq (yes
,$(build-shared
))
222 others-static
+= ldconfig
224 install-rootsbin
+= ldconfig
226 ldconfig-modules
:= \
235 extra-objs
+= $(ldconfig-modules
:=.o
)
236 others-extras
= $(ldconfig-modules
)
240 # To find xmalloc.c and xstrdup.c
241 vpath
%.c ..
/locale
/programs
243 ifeq ($(build-shared
),yes
)
244 extra-objs
+= sotruss-lib.os sotruss-lib.so
245 install-others
+= $(inst_auditdir
)/sotruss-lib.so
246 install-bin-script
+= sotruss
248 libof-sotruss-lib
= extramodules
249 LDFLAGS-sotruss-lib.so
+= $(z-now-
$(bind-now
))
250 $(objpfx
)sotruss-lib.so
: $(objpfx
)sotruss-lib.os
251 $(build-module-asneeded
)
252 $(objpfx
)sotruss-lib.so
: $(common-objpfx
)libc.so
$(objpfx
)ld.so \
253 $(common-objpfx
)libc_nonshared.a
255 $(objpfx
)sotruss
: sotruss.sh
$(common-objpfx
)config.make
256 sed
-e
's%@VERSION@%$(version)%g' \
257 -e
's%@TEXTDOMAINDIR@%$(localedir)%g' \
258 -e
's%@PREFIX@%$(prefix)%g' \
259 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
260 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
264 $(inst_auditdir
)/sotruss-lib.so
: $(objpfx
)sotruss-lib.so
$(+force)
265 $(do-install-program
)
268 tests-static-normal
:= \
274 tst-env-setuid-tunables \
275 tst-getauxval-static \
277 tst-single_threaded-pthread-static \
278 tst-single_threaded-static \
279 tst-tlsalign-extern-static \
280 tst-tlsalign-static \
281 # tests-static-normal
283 tests-static-internal
:= \
284 tst-dl_find_object-static \
285 tst-ptrguard1-static \
286 tst-stackguard1-static \
288 tst-tls1-static-non-pie \
289 # tests-static-internal
291 CRT-tst-tls1-static-non-pie
:= $(csu-objpfx
)crt1.o
292 tst-tls1-static-non-pie-no-pie
= yes
295 tst-ldconfig-bad-aux-cache \
296 tst-ldconfig-ld_so_conf-update \
299 ifeq (no
,$(build-hardcoded-path-in-tests
))
300 # This is an ld.so.cache test, and RPATH/RUNPATH in the executable
301 # interferes with its test objectives.
302 tests-container
+= tst-glibc-hwcaps-prepend-cache
318 $(tests-static-internal
) \
322 tests-static
:= $(tests-static-normal
) $(tests-static-internal
)
324 ifeq (yes
,$(build-shared
))
326 tst-single_threaded-static-dlopen \
330 static-dlopen-environment
= \
331 LD_LIBRARY_PATH
=$(ld-library-path
):$(common-objpfx
)dlfcn
332 tst-tls9-static-ENV
= $(static-dlopen-environment
)
333 tst-single_threaded-static-dlopen-ENV
= $(static-dlopen-environment
)
404 tst-dlmopen-dlerror \
405 tst-dlmopen-gethostbyname \
410 tst-dlopen-tlsmodid \
413 tst-filterobj-dlopen \
415 tst-glibc-hwcaps-mask \
416 tst-glibc-hwcaps-prepend \
419 tst-initfinilazyfail \
425 tst-nodelete-dlclose \
426 tst-nodelete-opened \
434 tst-rtld-run-static \
435 tst-single_threaded \
436 tst-single_threaded-pthread \
437 tst-sonamemove-dlopen \
438 tst-sonamemove-link \
455 tst-tlsalign-extern \
459 tst-tls-manydynamic \
473 tst-dlopen-nodelete-reloc \
479 tests
+= $(if
$(CXX
),$(tests-cxx
))
490 tst-dl-hwcaps_split \
492 tst-dl_find_object-threads \
506 tst-dlopen-self-container \
507 tst-dlopen-tlsmodid-container \
509 tst-preload-pthread-libc \
516 ifeq (yes
,$(have-fpie
))
517 tests-pie
+= tst-align3
519 selinux-enabled
:= $(shell cat
/selinux
/enforce
2> /dev
/null
)
521 ifneq ($(selinux-enabled
),1)
522 tests-execstack-yes
= \
524 tst-execstack-needed \
526 # tests-execstack-yes
528 ifeq ($(have-depaudit
),yes
)
535 ifeq ($(run-built-tests
),yes
)
537 $(objpfx
)tst-audit14-cmp.out \
538 $(objpfx
)tst-audit14a-cmp.out \
539 $(objpfx
)tst-audit15-cmp.out \
540 $(objpfx
)tst-audit16-cmp.out \
546 ifeq ($(run-built-tests
),yes
)
547 tests-special
+= $(objpfx
)tst-valgrind-smoke.out
549 $(objpfx
)tst-valgrind-smoke.out
: tst-valgrind-smoke.sh
$(objpfx
)ld.so
$(objpfx
)valgrind-test
550 $(SHELL
) $< $(objpfx
)ld.so
$(rtlddir
)/$(rtld-installed-name
) '$(test-wrapper-env)' \
551 '$(run-program-env)' '$(rpath-link)' $(objpfx
)valgrind-test
> $@
; $(evaluate-test
)
553 tests
+= $(tests-execstack-
$(have-z-execstack
))
554 ifeq ($(run-built-tests
),yes
)
556 $(objpfx
)noload-mem.out \
557 $(objpfx
)tst-ldconfig-X.out \
558 $(objpfx
)tst-leaks1-mem.out \
559 $(objpfx
)tst-rtld-help.out \
562 tlsmod17a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
563 tlsmod18a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
564 tlsmod17a-modules
= $(addprefix tst-tlsmod17a
, $(tlsmod17a-suffixes
))
565 tlsmod18a-modules
= $(addprefix tst-tlsmod18a
, $(tlsmod17a-suffixes
))
566 one-hundred
= $(foreach x
,0 1 2 3 4 5 6 7 8 9, \
567 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
568 tst-tls-many-dynamic-modules
:= \
569 $(foreach n
,$(one-hundred
),tst-tls-manydynamic
$(n
)mod
)
570 tst-tls-many-dynamic-modules-dep-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 \
572 tst-tls-many-dynamic-modules-dep
= \
573 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-suffixes
),tst-tls-manydynamic
$(n
)mod-dep
)
574 tst-tls-many-dynamic-modules-dep-bad-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
575 tst-tls-many-dynamic-modules-dep-bad
= \
576 $(foreach n
,$(tst-tls-many-dynamic-modules-dep-bad-suffixes
),tst-tls-manydynamic
$(n
)mod-dep-bad
)
578 $(tlsmod17a-modules
:=.os
) \
579 $(tlsmod18a-modules
:=.os
) \
580 tst-tlsalign-vars.o \
674 tst-absolute-sym-lib \
675 tst-absolute-zero-lib \
737 tst-dl_find_object-mod1 \
738 tst-dl_find_object-mod2 \
739 tst-dl_find_object-mod3 \
740 tst-dl_find_object-mod4 \
741 tst-dl_find_object-mod5 \
742 tst-dl_find_object-mod6 \
743 tst-dl_find_object-mod7 \
744 tst-dl_find_object-mod8 \
745 tst-dl_find_object-mod9 \
747 tst-dlmopen-dlerror-mod \
748 tst-dlmopen-gethostbyname-mod \
749 tst-dlopenfaillinkmod \
753 tst-dlopenfailnodelmod \
756 tst-filterobj-filtee \
758 tst-finilazyfailmod \
760 tst-initlazyfailmod \
772 tst-ldconfig-ld-mod \
775 tst-nodelete-dlclose-dso \
776 tst-nodelete-dlclose-plugin \
777 tst-nodelete-opened-lib \
779 tst-p_alignmod-base \
784 tst-single_threaded-mod1 \
785 tst-single_threaded-mod2 \
786 tst-single_threaded-mod3 \
787 tst-single_threaded-mod4 \
788 tst-sonamemove-linkmod1 \
789 tst-sonamemove-runmod1 \
790 tst-sonamemove-runmod2 \
829 tst-unwind-ctor-lib \
855 modules-names-cxx
= \
856 tst-dlopen-nodelete-reloc-mod1 \
857 tst-dlopen-nodelete-reloc-mod10 \
858 tst-dlopen-nodelete-reloc-mod11 \
859 tst-dlopen-nodelete-reloc-mod12 \
860 tst-dlopen-nodelete-reloc-mod13 \
861 tst-dlopen-nodelete-reloc-mod14 \
862 tst-dlopen-nodelete-reloc-mod15 \
863 tst-dlopen-nodelete-reloc-mod16 \
864 tst-dlopen-nodelete-reloc-mod17 \
865 tst-dlopen-nodelete-reloc-mod2 \
866 tst-dlopen-nodelete-reloc-mod3 \
867 tst-dlopen-nodelete-reloc-mod4 \
868 tst-dlopen-nodelete-reloc-mod5 \
869 tst-dlopen-nodelete-reloc-mod6 \
870 tst-dlopen-nodelete-reloc-mod7 \
871 tst-dlopen-nodelete-reloc-mod8 \
872 tst-dlopen-nodelete-reloc-mod9 \
873 tst-nodelete-rtldmod \
874 tst-nodelete-uniquemod \
882 $(if
$(CXX
),$(modules-names-cxx
)) \
883 $(modules-execstack-
$(have-z-execstack
)) \
884 $(tlsmod17a-modules
) \
885 $(tlsmod18a-modules
) \
886 $(tst-tls-many-dynamic-modules
) \
887 $(tst-tls-many-dynamic-modules-dep
) \
888 $(tst-tls-many-dynamic-modules-dep-bad
) \
891 # Most modules build with _ISOMAC defined, but those filtered out
892 # depend on internal headers.
893 modules-names-tests
= $(filter-out ifuncmod
% tst-tlsmod
%,\
896 # For +depfiles in Makerules.
897 extra-test-objs
+= tst-auditmod17.os
899 ifeq (yes
,$(have-mtls-dialect-gnu2
))
900 tests
+= tst-gnu2-tls1
901 modules-names
+= tst-gnu2-tls1mod
902 $(objpfx
)tst-gnu2-tls1
: $(objpfx
)tst-gnu2-tls1mod.so
903 tst-gnu2-tls1mod.so-no-z-defs
= yes
904 CFLAGS-tst-gnu2-tls1mod.c
+= -mtls-dialect
=gnu2
906 tests
+= tst-audit-tlsdesc tst-audit-tlsdesc-dlopen
907 modules-names
+= tst-audit-tlsdesc-mod1 tst-audit-tlsdesc-mod2 tst-auditmod-tlsdesc
908 $(objpfx
)tst-audit-tlsdesc
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
909 $(objpfx
)tst-audit-tlsdesc-mod2.so \
910 $(shared-thread-library
)
911 CFLAGS-tst-audit-tlsdesc-mod1.c
+= -mtls-dialect
=gnu2
912 CFLAGS-tst-audit-tlsdesc-mod2.c
+= -mtls-dialect
=gnu2
913 $(objpfx
)tst-audit-tlsdesc-dlopen
: $(shared-thread-library
)
914 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-audit-tlsdesc-mod1.so \
915 $(objpfx
)tst-audit-tlsdesc-mod2.so
916 $(objpfx
)tst-audit-tlsdesc-mod1.so
: $(objpfx
)tst-audit-tlsdesc-mod2.so
917 $(objpfx
)tst-audit-tlsdesc.out
: $(objpfx
)tst-auditmod-tlsdesc.so
918 tst-audit-tlsdesc-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
919 $(objpfx
)tst-audit-tlsdesc-dlopen.out
: $(objpfx
)tst-auditmod-tlsdesc.so
920 tst-audit-tlsdesc-dlopen-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod-tlsdesc.so
922 ifeq (yes
,$(have-protected-data
))
923 modules-names
+= tst-protected1moda tst-protected1modb
924 tests
+= tst-protected1a tst-protected1b
925 $(objpfx
)tst-protected1a
: $(addprefix $(objpfx
),tst-protected1moda.so tst-protected1modb.so
)
926 $(objpfx
)tst-protected1b
: $(addprefix $(objpfx
),tst-protected1modb.so tst-protected1moda.so
)
927 tst-protected1modb.so-no-z-defs
= yes
928 # These tests fail with GCC versions prior to 5.1 and with some versions
929 # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
930 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
931 # Perhaps in future we can make these XFAILs conditional on some detection
932 # of compiler/linker behavior/version.
933 test-xfail-tst-protected1a
= yes
934 test-xfail-tst-protected1b
= yes
936 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
937 modules-names
+= tst-piemod1
938 tests
+= tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \
940 tests-pie
+= tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie
941 ifeq (yes
,$(have-protected-data
))
944 CFLAGS-vismain.c
+= $(PIE-ccflag
)
947 modules-execstack-yes
= tst-execstack-mod
948 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
950 # filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special
952 modules-names-nobuild
:= filtmod1 tst-big-note-lib tst-ro-dynamic-mod \
953 tst-audit24bmod1 tst-audit24bmod2
955 tests
+= $(tests-static
)
957 ifeq (yes
,$(have-ifunc
))
958 tests-ifuncstatic
:= \
960 ifuncmain1picstatic \
962 ifuncmain2picstatic \
964 ifuncmain4picstatic \
966 ifuncmain5picstatic \
968 ifuncmain7picstatic \
970 ifeq (yes
,$(have-gcc-ifunc
))
971 tests-ifuncstatic
+= ifuncmain9static ifuncmain9picstatic
973 tests-static
+= $(tests-ifuncstatic
)
974 tests-internal
+= $(tests-ifuncstatic
)
975 ifeq (yes
,$(build-shared
))
977 tst-ifunc-fault-bindnow \
978 tst-ifunc-fault-lazy \
980 # Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8.
983 ifuncmain1staticpic \
990 ifuncmain5staticpic \
994 ifeq (no
,$(with-lld
))
1001 ifeq (yes
,$(have-gcc-ifunc
))
1007 ifunc-test-modules
= \
1014 # ifunc-test-modules
1015 extra-test-objs
+= $(ifunc-test-modules
:=.o
)
1016 test-internal-extras
+= $(ifunc-test-modules
)
1017 ifeq (yes
,$(have-fpie
))
1020 ifuncmain1staticpie \
1025 ifeq (yes
,$(have-gcc-ifunc
))
1026 ifunc-pie-tests
+= ifuncmain9pie
1028 ifeq (no
,$(with-lld
))
1029 ifunc-pie-tests
+= ifuncmain5pie
1031 ifeq (yes
,$(have-textrel_ifunc
))
1032 ifunc-pie-tests
+= tst-ifunc-textrel
1034 tests-internal
+= $(ifunc-pie-tests
)
1035 tests-pie
+= $(ifunc-pie-tests
)
1042 ifeq (no
,$(with-lld
))
1043 modules-names
+= ifuncmod5
1048 ifeq (yes
,$(build-shared
))
1049 ifeq ($(run-built-tests
),yes
)
1051 $(objpfx
)argv0test.out \
1052 $(objpfx
)tst-pathopt.out \
1053 $(objpfx
)tst-rtld-help.out \
1054 $(objpfx
)tst-rtld-load-self.out \
1055 $(objpfx
)tst-rtld-preload.out \
1059 $(objpfx
)check-execstack.out \
1060 $(objpfx
)check-initfini.out \
1061 $(objpfx
)check-localplt.out \
1062 $(objpfx
)check-textrel.out \
1063 $(objpfx
)check-wx-segment.out \
1067 ifeq ($(run-built-tests
),yes
)
1069 $(objpfx
)order-cmp.out \
1070 $(objpfx
)order2-cmp.out \
1071 $(objpfx
)tst-array1-cmp.out \
1072 $(objpfx
)tst-array1-static-cmp.out \
1073 $(objpfx
)tst-array2-cmp.out \
1074 $(objpfx
)tst-array3-cmp.out \
1075 $(objpfx
)tst-array4-cmp.out \
1076 $(objpfx
)tst-array5-cmp.out \
1077 $(objpfx
)tst-array5-static-cmp.out \
1078 $(objpfx
)tst-initorder-cmp.out \
1079 $(objpfx
)tst-initorder2-cmp.out \
1080 $(objpfx
)tst-unused-dep-cmp.out \
1081 $(objpfx
)tst-unused-dep.out \
1085 ifndef avoid-generated
1086 # DSO sorting tests:
1087 # The dso-ordering-test.py script generates testcase source files in $(objpfx),
1088 # creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a
1089 # Makefile fragment to be included.
1090 define include_dsosort_tests
1091 $(objpfx
)$(1).generated-makefile
: $(1)
1092 $(PYTHON
) $(..
)scripts
/dso-ordering-test.py \
1093 --description-file
$$< --objpfx
$(objpfx
) --output-makefile
$$@T
1095 -include $(objpfx
)$(1).generated-makefile
1099 postclean-generated
+= $(objpfx
)/dso-sort-tests-2.generated-makefile \
1100 $(objpfx
)/dso-sort-tests-2.generated-makefile
1102 # Generate from each testcase description file
1103 ifeq (yes
,$(have-tunables
))
1104 $(eval
$(call include_dsosort_tests
,dso-sort-tests-1.def
))
1105 $(eval
$(call include_dsosort_tests
,dso-sort-tests-2.def
))
1108 check-abi
: $(objpfx
)check-abi-ld.out
1109 tests-special
+= $(objpfx
)check-abi-ld.out
1110 update-abi
: update-abi-ld
1111 update-all-abi
: update-all-abi-ld
1113 # The test requires shared _and_ PIE because the executable
1114 # unit test driver must be able to link with the shared object
1115 # that is going to eventually go into an installed DSO.
1116 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1117 tests-internal
+= tst-_dl_addr_inside_object
1118 tests-pie
+= tst-_dl_addr_inside_object
1119 $(objpfx
)tst-_dl_addr_inside_object
: $(objpfx
)dl-addr-obj.os
1120 CFLAGS-tst-_dl_addr_inside_object.c
+= $(PIE-ccflag
)
1123 # We can only test static libcrypt use if libcrypt has been built,
1124 # and either NSS crypto is not in use, or static NSS libraries are
1126 ifeq ($(build-crypt
),no
)
1127 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=0
1129 ifeq ($(nss-crypt
),no
)
1130 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=1
1132 ifeq ($(static-nss-crypt
),no
)
1133 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=0
1135 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=1
1142 ifeq (yes
,$(build-shared
))
1143 # Make sure these things are built in the `make lib' pass so they can be used
1144 # to run programs during the `make others' pass.
1145 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
1146 $(addprefix $(objpfx
),$(extra-objs
))
1149 # Command to link into a larger single relocatable object.
1150 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
1152 $(objpfx
)sotruss-lib.so
: $(shlib-lds
)
1154 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
1155 $(reloc-link
) -o
$@
$^
1157 # Link together the dynamic linker into a single relocatable object.
1158 # First we do a link against libc_pic.a just to get a link map,
1159 # and discard the object produced by that link. From the link map
1160 # we can glean all the libc modules that need to go into the dynamic
1161 # linker. Then we do a recursive make that goes into all the subdirs
1162 # those modules come from and builds special rtld-foo.os versions that
1163 # are compiled with special flags, and puts these modules into rtld-libc.a
1164 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
1166 # These symbols need to be stubbed out during symbol discovery because
1167 # their implementation is provided differently in rtld, and the symbol
1168 # discovery mechanism is not compatible with the libc implementation
1169 # when compiled for libc.
1170 rtld-stubbed-symbols
= \
1171 __GI___pthread_disable_asynccancel \
1172 __GI___pthread_enable_asynccancel \
1173 __pthread_disable_asynccancel \
1174 __pthread_enable_asynccancel \
1179 # rtld-stubbed-symbols
1181 ifeq ($(have-ssp
),yes
)
1182 # rtld is not built with the stack protector, so these references will
1183 # go away in the rebuilds.
1184 rtld-stubbed-symbols
+= __stack_chk_fail __stack_chk_fail_local
1187 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
1189 for symbol in
$(rtld-stubbed-symbols
); do \
1190 echo
".globl $$symbol"; \
1192 done |
$(CC
) -o
$@T.o
$(ASFLAGS
) -c
-x assembler
-
1193 $(reloc-link
) -o
$@.o
$@T.o
'-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
1197 # For lld, skip preceding addresses and values before matching the archive and the member.
1198 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
1200 sed
-n
's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
1202 while read lib file
; do \
1205 LC_ALL
=C fgrep
-l
/$$file \
1206 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
1208 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
1211 echo rtld-
$${lib
%%/*} += $$file ;; \
1212 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
1215 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
1216 | LC_ALL=C sort -u` >> $@T
1219 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
1220 $(MAKE
) -f
$< -f rtld-Rules
1222 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
1223 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
1226 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
1228 z-now-yes
= -Wl
,-z
,now
1230 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
1231 # Link into a temporary file so that we don't touch $@ at all
1232 # if the sanity check below fails.
1233 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
1234 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
1235 $(filter-out $(map-file
),$^
) $(load-map-file
) \
1236 -Wl
,-soname
=$(rtld-installed-name
) \
1237 -Wl
,-defsym
=_begin
=0
1238 $(call after-link
,$@.new
)
1239 $(READELF
) -s
$@.new \
1240 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
1243 ifeq (yes
,$(build-shared
))
1244 # interp.c exists just to get the runtime linker path into libc.so.
1245 $(objpfx
)interp.os
: $(common-objpfx
)runtime-linker.h
1248 ifneq (ld.so
,$(rtld-installed-name
))
1249 # Make sure ld.so.1 exists in the build directory so we can link
1251 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
1253 generated
+= $(rtld-installed-name
)
1256 # Build a file mentioning all trustworthy directories to look for shared
1257 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
1258 # add directories to the list by defining $(user-defined-trusted-dirs)
1259 # before starting make.
1260 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
1261 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
1262 $(make-target-directory
)
1263 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
1264 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
1265 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
1266 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
1268 CPPFLAGS-dl-load.c
+= -I
$(objpfx
).
-I
$(csu-objpfx
).
1270 ifeq (yes
,$(build-shared
))
1271 $(inst_rtlddir
)/$(rtld-installed-name
): $(objpfx
)ld.so
$(+force)
1272 $(make-target-directory
)
1273 $(do-install-program
)
1275 # Creates the relative /usr/bin/ld.so symbolic link.
1276 $(inst_bindir
)/ld.so
: $(inst_rtlddir
)/$(rtld-installed-name
)
1277 $(make-target-directory
)
1280 # Special target called by parent to install just the dynamic linker.
1281 .PHONY
: ldso_install
1282 ldso_install
: $(inst_rtlddir
)/$(rtld-installed-name
)
1283 endif # $(build-shared)
1286 # Workarounds for ${exec_prefix} expansion in configure variables.
1287 # config.status cannot be used directly for processing ldd.bash.in or
1288 # expanding variables such as sysconfdir because the expansion
1289 # contains the literal string ${exec_prefix}, which is not valid in C
1290 # headers or installed shell scripts.
1292 ldd-rewrite
= -e
's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
1293 -e
's%@VERSION@%$(version)%g' \
1294 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
1295 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
1296 -e
's%@TEXTDOMAINDIR@%$(localedir)%g'
1298 ifeq ($(ldd-rewrite-script
),no
)
1300 LC_ALL
=C sed
$(ldd-rewrite
) < $< > $@.new
1304 LC_ALL
=C sed
$(ldd-rewrite
) < $< \
1305 | LC_ALL
=C sed
-f
$(patsubst $(..
)/%,/%,$(..
)$(ldd-rewrite-script
)) > $@.new
1309 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
1310 $(common-objpfx
)config.make
1315 $(objpfx
)sln
: $(sln-modules
:%=$(objpfx
)%.o
)
1317 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
1319 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
1320 CFLAGS-ldconfig.c
+= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
1321 -D
'SLIBDIR="$(slibdir)"'
1322 libof-ldconfig
= ldconfig
1323 CFLAGS-dl-cache.c
+= $(SYSCONF-FLAGS
)
1324 CFLAGS-cache.c
+= $(SYSCONF-FLAGS
)
1325 CFLAGS-rtld.c
+= $(SYSCONF-FLAGS
)
1326 CFLAGS-dl-usage.c
+= $(SYSCONF-FLAGS
) \
1327 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1328 CFLAGS-dl-diagnostics.c
+= $(SYSCONF-FLAGS
) \
1329 -D
'PREFIX="$(prefix)"' \
1330 -D
'RTLD="$(rtlddir)/$(rtld-installed-name)"'
1332 cpp-srcs-left
:= $(all-rtld-routines
:=.os
)
1334 include $(patsubst %,$(..
)libof-iterator.mk
,$(cpp-srcs-left
))
1336 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
1337 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
1339 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
1340 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
1341 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
1342 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
1343 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
1344 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
1345 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
1346 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
1347 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
1348 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
1349 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1350 $(objpfx
)neededobj3.so
1351 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
1352 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
1353 $(objpfx
)firstobj.so
: $(shared-thread-library
)
1354 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
1355 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
1356 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
1357 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
1358 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
1359 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
1360 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
1361 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
1362 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
1363 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
1364 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
1365 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
1366 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
1367 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
1368 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
1369 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
1370 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
1371 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
1372 $(objpfx
)tst-tls19mod1.so
: $(objpfx
)tst-tls19mod2.so
$(objpfx
)tst-tls19mod3.so
1373 $(objpfx
)tst-tls19mod3.so
: $(objpfx
)ld.so
1374 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
1375 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
1376 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
1377 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
1378 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
1379 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
1380 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
1381 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
1382 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
1383 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
1384 $(objpfx
)unload8mod1.so
: $(objpfx
)unload8mod2.so
1385 $(objpfx
)unload8mod2.so
: $(objpfx
)unload8mod3.so
1386 $(objpfx
)tst-initordera2.so
: $(objpfx
)tst-initordera1.so
1387 $(objpfx
)tst-initorderb2.so
: $(objpfx
)tst-initorderb1.so
$(objpfx
)tst-initordera2.so
1388 $(objpfx
)tst-initordera3.so
: $(objpfx
)tst-initorderb2.so
$(objpfx
)tst-initorderb1.so
1389 $(objpfx
)tst-initordera4.so
: $(objpfx
)tst-initordera3.so
1390 $(objpfx
)tst-initorder
: $(objpfx
)tst-initordera4.so
$(objpfx
)tst-initordera1.so
$(objpfx
)tst-initorderb2.so
1391 $(objpfx
)tst-null-argv
: $(objpfx
)tst-null-argv-lib.so
1392 $(objpfx
)tst-tlsalign
: $(objpfx
)tst-tlsalign-lib.so
1393 $(objpfx
)tst-nodelete-opened.out
: $(objpfx
)tst-nodelete-opened-lib.so
1395 $(objpfx
)tst-tlsalign-extern
: $(objpfx
)tst-tlsalign-vars.o
1396 $(objpfx
)tst-tlsalign-extern-static
: $(objpfx
)tst-tlsalign-vars.o
1398 tst-null-argv-ENV
= LD_DEBUG
=all LD_DEBUG_OUTPUT
=$(objpfx
)tst-null-argv.debug.out
1399 LDFLAGS-nodel2mod3.so
= -Wl
,--no-as-needed
1400 LDFLAGS-reldepmod5.so
= -Wl
,--no-as-needed
1401 LDFLAGS-reldep6mod1.so
= -Wl
,--no-as-needed
1402 LDFLAGS-reldep6mod4.so
= -Wl
,--no-as-needed
1403 LDFLAGS-reldep8mod3.so
= -Wl
,--no-as-needed
1404 LDFLAGS-unload4mod1.so
= -Wl
,--no-as-needed
1405 LDFLAGS-unload4mod2.so
= -Wl
,--no-as-needed
1406 LDFLAGS-tst-initorder
= -Wl
,--no-as-needed
1407 LDFLAGS-tst-initordera2.so
= -Wl
,--no-as-needed
1408 LDFLAGS-tst-initordera3.so
= -Wl
,--no-as-needed
1409 LDFLAGS-tst-initordera4.so
= -Wl
,--no-as-needed
1410 LDFLAGS-tst-initorderb2.so
= -Wl
,--no-as-needed
1411 LDFLAGS-tst-tlsmod5.so
= -nostdlib
-Wl
,--no-as-needed
1412 LDFLAGS-tst-tlsmod6.so
= -nostdlib
-Wl
,--no-as-needed
1414 testobj1.so-no-z-defs
= yes
1415 testobj3.so-no-z-defs
= yes
1416 testobj4.so-no-z-defs
= yes
1417 testobj5.so-no-z-defs
= yes
1418 testobj6.so-no-z-defs
= yes
1419 failobj.so-no-z-defs
= yes
1420 constload2.so-no-z-defs
= yes
1421 constload3.so-no-z-defs
= yes
1422 nodelmod1.so-no-z-defs
= yes
1423 nodelmod2.so-no-z-defs
= yes
1424 nodelmod4.so-no-z-defs
= yes
1425 nodel2mod2.so-no-z-defs
= yes
1426 reldepmod2.so-no-z-defs
= yes
1427 reldepmod3.so-no-z-defs
= yes
1428 reldepmod4.so-no-z-defs
= yes
1429 reldep4mod4.so-no-z-defs
= yes
1430 reldep4mod2.so-no-z-defs
= yes
1431 ltglobmod2.so-no-z-defs
= yes
1432 dblloadmod3.so-no-z-defs
= yes
1433 tst-tlsmod1.so-no-z-defs
= yes
1434 tst-tlsmod2.so-no-z-defs
= yes
1435 tst-tlsmod3.so-no-z-defs
= yes
1436 tst-tlsmod4.so-no-z-defs
= yes
1437 tst-tlsmod7.so-no-z-defs
= yes
1438 tst-tlsmod8.so-no-z-defs
= yes
1439 tst-tlsmod9.so-no-z-defs
= yes
1440 tst-tlsmod10.so-no-z-defs
= yes
1441 tst-tlsmod12.so-no-z-defs
= yes
1442 tst-tlsmod14a.so-no-z-defs
= yes
1443 tst-tlsmod14b.so-no-z-defs
= yes
1444 tst-tlsmod15a.so-no-z-defs
= yes
1445 tst-tlsmod16b.so-no-z-defs
= yes
1446 circlemod2.so-no-z-defs
= yes
1447 circlemod3.so-no-z-defs
= yes
1448 circlemod3a.so-no-z-defs
= yes
1449 reldep8mod2.so-no-z-defs
= yes
1450 reldep9mod1.so-no-z-defs
= yes
1451 unload3mod4.so-no-z-defs
= yes
1452 unload4mod1.so-no-z-defs
= yes
1453 ifuncmod1.so-no-z-defs
= yes
1454 ifuncmod5.so-no-z-defs
= yes
1455 ifuncmod6.so-no-z-defs
= yes
1456 tst-auditmod9a.so-no-z-defs
= yes
1457 tst-auditmod9b.so-no-z-defs
= yes
1458 tst-nodelete-uniquemod.so-no-z-defs
= yes
1459 tst-nodelete-rtldmod.so-no-z-defs
= yes
1460 tst-nodelete-zmod.so-no-z-defs
= yes
1461 tst-nodelete2mod.so-no-z-defs
= yes
1463 ifeq ($(build-shared
),yes
)
1464 # Build all the modules even when not actually running test programs.
1465 tests
: $(test-modules
)
1468 LDFLAGS-loadtest
= -rdynamic
1470 $(objpfx
)loadtest.out
: $(test-modules
)
1472 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1473 $(objpfx
)neededobj3.so
1475 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1476 $(objpfx
)neededobj3.so
1478 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
1479 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
1481 $(objpfx
)neededtest4
: $(objpfx
)neededobj1.so
1482 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
1484 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
1485 LDFLAGS-restest1
= -rdynamic
1487 LDFLAGS-restest2
= -rdynamic
1489 $(objpfx
)restest1.out
: $(test-modules
)
1491 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
1492 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
1493 LDFLAGS-preloadtest
= -rdynamic
1494 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1496 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1498 LDFLAGS-loadfail
= -rdynamic
1500 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
$(objpfx
)testobj1.so \
1501 $(objpfx
)testobj2.so
$(objpfx
)testobj3.so \
1502 $(objpfx
)testobj4.so
$(objpfx
)testobj5.so
1504 LDFLAGS-multiload
= -rdynamic
1505 CFLAGS-multiload.c
+= -DOBJDIR
=\"$(elf-objpfx
)\"
1507 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
1509 LDFLAGS-origtest
= -rdynamic
1510 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
1512 ifeq ($(have-thread-library
),yes
)
1513 $(objpfx
)resolvfail
: $(shared-thread-library
)
1516 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
1518 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
1519 $(objpfx
)circlemod1a.so
1521 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
1522 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
1523 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
1524 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
1526 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
1528 $(objpfx
)order-cmp.out
: $(objpfx
)order.out
1529 (echo
"0123456789" | cmp
$< -) > $@
; \
1532 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
1533 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
1534 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
1536 $(objpfx
)noload
: $(objpfx
)testobj1.so
1537 LDFLAGS-noload
= -rdynamic
-Wl
,--no-as-needed
1538 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
1540 $(objpfx
)noload-mem.out
: $(objpfx
)noload.out
1541 $(common-objpfx
)malloc
/mtrace
$(objpfx
)noload.mtrace
> $@
; \
1543 noload-ENV
= MALLOC_TRACE
=$(objpfx
)noload.mtrace \
1544 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
1546 LDFLAGS-nodelete
= -rdynamic
1547 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1548 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1549 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
1550 $(objpfx
)nodelmod3.so
1552 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
1553 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
1555 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
1556 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
1558 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
1559 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
1560 -L
$(subst :, -L
,$(rpath-link
)) \
1561 -Wl
,-rpath-link
=$(rpath-link
) \
1562 $< -Wl
,-F
,$(objpfx
)filtmod2.so
1563 $(objpfx
)filter: $(objpfx
)filtmod1.so
1565 # This does not link against libc.
1566 CFLAGS-filtmod1.c
+= $(no-stack-protector
)
1568 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
1570 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
1572 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
1574 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1576 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
1578 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
1579 LDFLAGS-next
= -Wl
,--no-as-needed
1581 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
1583 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
1585 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
1586 $(objpfx
)pathoptobj.so
1587 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
1588 '$(run-program-env)'; \
1591 $(objpfx
)tst-rtld-load-self.out
: tst-rtld-load-self.sh
$(objpfx
)ld.so
1592 $(SHELL
) $^
'$(test-wrapper)' '$(test-wrapper-env)' > $@
; \
1595 tst-rtld-preload-OBJS
= $(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
1596 $(objpfx
)tst-rtld-preload.out
: tst-rtld-preload.sh
$(objpfx
)ld.so \
1597 $(objpfx
)preloadtest \
1598 $(preloadtest-preloads
:%=$(objpfx
)%.so
)
1599 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)preloadtest \
1600 '$(test-wrapper-env)' '$(run_program_env)' \
1601 '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@
; \
1604 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
1606 $(objpfx
)global
: $(objpfx
)globalmod1.so
1607 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1609 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1611 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
1613 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
1615 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
1617 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
1619 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
1621 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1622 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
1624 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
1626 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
1628 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
1630 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
1632 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
1634 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
1636 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
1638 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1640 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
$(objpfx
)tst-tlsmod7.so
1642 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
$(objpfx
)tst-tlsmod9.so
1644 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
$(objpfx
)tst-tlsmod11.so
1646 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
1648 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
1649 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
1651 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
1653 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
1657 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
1659 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
1660 $(patsubst %,$(objpfx
)%.os
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
1661 $(compile-command.c
) -DN
=$*
1662 $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
1663 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
))
1665 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
))
1666 $(patsubst %,$(objpfx
)%.os
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
1667 $(compile-command.c
) -DN
=$*
1668 $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
1670 $(objpfx
)tst-tls19.out
: $(objpfx
)tst-tls19mod1.so
1672 CFLAGS-tst-align.c
+= $(stack-align-test-flags
)
1673 CFLAGS-tst-align2.c
+= $(stack-align-test-flags
)
1674 CFLAGS-tst-alignmod.c
+= $(stack-align-test-flags
)
1675 CFLAGS-tst-alignmod2.c
+= $(stack-align-test-flags
)
1676 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
1677 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
1678 $(objpfx
)tst-align3
: $(objpfx
)tst-alignmod3.so
1679 ifeq (yes
,$(have-fpie
))
1680 CFLAGS-tst-align3.c
+= $(PIE-ccflag
)
1682 LDFLAGS-tst-align3
+= -Wl
,-z
,max-page-size
=0x200000
1683 LDFLAGS-tst-alignmod3.so
+= -Wl
,-z
,max-page-size
=0x200000
1684 $(objpfx
)tst-alignmod3.so
: $(libsupport
)
1686 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1687 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1689 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
1691 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1692 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1694 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
1695 $(objpfx
)unload6mod3.so
1697 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
1698 unload7-ENV
= MALLOC_PERTURB_
=85
1700 $(objpfx
)unload8.out
: $(objpfx
)unload8mod1.so
$(objpfx
)unload8mod1x.so
1702 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1704 ifeq ($(have-z-execstack
),yes
)
1705 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
1706 CPPFLAGS-tst-execstack.c
+= -DUSE_PTHREADS
=0
1707 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
1708 LDFLAGS-tst-execstack-mod.so
= -Wl
,-z
,execstack
1710 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
1711 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
1713 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
1714 CFLAGS-tst-execstack-prog.c
+= -Wno-trampolines
1715 CFLAGS-tst-execstack-mod.c
+= -Wno-trampolines
1718 LDFLAGS-tst-array2
= -Wl
,--no-as-needed
1719 LDFLAGS-tst-array5
= -Wl
,--no-as-needed
1721 $(objpfx
)tst-array1-cmp.out
: tst-array1.exp
$(objpfx
)tst-array1.out
1725 $(objpfx
)tst-array1-static-cmp.out
: tst-array1.exp \
1726 $(objpfx
)tst-array1-static.out
1730 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
1731 $(objpfx
)tst-array2-cmp.out
: tst-array2.exp
$(objpfx
)tst-array2.out
1735 $(objpfx
)tst-array3-cmp.out
: tst-array1.exp
$(objpfx
)tst-array3.out
1739 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array2dep.so
1740 $(objpfx
)tst-array4-cmp.out
: tst-array4.exp
$(objpfx
)tst-array4.out
1744 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
1745 $(objpfx
)tst-array5-cmp.out
: tst-array5.exp
$(objpfx
)tst-array5.out
1749 $(objpfx
)tst-array5-static-cmp.out
: tst-array5-static.exp \
1750 $(objpfx
)tst-array5-static.out
1754 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
1755 CFLAGS-tst-pie2.c
+= $(pie-ccflag
)
1757 $(objpfx
)tst-piemod1.so
: $(libsupport
)
1758 $(objpfx
)tst-pie1
: $(objpfx
)tst-piemod1.so
1759 $(objpfx
)tst-dlopen-pie.out
: $(objpfx
)tst-pie1
1761 ifeq (yes
,$(build-shared
))
1762 # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with
1763 # all-built-dso here.
1764 all-built-dso
:= $(common-objpfx
)elf
/ld.so
$(common-objpfx
)libc.so \
1765 $(filter-out $(common-objpfx
)linkobj
/libc.so
, \
1766 $(sort $(wildcard $(addprefix $(common-objpfx
), \
1770 $(all-built-dso
:=.dyn
): %.dyn
: %
1772 LC_ALL
=C
$(READELF
) -W
-d
$< > $@T
1775 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dyn
)
1777 $(objpfx
)check-textrel.out
: $(..
)scripts
/check-textrel.awk \
1778 $(all-built-dso
:=.dyn
)
1779 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1781 generated
+= check-textrel.out
1783 $(objpfx
)execstack-default
: $(first-word
$(wildcard $(sysdirs
:%=%/stackinfo.h
)))
1784 $(make-target-directory
)
1785 { echo
'#include <elf.h>'; \
1786 echo
'#include <stackinfo.h>'; \
1787 echo
'#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1788 echo
'@@@execstack-no@@@'; \
1790 echo
'@@@execstack-yes@@@'; \
1791 echo
'#endif'; } | \
1792 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -E
-x c-header
- | \
1793 sed
-n
-e
's/^@@@\(.*\)@@@/\1/p' > $@T
1795 generated
+= execstack-default
1797 $(all-built-dso
:=.phdr
): %.phdr
: %
1799 LC_ALL
=C
$(READELF
) -W
-l
$< > $@T
1802 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.phdr
)
1804 $(objpfx
)check-execstack.out
: $(..
)scripts
/check-execstack.awk \
1805 $(objpfx
)execstack-default \
1806 $(all-built-dso
:=.phdr
)
1807 LC_ALL
=C
$(AWK
) -v
"xfail=$(check-execstack-xfail)" -f
$^
> $@
; \
1809 generated
+= check-execstack.out
1811 $(objpfx
)check-wx-segment.out
: $(..
)scripts
/check-wx-segment.py \
1812 $(all-built-dso
:=.phdr
)
1813 $(PYTHON
) $^
--xfail
="$(check-wx-segment-xfail)" > $@
; \
1815 generated
+= check-wx-segment.out
1817 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
1819 $(all-built-dso
:=.jmprel
): %.jmprel
: % Makefile
1821 LC_ALL
=C
$(READELF
) -W
-S
-d
-r
$< > $@T
1824 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.jmprel
)
1826 localplt-built-dso
:= $(addprefix $(common-objpfx
),\
1831 resolv
/libresolv.so \
1833 ifeq ($(build-mathvec
),yes
)
1834 localplt-built-dso
+= $(addprefix $(common-objpfx
), mathvec
/libmvec.so
)
1836 ifeq ($(have-thread-library
),yes
)
1837 localplt-built-dso
+= $(filter-out %_nonshared.a
, $(shared-thread-library
))
1839 ifeq ($(build-crypt
),yes
)
1840 localplt-built-dso
+= $(addprefix $(common-objpfx
), crypt
/libcrypt.so
)
1842 ifneq ($(pthread-in-libc
),yes
)
1843 localplt-built-dso
+= $(addprefix $(common-objpfx
), rt
/librt.so
)
1846 vpath localplt.data
$(+sysdep_dirs
)
1848 $(objpfx
)check-localplt.out
: $(..
)scripts
/check-localplt.awk \
1849 $(..
)scripts
/localplt.awk \
1850 $(localplt-built-dso
:=.jmprel
) \
1852 LC_ALL
=C
$(AWK
) -f
$(filter-out $< %localplt.data
,$^
) | \
1853 LC_ALL
=C
$(AWK
) -f
$< $(filter %localplt.data
,$^
) - \
1858 $(all-built-dso
:=.dynsym
): %.dynsym
: %
1860 LC_ALL
=C
$(READELF
) -W
--dyn-syms
$< > $@T
1863 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dynsym
)
1865 $(objpfx
)check-initfini.out
: $(..
)scripts
/check-initfini.awk \
1866 $(all-built-dso
:=.dynsym
)
1867 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1869 generated
+= check-initfini.out
1871 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
1872 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
1873 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
1874 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
1876 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
1877 $(objpfx
)tst-deep1
: $(objpfx
)tst-deep1mod1.so
1878 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
1879 LDFLAGS-tst-deep1
+= -rdynamic
1880 tst-deep1mod3.so-no-z-defs
= yes
1882 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
1884 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
1886 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
1888 $(objpfx
)tst-dlmopen4.out
: $(objpfx
)tst-dlmopen1mod.so
1890 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
1891 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1893 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
$(objpfx
)tst-auditmod9b.so
1894 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1895 CFLAGS-tst-audit2.c
+= -fno-builtin
1896 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1898 $(objpfx
)tst-audit9.out
: $(objpfx
)tst-auditmod9a.so
$(objpfx
)tst-auditmod9b.so
1899 tst-audit9-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod9a.so
1901 $(objpfx
)tst-audit8
: $(libm
)
1902 $(objpfx
)tst-audit8.out
: $(objpfx
)tst-auditmod1.so
1903 tst-audit8-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1905 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
1907 $(objpfx
)tst-global2
: $(objpfx
)tst-globalmod2.so
1908 $(objpfx
)tst-global2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
1909 LDFLAGS-tst-global2
= -Wl
,--enable-new-dtags
1910 LDFLAGS-tst-globalmod2.so
= -Wl
,--enable-new-dtags
1912 $(objpfx
)order2.out
: $(objpfx
)order2mod1.so
$(objpfx
)order2mod2.so
1913 $(objpfx
)order2-cmp.out
: $(objpfx
)order2.out
1914 (echo
"12345" | cmp
$< -) > $@
; \
1916 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
1917 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
1918 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
1919 order2mod2.so-no-z-defs
= yes
1920 LDFLAGS-order2mod1.so
= -Wl
,--no-as-needed
1921 LDFLAGS-order2mod2.so
= -Wl
,--no-as-needed
1923 tst-stackguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
1924 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
1926 tst-ptrguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
1927 # When built statically, the pointer guard interface uses
1928 # __pointer_chk_guard_local.
1929 CFLAGS-tst-ptrguard1-static.c
+= -DPTRGUARD_LOCAL
1930 tst-ptrguard1-static-ARGS
= --command
"$(objpfx)tst-ptrguard1-static --child"
1932 $(objpfx
)tst-leaks1-mem.out
: $(objpfx
)tst-leaks1.out
1933 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
; \
1936 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace \
1937 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
1939 $(objpfx
)tst-thrlock
: $(shared-thread-library
)
1940 $(objpfx
)tst-thrlock.out
: $(libm
)
1941 $(objpfx
)tst-noload.out
: $(libm
)
1943 tst-tst-dlopen-tlsmodid-no-pie
= yes
1944 $(objpfx
)tst-dlopen-tlsmodid
: $(shared-thread-library
)
1945 $(objpfx
)tst-dlopen-tlsmodid.out
: $(objpfx
)tst-dlopen-self
1946 CFLAGS-tst-dlopen-tlsmodid-pie.c
+= $(pie-ccflag
)
1947 $(objpfx
)tst-dlopen-tlsmodid-pie
: $(shared-thread-library
)
1948 $(objpfx
)tst-dlopen-tlsmodid-pie.out
: $(objpfx
)tst-dlopen-self-pie
1949 $(objpfx
)tst-dlopen-tlsmodid-container
: $(shared-thread-library
)
1950 LDFLAGS-tst-dlopen-tlsmodid-container
+= -Wl
,-rpath
,\
$$ORIGIN
1952 tst-tst-dlopen-self-no-pie
= yes
1953 CFLAGS-tst-dlopen-self-pie.c
+= $(pie-ccflag
)
1954 LDFLAGS-tst-dlopen-self-container
+= -Wl
,-rpath
,\
$$ORIGIN
1956 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
1957 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
1958 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
1959 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
1960 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
1961 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
1962 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
1963 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
1964 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
1965 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
1966 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
1967 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
1968 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
1969 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
1970 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
1971 CFLAGS-ifuncmain9pic.c
+= $(pic-ccflag
)
1972 CFLAGS-ifuncmain9picstatic.c
+= $(pic-ccflag
)
1974 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
1976 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
1977 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
1978 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
1979 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
1980 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
1981 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
1982 CFLAGS-ifuncmain9pie.c
+= $(pie-ccflag
)
1983 CFLAGS-tst-ifunc-textrel.c
+= $(pic-ccflag
)
1985 LDFLAGS-ifuncmain6pie
= -Wl
,-z
,lazy
1987 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmod1.so
1988 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncdep1pic.o
1989 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmod1.so
1990 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmod5.so
1991 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmod6.so
1993 $(objpfx
)ifuncmain1
: $(addprefix $(objpfx
),ifuncmod1.so
)
1994 $(objpfx
)ifuncmain1pic
: $(addprefix $(objpfx
),ifuncmod1.so
)
1995 $(objpfx
)ifuncmain1staticpic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1996 $(objpfx
)ifuncmain1static
: $(addprefix $(objpfx
),ifuncdep1.o
)
1997 $(objpfx
)ifuncmain1picstatic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1998 $(objpfx
)ifuncmain1vis
: $(addprefix $(objpfx
),ifuncmod1.so
)
1999 $(objpfx
)ifuncmain1vispic
: $(addprefix $(objpfx
),ifuncmod1.so
)
2000 $(objpfx
)ifuncmain2
: $(addprefix $(objpfx
),ifuncdep2.o
)
2001 $(objpfx
)ifuncmain2pic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2002 $(objpfx
)ifuncmain2static
: $(addprefix $(objpfx
),ifuncdep2.o
)
2003 $(objpfx
)ifuncmain2picstatic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
2005 $(objpfx
)ifuncmain3.out
: $(objpfx
)ifuncmod3.so
2007 $(objpfx
)ifuncmain5
: $(addprefix $(objpfx
),ifuncmod5.so
)
2008 $(objpfx
)ifuncmain5pic
: $(addprefix $(objpfx
),ifuncmod5.so
)
2009 $(objpfx
)ifuncmain5static
: $(addprefix $(objpfx
),ifuncdep5.o
)
2010 $(objpfx
)ifuncmain5staticpic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2011 $(objpfx
)ifuncmain5picstatic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
2013 LDFLAGS-tst-ifunc-fault-lazy
= -Wl
,-z
,lazy
2014 LDFLAGS-tst-ifunc-fault-bindnow
= -Wl
,-z
,now
2015 define tst-ifunc-fault-script
2016 ( $(test-wrapper
) $(rtld-prefix
) --verify
$^ \
2017 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 $(rtld-prefix
) $^ \
2018 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 LD_DEBUG
=unused \
2020 ) > $@
; $(evaluate-test
)
2022 $(objpfx
)tst-ifunc-fault-lazy.out
: $(objpfx
)tst-ifunc-fault-lazy
$(objpfx
)ld.so
2023 $(tst-ifunc-fault-script
)
2024 $(objpfx
)tst-ifunc-fault-bindnow.out
: $(objpfx
)tst-ifunc-fault-bindnow \
2026 $(tst-ifunc-fault-script
)
2028 $(objpfx
)tst-unique1.out
: $(objpfx
)tst-unique1mod1.so \
2029 $(objpfx
)tst-unique1mod2.so
2031 $(objpfx
)tst-unique2
: $(objpfx
)tst-unique2mod1.so
2032 $(objpfx
)tst-unique2.out
: $(objpfx
)tst-unique2mod2.so
2034 $(objpfx
)tst-unique3
: $(objpfx
)tst-unique3lib.so
2035 $(objpfx
)tst-unique3.out
: $(objpfx
)tst-unique3lib2.so
2037 $(objpfx
)tst-unique4
: $(objpfx
)tst-unique4lib.so
2039 $(objpfx
)tst-nodelete.out
: $(objpfx
)tst-nodelete-uniquemod.so \
2040 $(objpfx
)tst-nodelete-rtldmod.so \
2041 $(objpfx
)tst-nodelete-zmod.so
2043 LDFLAGS-tst-nodelete
= -rdynamic
2044 LDFLAGS-tst-nodelete-zmod.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
2046 $(objpfx
)tst-nodelete2.out
: $(objpfx
)tst-nodelete2mod.so
2048 LDFLAGS-tst-nodelete2
= -rdynamic
2050 $(objpfx
)tst-initorder-cmp.out
: tst-initorder.exp
$(objpfx
)tst-initorder.out
2054 $(objpfx
)tst-initorder2
: $(objpfx
)tst-initorder2a.so
$(objpfx
)tst-initorder2d.so
$(objpfx
)tst-initorder2c.so
2055 $(objpfx
)tst-initorder2a.so
: $(objpfx
)tst-initorder2b.so
2056 $(objpfx
)tst-initorder2b.so
: $(objpfx
)tst-initorder2c.so
2057 $(objpfx
)tst-initorder2c.so
: $(objpfx
)tst-initorder2d.so
2058 LDFLAGS-tst-initorder2
= -Wl
,--no-as-needed
2059 LDFLAGS-tst-initorder2a.so
= -Wl
,--no-as-needed
2060 LDFLAGS-tst-initorder2b.so
= -Wl
,--no-as-needed
2061 LDFLAGS-tst-initorder2c.so
= -Wl
,--no-as-needed
2062 define o-iterator-doit
2063 $(objpfx
)tst-initorder2
$o.os
: tst-initorder2.c
; \
2064 $$(compile-command.c
) -DNAME
=\"$o\"
2066 object-suffixes-left
:= a b c d
2067 include $(o-iterator
)
2069 $(objpfx
)tst-initorder2-cmp.out
: tst-initorder2.exp
$(objpfx
)tst-initorder2.out
2073 $(objpfx
)tst-relsort1mod1.so
: $(libm
) $(objpfx
)tst-relsort1mod2.so
2074 $(objpfx
)tst-relsort1mod2.so
: $(libm
)
2075 $(objpfx
)tst-relsort1.out
: $(objpfx
)tst-relsort1mod1.so \
2076 $(objpfx
)tst-relsort1mod2.so
2078 $(objpfx
)tst-unused-dep.out
: $(objpfx
)testobj1.so
2079 $(test-wrapper-env
) \
2080 LD_TRACE_LOADED_OBJECTS
=1 \
2087 $(objpfx
)tst-unused-dep-cmp.out
: $(objpfx
)tst-unused-dep.out
2088 cmp
$< /dev
/null
> $@
; \
2091 $(objpfx
)tst-audit11.out
: $(objpfx
)tst-auditmod11.so
$(objpfx
)tst-audit11mod1.so
2092 tst-audit11-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod11.so
2093 $(objpfx
)tst-audit11mod1.so
: $(objpfx
)tst-audit11mod2.so
2094 LDFLAGS-tst-audit11mod2.so
= -Wl
,--version-script
=tst-audit11mod2.map
,-soname
,tst-audit11mod2.so
2096 $(objpfx
)tst-audit12.out
: $(objpfx
)tst-auditmod12.so
$(objpfx
)tst-audit12mod1.so
$(objpfx
)tst-audit12mod3.so
2097 tst-audit12-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod12.so
2098 $(objpfx
)tst-audit12mod1.so
: $(objpfx
)tst-audit12mod2.so
2099 LDFLAGS-tst-audit12mod2.so
= -Wl
,--version-script
=tst-audit12mod2.map
2101 $(objpfx
)tst-audit13.out
: $(objpfx
)tst-audit13mod1.so
2102 LDFLAGS-tst-audit13mod1.so
= -Wl
,-z
,lazy
2103 tst-audit13-ENV
= LD_AUDIT
=$(objpfx
)tst-audit13mod1.so
2105 $(objpfx
)tst-auditmany.out
: $(objpfx
)tst-auditmanymod1.so \
2106 $(objpfx
)tst-auditmanymod2.so
$(objpfx
)tst-auditmanymod3.so \
2107 $(objpfx
)tst-auditmanymod4.so
$(objpfx
)tst-auditmanymod5.so \
2108 $(objpfx
)tst-auditmanymod6.so
$(objpfx
)tst-auditmanymod7.so \
2109 $(objpfx
)tst-auditmanymod8.so
$(objpfx
)tst-auditmanymod9.so
2110 tst-auditmany-ENV
= \
2111 LD_AUDIT
=tst-auditmanymod1.so
:tst-auditmanymod2.so
:tst-auditmanymod3.so
:tst-auditmanymod4.so
:tst-auditmanymod5.so
:tst-auditmanymod6.so
:tst-auditmanymod7.so
:tst-auditmanymod8.so
:tst-auditmanymod9.so
2113 LDFLAGS-tst-audit14
= -Wl
,--audit
=tst-auditlogmod-1.so
,--disable-new-dtags
2114 $(objpfx
)tst-auditlogmod-1.so
: $(libsupport
)
2115 $(objpfx
)tst-audit14.out
: $(objpfx
)tst-auditlogmod-1.so
2116 LDFLAGS-tst-audit14a
= -Wl
,--audit
=tst-auditlogmod-1.so
,--enable-new-dtags
2117 $(objpfx
)tst-audit14a.out
: $(objpfx
)tst-auditlogmod-1.so
2118 LDFLAGS-tst-audit15
= \
2119 -Wl
,--audit
=tst-auditlogmod-1.so
,--depaudit
=tst-auditlogmod-2.so
2120 $(objpfx
)tst-auditlogmod-2.so
: $(libsupport
)
2121 $(objpfx
)tst-audit15.out
: \
2122 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so
2123 LDFLAGS-tst-audit16
= \
2124 -Wl
,--audit
=tst-auditlogmod-1.so
:tst-auditlogmod-2.so \
2125 -Wl
,--depaudit
=tst-auditlogmod-3.so
2126 $(objpfx
)tst-auditlogmod-3.so
: $(libsupport
)
2127 $(objpfx
)tst-audit16.out
: \
2128 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so \
2129 $(objpfx
)tst-auditlogmod-3.so
2130 $(objpfx
)tst-audit17.out
: $(objpfx
)tst-auditmod17.so
2131 # The test check if a audit library without libc.so on DT_NEEDED works as
2132 # intended, so it uses an explicit link rule.
2133 $(objpfx
)tst-auditmod17.so
: $(objpfx
)tst-auditmod17.os
2134 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
2135 $(filter-out $(map-file
),$^
)
2136 $(call after-link
,$@.new
)
2138 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-auditmod17
)
2139 tst-audit17-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod17.so
2141 $(objpfx
)tst-audit14-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14.out
2144 $(objpfx
)tst-audit14a-cmp.out
: tst-audit14.exp
$(objpfx
)tst-audit14a.out
2147 $(objpfx
)tst-audit15-cmp.out
: tst-audit15.exp
$(objpfx
)tst-audit15.out
2150 $(objpfx
)tst-audit16-cmp.out
: tst-audit16.exp
$(objpfx
)tst-audit16.out
2154 $(objpfx
)tst-audit18.out
: $(objpfx
)tst-auditmod18.so \
2155 $(objpfx
)tst-audit18mod.so
2156 tst-audit18-ARGS
= -- $(host-test-program-cmd
)
2158 $(objpfx
)tst-audit19a.out
: $(objpfx
)tst-auditmod19a.so
2159 tst-audit19a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod19a.so
2161 $(objpfx
)tst-audit19b.out
: $(objpfx
)tst-auditmod19b.so
2162 $(objpfx
)tst-audit19b
: $(objpfx
)tst-audit19bmod.so
2163 tst-audit19b-ARGS
= -- $(host-test-program-cmd
)
2165 $(objpfx
)tst-audit20.out
: $(objpfx
)tst-auditmod20.so
2166 tst-audit20-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod20.so
2168 $(objpfx
)tst-audit21
: $(shared-thread-library
)
2169 $(objpfx
)tst-audit21.out
: $(objpfx
)tst-auditmod21a.so
2170 $(objpfx
)tst-auditmod21a.so
: $(objpfx
)tst-auditmod21b.so
2171 tst-audit21-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod21a.so
2173 $(objpfx
)tst-audit22.out
: $(objpfx
)tst-auditmod22.so
2174 tst-audit22-ARGS
= -- $(host-test-program-cmd
)
2176 $(objpfx
)tst-audit23.out
: $(objpfx
)tst-auditmod23.so \
2177 $(objpfx
)tst-audit23mod.so
2178 tst-audit23-ARGS
= -- $(host-test-program-cmd
)
2180 $(objpfx
)tst-audit24a.out
: $(objpfx
)tst-auditmod24a.so
2181 $(objpfx
)tst-audit24a
: $(objpfx
)tst-audit24amod1.so \
2182 $(objpfx
)tst-audit24amod2.so
2183 tst-audit24a-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24a.so
2184 LDFLAGS-tst-audit24a
= -Wl
,-z
,now
2186 $(objpfx
)tst-audit24b.out
: $(objpfx
)tst-auditmod24b.so
2187 $(objpfx
)tst-audit24b
: $(objpfx
)tst-audit24bmod1.so \
2188 $(objpfx
)tst-audit24bmod2.so
2189 $(objpfx
)tst-audit24bmod1
: $(objpfx
)tst-audit24bmod2.so
2190 # The test checks if a library without .gnu.version correctly calls the
2191 # audit callbacks. So it uses an explicit link rule to avoid linking
2193 $(objpfx
)tst-audit24bmod1.so
: $(objpfx
)tst-audit24bmod1.os
2194 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod1.os \
2196 $(call after-link
,$@.new
)
2198 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod1
)
2199 $(objpfx
)tst-audit24bmod2.so
: $(objpfx
)tst-audit24bmod2.os
2200 $(CC
) -nostdlib
-nostartfiles
-shared
-o
$@.new
$(objpfx
)tst-audit24bmod2.os
2201 $(call after-link
,$@.new
)
2203 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,tst-audit24bmod2
)
2204 tst-audit24b-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24b.so
2205 LDFLAGS-tst-audit24b
= -Wl
,-z
,now
2207 # Same as tst-audit24a, but tests LD_BIND_NOW
2208 $(objpfx
)tst-audit24c.out
: $(objpfx
)tst-auditmod24c.so
2209 $(objpfx
)tst-audit24c
: $(objpfx
)tst-audit24amod1.so \
2210 $(objpfx
)tst-audit24amod2.so
2211 tst-audit24c-ENV
= LD_BIND_NOW
=1 LD_AUDIT
=$(objpfx
)tst-auditmod24c.so
2212 LDFLAGS-tst-audit24c
= -Wl
,-z
,lazy
2214 $(objpfx
)tst-audit24d.out
: $(objpfx
)tst-auditmod24d.so
2215 $(objpfx
)tst-audit24d
: $(objpfx
)tst-audit24dmod1.so \
2216 $(objpfx
)tst-audit24dmod2.so
2217 $(objpfx
)tst-audit24dmod1.so
: $(objpfx
)tst-audit24dmod3.so
2218 LDFLAGS-tst-audit24dmod1.so
= -Wl
,-z
,now
2219 $(objpfx
)tst-audit24dmod2.so
: $(objpfx
)tst-audit24dmod4.so
2220 LDFLAGS-tst-audit24dmod2.so
= -Wl
,-z
,lazy
2221 tst-audit24d-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod24d.so
2222 LDFLAGS-tst-audit24d
= -Wl
,-z
,lazy
2224 $(objpfx
)tst-audit25a.out
: $(objpfx
)tst-auditmod25.so
2225 $(objpfx
)tst-audit25a
: $(objpfx
)tst-audit25mod1.so \
2226 $(objpfx
)tst-audit25mod2.so \
2227 $(objpfx
)tst-audit25mod3.so \
2228 $(objpfx
)tst-audit25mod4.so
2229 LDFLAGS-tst-audit25a
= -Wl
,-z
,lazy
2230 $(objpfx
)tst-audit25mod1.so
: $(objpfx
)tst-audit25mod3.so
2231 LDFLAGS-tst-audit25mod1.so
= -Wl
,-z
,now
2232 $(objpfx
)tst-audit25mod2.so
: $(objpfx
)tst-audit25mod4.so
2233 LDFLAGS-tst-audit25mod2.so
= -Wl
,-z
,lazy
2234 tst-audit25a-ARGS
= -- $(host-test-program-cmd
)
2236 $(objpfx
)tst-audit25b.out
: $(objpfx
)tst-auditmod25.so
2237 $(objpfx
)tst-audit25b
: $(objpfx
)tst-audit25mod1.so \
2238 $(objpfx
)tst-audit25mod2.so \
2239 $(objpfx
)tst-audit25mod3.so \
2240 $(objpfx
)tst-audit25mod4.so
2241 LDFLAGS-tst-audit25b
= -Wl
,-z
,now
2242 tst-audit25b-ARGS
= -- $(host-test-program-cmd
)
2244 # tst-sonamemove links against an older implementation of the library.
2245 LDFLAGS-tst-sonamemove-linkmod1.so
= \
2246 -Wl
,--version-script
=tst-sonamemove-linkmod1.map \
2247 -Wl
,-soname
,tst-sonamemove-runmod1.so
2248 LDFLAGS-tst-sonamemove-runmod1.so
= -Wl
,--no-as-needed \
2249 -Wl
,--version-script
=tst-sonamemove-runmod1.map \
2250 -Wl
,-soname
,tst-sonamemove-runmod1.so
2251 LDFLAGS-tst-sonamemove-runmod2.so
= \
2252 -Wl
,--version-script
=tst-sonamemove-runmod2.map \
2253 -Wl
,-soname
,tst-sonamemove-runmod2.so
2254 $(objpfx
)tst-sonamemove-runmod1.so
: $(objpfx
)tst-sonamemove-runmod2.so
2255 # Link against the link module, but depend on the run-time modules
2257 $(objpfx
)tst-sonamemove-link
: $(objpfx
)tst-sonamemove-linkmod1.so
2258 $(objpfx
)tst-sonamemove-link.out
: \
2259 $(objpfx
)tst-sonamemove-runmod1.so \
2260 $(objpfx
)tst-sonamemove-runmod2.so
2261 $(objpfx
)tst-sonamemove-dlopen.out
: \
2262 $(objpfx
)tst-sonamemove-runmod1.so \
2263 $(objpfx
)tst-sonamemove-runmod2.so
2265 $(objpfx
)tst-dlmopen-dlerror-mod.so
: $(libsupport
)
2266 $(objpfx
)tst-dlmopen-dlerror.out
: $(objpfx
)tst-dlmopen-dlerror-mod.so
2268 # Override -z defs, so that we can reference an undefined symbol.
2269 # Force lazy binding for the same reason.
2270 LDFLAGS-tst-latepthreadmod.so
= \
2271 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2272 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
2273 # function this_function_is_not_defined.
2274 CFLAGS-tst-latepthreadmod.c
+= -fno-optimize-sibling-calls
2275 $(objpfx
)tst-latepthreadmod.so
: $(shared-thread-library
)
2276 $(objpfx
)tst-latepthread.out
: $(objpfx
)tst-latepthreadmod.so
2278 # The test modules are parameterized by preprocessor macros.
2279 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules
)): \
2280 $(objpfx
)tst-tls-manydynamic
%mod.os
: tst-tls-manydynamicmod.c
2281 $(compile-command.c
) \
2282 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2283 $(objpfx
)tst-tls-manydynamic
: $(shared-thread-library
)
2284 $(objpfx
)tst-tls-manydynamic.out
: \
2285 $(patsubst %,$(objpfx
)%.so
,$(tst-tls-many-dynamic-modules
))
2287 $(objpfx
)tst-ldconfig-X.out
: tst-ldconfig-X.sh
$(objpfx
)ldconfig
2288 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
2289 '$(run-program-env)' > $@
; \
2292 # Test static linking of all the libraries we can possibly link
2293 # together. Note that in some configurations this may be less than the
2294 # complete list of libraries we build but we try to maxmimize this list.
2295 ifeq ($(pthread-in-libc
),no
)
2296 $(objpfx
)tst-linkall-static
: \
2297 $(common-objpfx
)resolv
/libanl.a
2299 $(objpfx
)tst-linkall-static
: \
2300 $(common-objpfx
)math
/libm.a \
2301 $(common-objpfx
)resolv
/libresolv.a \
2302 $(common-objpfx
)login
/libutil.a \
2303 $(common-objpfx
)rt
/librt.a \
2304 $(static-thread-library
)
2306 ifeq ($(build-crypt
),yes
)
2307 # If we are using NSS crypto and we have the ability to link statically
2308 # then we include libcrypt.a, otherwise we leave out libcrypt.a and
2309 # link as much as we can into the tst-linkall-static test. This assumes
2310 # that linking with libcrypt.a does everything required to include the
2311 # static NSS crypto library.
2312 ifeq (yesyes
,$(nss-crypt
)$(static-nss-crypt
))
2313 $(objpfx
)tst-linkall-static
: \
2314 $(common-objpfx
)crypt
/libcrypt.a
2316 # If we are not using NSS crypto then we always have the ability to link
2318 ifeq (no
,$(nss-crypt
))
2319 $(objpfx
)tst-linkall-static
: \
2320 $(common-objpfx
)crypt
/libcrypt.a
2324 # The application depends on the DSO, and the DSO loads the plugin.
2325 # The plugin also depends on the DSO. This creates the circular
2326 # dependency via dlopen that we're testing to make sure works.
2327 $(objpfx
)tst-nodelete-dlclose-plugin.so
: $(objpfx
)tst-nodelete-dlclose-dso.so
2328 $(objpfx
)tst-nodelete-dlclose
: $(objpfx
)tst-nodelete-dlclose-dso.so
2329 $(objpfx
)tst-nodelete-dlclose.out
: $(objpfx
)tst-nodelete-dlclose-dso.so \
2330 $(objpfx
)tst-nodelete-dlclose-plugin.so
2332 tst-env-setuid-ENV
= MALLOC_CHECK_
=2 MALLOC_MMAP_THRESHOLD_
=4096 \
2335 $(objpfx
)tst-debug1.out
: $(objpfx
)tst-debug1mod1.so
2337 $(objpfx
)tst-debug1mod1.so
: $(objpfx
)testobj1.so
2338 $(OBJCOPY
) --only-keep-debug
$< $@
2340 $(objpfx
)tst-main1
: $(objpfx
)tst-main1mod.so
2341 CRT-tst-main1
:= $(csu-objpfx
)crt1.o
2342 tst-main1-no-pie
= yes
2343 LDLIBS-tst-main1
= $(libsupport
)
2344 tst-main1mod.so-no-z-defs
= yes
2346 LDLIBS-tst-absolute-sym-lib.so
= tst-absolute-sym-lib.lds
2347 $(objpfx
)tst-absolute-sym-lib.so
: $(LDLIBS-tst-absolute-sym-lib.so
)
2348 $(objpfx
)tst-absolute-sym
: $(objpfx
)tst-absolute-sym-lib.so
2350 LDLIBS-tst-absolute-zero-lib.so
= tst-absolute-zero-lib.lds
2351 $(objpfx
)tst-absolute-zero-lib.so
: $(LDLIBS-tst-absolute-zero-lib.so
)
2352 $(objpfx
)tst-absolute-zero
: $(objpfx
)tst-absolute-zero-lib.so
2354 $(objpfx
)tst-big-note
: $(objpfx
)tst-big-note-lib.so
2355 # Avoid creating an ABI tag note, which may come before the
2356 # artificial, large note in tst-big-note-lib.o and invalidate the
2358 $(objpfx
)tst-big-note-lib.so
: $(objpfx
)tst-big-note-lib.o
2359 $(LINK.o
) -shared
-o
$@
$(LDFLAGS.so
) $<
2361 $(objpfx
)tst-unwind-ctor
: $(objpfx
)tst-unwind-ctor-lib.so
2363 CFLAGS-tst-unwind-main.c
+= -funwind-tables
-DUSE_PTHREADS
=0
2365 $(objpfx
)tst-initfinilazyfail.out
: \
2366 $(objpfx
)tst-initlazyfailmod.so
$(objpfx
)tst-finilazyfailmod.so
2367 # Override -z defs, so that we can reference an undefined symbol.
2368 # Force lazy binding for the same reason.
2369 LDFLAGS-tst-initlazyfailmod.so
= \
2370 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2371 LDFLAGS-tst-finilazyfailmod.so
= \
2372 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
2374 $(objpfx
)tst-dlopenfail.out
: \
2375 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so
2376 # Order matters here. tst-dlopenfaillinkmod.so's soname ensures a
2377 # run-time loader failure. --as-needed breaks this test because
2378 # nothing actually references tst-dlopenfailmod2.so (with its soname
2379 # tst-dlopenfail-missingmod.so).
2380 LDFLAGS-tst-dlopenfailmod1.so
= -Wl
,--no-as-needed
2381 $(objpfx
)tst-dlopenfailmod1.so
: \
2382 $(shared-thread-library
) $(objpfx
)tst-dlopenfaillinkmod.so
2383 LDFLAGS-tst-dlopenfaillinkmod.so
= -Wl
,-soname
,tst-dlopenfail-missingmod.so
2384 $(objpfx
)tst-dlopenfailmod2.so
: $(objpfx
)tst-dlopenfailnodelmod.so
2385 $(objpfx
)tst-dlopenfail-2.out
: \
2386 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so \
2387 $(objpfx
)tst-dlopenfailmod3.so
2388 # tst-dlopenfailnodelmod.so emulates how libpthread was linked.
2389 $(objpfx
)tst-dlopenfailnodelmod.so
: $(libsupport
)
2390 LDFLAGS-tst-dlopenfailnodelmod.so
= \
2391 -Wl
,--enable-new-dtags
,-z
,nodelete
,-z
,initfirst
2392 # tst-dlopenfail should export the libsupport symbols, so that
2393 # tst-dlopenfailnodelmod.so uses them for error reporting.
2394 LDFLAGS-tst-dlopenfail
= -Wl
,-E
2396 $(objpfx
)tst-dlopen-nodelete-reloc.out
: \
2397 $(objpfx
)tst-dlopen-nodelete-reloc-mod1.so \
2398 $(objpfx
)tst-dlopen-nodelete-reloc-mod2.so \
2399 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so \
2400 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so \
2401 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so \
2402 $(objpfx
)tst-dlopen-nodelete-reloc-mod6.so \
2403 $(objpfx
)tst-dlopen-nodelete-reloc-mod7.so \
2404 $(objpfx
)tst-dlopen-nodelete-reloc-mod8.so \
2405 $(objpfx
)tst-dlopen-nodelete-reloc-mod9.so \
2406 $(objpfx
)tst-dlopen-nodelete-reloc-mod10.so \
2407 $(objpfx
)tst-dlopen-nodelete-reloc-mod11.so \
2408 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so \
2409 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so \
2410 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so \
2411 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2412 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so \
2413 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
2414 tst-dlopen-nodelete-reloc-mod2.so-no-z-defs
= yes
2415 LDFLAGS-tst-dlopen-nodelete-reloc-mod2.so
= -Wl
,-z
,nodelete
2416 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
: \
2417 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so
2418 LDFLAGS-tst-dlopen-nodelete-reloc-mod4.so
= -Wl
,--no-as-needed
2419 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so
: \
2420 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
2421 LDFLAGS-tst-dlopen-nodelete-reloc-mod5.so
= -Wl
,-z
,nodelete
,--no-as-needed
2422 tst-dlopen-nodelete-reloc-mod5.so-no-z-defs
= yes
2423 tst-dlopen-nodelete-reloc-mod7.so-no-z-defs
= yes
2424 tst-dlopen-nodelete-reloc-mod11.so-no-z-defs
= yes
2425 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so
: \
2426 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so
2427 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
: \
2428 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so
2429 tst-dlopen-nodelete-reloc-mod16.so-no-z-defs
= yes
2430 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
: \
2431 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
2432 LDFLAGS-tst-dlopen-nodelete-reloc-mod16.so
= -Wl
,--no-as-needed
2433 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
: \
2434 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
2435 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
2436 LDFLAGS-tst-dlopen-nodelete-reloc-mod17.so
= -Wl
,--no-as-needed
2438 $(objpfx
)tst-ldconfig-ld_so_conf-update.out
: $(objpfx
)tst-ldconfig-ld-mod.so
2440 LDFLAGS-tst-filterobj-flt.so
= -Wl
,--filter=$(objpfx
)tst-filterobj-filtee.so
2441 $(objpfx
)tst-filterobj
: $(objpfx
)tst-filterobj-flt.so
2442 $(objpfx
)tst-filterobj.out
: $(objpfx
)tst-filterobj-filtee.so
2443 $(objpfx
)tst-filterobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2445 LDFLAGS-tst-filterobj-aux.so
= -Wl
,--auxiliary
=$(objpfx
)tst-filterobj-filtee.so
2446 $(objpfx
)tst-auxobj
: $(objpfx
)tst-filterobj-aux.so
2447 $(objpfx
)tst-auxobj.out
: $(objpfx
)tst-filterobj-filtee.so
2448 $(objpfx
)tst-auxobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
2450 $(objpfx
)tst-single_threaded
: $(objpfx
)tst-single_threaded-mod1.so
2451 $(objpfx
)tst-single_threaded.out
: \
2452 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so
2453 $(objpfx
)tst-single_threaded-static-dlopen
: \
2454 $(objpfx
)tst-single_threaded-mod1.o
2455 $(objpfx
)tst-single_threaded-static-dlopen.out
: \
2456 $(objpfx
)tst-single_threaded-mod2.so
2457 $(objpfx
)tst-single_threaded-pthread
: \
2458 $(objpfx
)tst-single_threaded-mod1.so
$(shared-thread-library
)
2459 $(objpfx
)tst-single_threaded-pthread.out
: \
2460 $(objpfx
)tst-single_threaded-mod2.so
$(objpfx
)tst-single_threaded-mod3.so \
2461 $(objpfx
)tst-single_threaded-mod4.so
2462 $(objpfx
)tst-single_threaded-pthread-static
: $(static-thread-library
)
2464 $(objpfx
)tst-tls-ie
: $(shared-thread-library
)
2465 $(objpfx
)tst-tls-ie.out
: \
2466 $(objpfx
)tst-tls-ie-mod0.so \
2467 $(objpfx
)tst-tls-ie-mod1.so \
2468 $(objpfx
)tst-tls-ie-mod2.so \
2469 $(objpfx
)tst-tls-ie-mod3.so \
2470 $(objpfx
)tst-tls-ie-mod4.so \
2471 $(objpfx
)tst-tls-ie-mod5.so \
2472 $(objpfx
)tst-tls-ie-mod6.so
2474 $(objpfx
)tst-tls-ie-dlmopen
: $(shared-thread-library
)
2475 $(objpfx
)tst-tls-ie-dlmopen.out
: \
2476 $(objpfx
)tst-tls-ie-mod0.so \
2477 $(objpfx
)tst-tls-ie-mod1.so \
2478 $(objpfx
)tst-tls-ie-mod2.so \
2479 $(objpfx
)tst-tls-ie-mod3.so \
2480 $(objpfx
)tst-tls-ie-mod4.so \
2481 $(objpfx
)tst-tls-ie-mod5.so \
2482 $(objpfx
)tst-tls-ie-mod6.so
2484 $(objpfx
)argv0test.out
: tst-rtld-argv0.sh
$(objpfx
)ld.so \
2486 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)argv0test \
2487 '$(test-wrapper-env)' '$(run_program_env)' \
2488 '$(rpath-link)' 'test-argv0' > $@
; \
2491 # A list containing the name of the most likely searched subdirectory
2492 # of the glibc-hwcaps directory, for each supported architecture (in
2493 # other words, the oldest hardware level recognized by the
2494 # glibc-hwcaps mechanism for this architecture). Used to obtain test
2495 # coverage for some glibc-hwcaps tests for the widest possible range
2497 glibc-hwcaps-first-subdirs-for-tests
= power9 x86-64-v2 z13
2499 # The test modules are parameterized by preprocessor macros.
2500 LDFLAGS-libmarkermod1-1.so
+= -Wl
,-soname
,libmarkermod1.so
2501 LDFLAGS-libmarkermod2-1.so
+= -Wl
,-soname
,libmarkermod2.so
2502 LDFLAGS-libmarkermod3-1.so
+= -Wl
,-soname
,libmarkermod3.so
2503 LDFLAGS-libmarkermod4-1.so
+= -Wl
,-soname
,libmarkermod4.so
2504 $(objpfx
)libmarkermod
%.os
: markermodMARKER-VALUE.c
2505 $(compile-command.c
) \
2506 -DMARKER
=marker
$(firstword $(subst -, ,$*)) \
2507 -DVALUE
=$(lastword
$(subst -, ,$*))
2508 $(objpfx
)libmarkermod1.so
: $(objpfx
)libmarkermod1-1.so
2510 $(objpfx
)libmarkermod2.so
: $(objpfx
)libmarkermod2-1.so
2512 $(objpfx
)libmarkermod3.so
: $(objpfx
)libmarkermod3-1.so
2514 $(objpfx
)libmarkermod4.so
: $(objpfx
)libmarkermod4-1.so
2517 # tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is
2518 # preferred over auto-detected subdirectories.
2519 $(objpfx
)tst-glibc-hwcaps-prepend
: $(objpfx
)libmarkermod1-1.so
2520 $(objpfx
)glibc-hwcaps
/prepend-markermod1
/libmarkermod1.so
: \
2521 $(objpfx
)libmarkermod1-2.so
2522 $(make-target-directory
)
2524 $(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
: $(objpfx
)libmarkermod1-3.so
2525 $(make-target-directory
)
2527 $(objpfx
)tst-glibc-hwcaps-prepend.out
: \
2528 $(objpfx
)tst-glibc-hwcaps-prepend
$(objpfx
)libmarkermod1.so \
2529 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,prepend-markermod1 \
2530 $(glibc-hwcaps-first-subdirs-for-tests
))
2531 $(test-wrapper
) $(rtld-prefix
) \
2532 --glibc-hwcaps-prepend prepend-markermod1 \
2536 # Like tst-glibc-hwcaps-prepend, but uses a container and loads the
2537 # library via ld.so.cache. Test setup is contained in the test
2539 $(objpfx
)tst-glibc-hwcaps-prepend-cache.out
: \
2540 $(objpfx
)tst-glibc-hwcaps-prepend-cache
$(objpfx
)libmarkermod1-1.so \
2541 $(objpfx
)libmarkermod1-2.so
$(objpfx
)libmarkermod1-3.so
2543 # tst-glibc-hwcaps-mask checks that --glibc-hwcaps-mask can be used to
2544 # suppress all auto-detected subdirectories.
2545 $(objpfx
)tst-glibc-hwcaps-mask
: $(objpfx
)libmarkermod1-1.so
2546 $(objpfx
)tst-glibc-hwcaps-mask.out
: \
2547 $(objpfx
)tst-glibc-hwcaps-mask
$(objpfx
)libmarkermod1.so \
2548 $(patsubst %,$(objpfx
)glibc-hwcaps
/%/libmarkermod1.so
,\
2549 $(glibc-hwcaps-first-subdirs-for-tests
))
2550 $(test-wrapper
) $(rtld-prefix
) \
2551 --glibc-hwcaps-mask does-not-exist \
2555 # Generic dependency for sysdeps implementation of
2556 # tst-glibc-hwcaps-cache.
2557 $(objpfx
)tst-glibc-hwcaps-cache.out
: $(objpfx
)tst-glibc-hwcaps
2559 $(objpfx
)list-tunables.out
: tst-rtld-list-tunables.sh
$(objpfx
)ld.so
2560 $(SHELL
) $< $(objpfx
)ld.so
'$(test-wrapper-env)' \
2561 '$(run_program_env)' > $(objpfx
)/tst-rtld-list-tunables.out
2562 cmp tst-rtld-list-tunables.exp \
2563 $(objpfx
)/tst-rtld-list-tunables.out
> $@
; \
2566 tst-dst-static-ENV
= LD_LIBRARY_PATH
='$$ORIGIN'
2568 $(objpfx
)tst-rtld-help.out
: $(objpfx
)ld.so
2569 $(test-wrapper
) $(rtld-prefix
) --help
> $@
; \
2571 echo
"info: ld.so exit status: $$status" >> $@
; \
2572 if
! grep
-q
'Legacy HWCAP subdirectories under library search path directories' $@
; then \
2573 echo
"error: missing subdirectory pattern" >> $@
; \
2574 if
test $$status -eq
0; then \
2581 # Reuses tst-tls-many-dynamic-modules
2582 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep
)): \
2583 $(objpfx
)tst-tls-manydynamic
%mod-dep.os
: tst-tls-manydynamicmod.c
2584 $(compile-command.c
) \
2585 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2586 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules-dep-bad
)): \
2587 $(objpfx
)tst-tls-manydynamic
%mod-dep-bad.os
: tst-tls-manydynamicmod.c
2588 $(compile-command.c
) \
2589 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
2590 tst-tls20mod-bad.so-no-z-defs
= yes
2591 # Single dependency.
2592 $(objpfx
)tst-tls-manydynamic0mod-dep.so
: $(objpfx
)tst-tls-manydynamic1mod-dep.so
2593 # Double dependencies.
2594 $(objpfx
)tst-tls-manydynamic2mod-dep.so
: $(objpfx
)tst-tls-manydynamic3mod-dep.so \
2595 $(objpfx
)tst-tls-manydynamic4mod-dep.so
2596 # Double dependencies with each dependency depent of another module.
2597 $(objpfx
)tst-tls-manydynamic5mod-dep.so
: $(objpfx
)tst-tls-manydynamic6mod-dep.so \
2598 $(objpfx
)tst-tls-manydynamic7mod-dep.so
2599 $(objpfx
)tst-tls-manydynamic6mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2600 $(objpfx
)tst-tls-manydynamic7mod-dep.so
: $(objpfx
)tst-tls-manydynamic8mod-dep.so
2601 # Long chain with one double dependency in the middle
2602 $(objpfx
)tst-tls-manydynamic9mod-dep.so
: $(objpfx
)tst-tls-manydynamic10mod-dep.so \
2603 $(objpfx
)tst-tls-manydynamic11mod-dep.so
2604 $(objpfx
)tst-tls-manydynamic10mod-dep.so
: $(objpfx
)tst-tls-manydynamic12mod-dep.so
2605 $(objpfx
)tst-tls-manydynamic12mod-dep.so
: $(objpfx
)tst-tls-manydynamic13mod-dep.so
2606 # Long chain with two double depedencies in the middle
2607 $(objpfx
)tst-tls-manydynamic14mod-dep.so
: $(objpfx
)tst-tls-manydynamic15mod-dep.so
2608 $(objpfx
)tst-tls-manydynamic15mod-dep.so
: $(objpfx
)tst-tls-manydynamic16mod-dep.so \
2609 $(objpfx
)tst-tls-manydynamic17mod-dep.so
2610 $(objpfx
)tst-tls-manydynamic16mod-dep.so
: $(objpfx
)tst-tls-manydynamic18mod-dep.so \
2611 $(objpfx
)tst-tls-manydynamic19mod-dep.so
2612 # Same but with an invalid module.
2613 # Single dependency.
2614 $(objpfx
)tst-tls-manydynamic0mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2615 LDFLAGS-tst-tls-manydynamic0mod-dep-bad.so
= -Wl
,--no-as-needed
2616 # Double dependencies.
2617 $(objpfx
)tst-tls-manydynamic1mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic2mod-dep-bad.so \
2618 $(objpfx
)tst-tls20mod-bad.so
2619 LDFLAGS-tst-tls-manydynamic1mod-dep-bad.so
= -Wl
,--no-as-needed
2620 # Double dependencies with each dependency depent of another module.
2621 $(objpfx
)tst-tls-manydynamic3mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so \
2622 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
2623 LDFLAGS-tst-tls-manydynamic3mod-dep-bad.so
= -Wl
,--no-as-needed
2624 $(objpfx
)tst-tls-manydynamic4mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2625 LDFLAGS-tst-tls-manydynamic4mod-dep-bad.so
= -Wl
,--no-as-needed
2626 $(objpfx
)tst-tls-manydynamic5mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2627 LDFLAGS-tst-tls-manydynamic5mod-dep-bad.so
= -Wl
,--no-as-needed
2628 # Long chain with one double dependency in the middle
2629 $(objpfx
)tst-tls-manydynamic6mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so \
2630 $(objpfx
)tst-tls-manydynamic8mod-dep-bad.so
2631 LDFLAGS-tst-tls-manydynamic6mod-dep-bad.so
= -Wl
,--no-as-needed
2632 $(objpfx
)tst-tls-manydynamic7mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
2633 LDFLAGS-tst-tls-manydynamic7mod-dep-bad.so
= -Wl
,--no-as-needed
2634 $(objpfx
)tst-tls-manydynamic9mod-dep-bad.so
: $(objpfx
)tst-tls20mod-bad.so
2635 LDFLAGS-tst-tls-manydynamic9mod-dep-bad.so
= -Wl
,--no-as-needed
2636 # Long chain with two double depedencies in the middle
2637 $(objpfx
)tst-tls-manydynamic10mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
2638 LDFLAGS-tst-tls-manydynamic10mod-dep-bad.so
= -Wl
,--no-as-needed
2639 $(objpfx
)tst-tls-manydynamic11mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so \
2640 $(objpfx
)tst-tls-manydynamic13mod-dep-bad.so
2641 LDFLAGS-tst-tls-manydynamic11mod-dep-bad.so
= -Wl
,--no-as-needed
2642 $(objpfx
)tst-tls-manydynamic12mod-dep-bad.so
: $(objpfx
)tst-tls-manydynamic14mod-dep-bad.so \
2643 $(objpfx
)tst-tls20mod-bad.so
2644 LDFLAGS-tst-tls-manydynamic12mod-dep-bad.so
= -Wl
,--no-as-needed
2645 $(objpfx
)tst-tls20
: $(shared-thread-library
)
2646 $(objpfx
)tst-tls20.out
: $(objpfx
)tst-tls20mod-bad.so \
2647 $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
) \
2648 $(tst-tls-many-dynamic-modules-dep
:%=$(objpfx
)%.so
) \
2649 $(tst-tls-many-dynamic-modules-dep-bad
:%=$(objpfx
)%.so
) \
2651 # Reuses tst-tls-many-dynamic-modules
2652 $(objpfx
)tst-tls21
: $(shared-thread-library
)
2653 $(objpfx
)tst-tls21.out
: $(objpfx
)tst-tls21mod.so
2654 $(objpfx
)tst-tls21mod.so
: $(tst-tls-many-dynamic-modules
:%=$(objpfx
)%.so
)
2656 $(objpfx
)tst-getauxval-static.out
: $(objpfx
)tst-auxvalmod.so
2657 tst-getauxval-static-ENV
= LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
)
2659 $(objpfx
)tst-dlmopen-gethostbyname.out
: $(objpfx
)tst-dlmopen-gethostbyname-mod.so
2661 $(objpfx
)tst-ro-dynamic
: $(objpfx
)tst-ro-dynamic-mod.so
2662 $(objpfx
)tst-ro-dynamic-mod.so
: $(objpfx
)tst-ro-dynamic-mod.os \
2663 tst-ro-dynamic-mod.map
2664 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@ \
2665 -Wl
,--script
=tst-ro-dynamic-mod.map \
2666 $(objpfx
)tst-ro-dynamic-mod.os
2668 $(objpfx
)tst-rtld-run-static.out
: $(objpfx
)/ldconfig
2670 $(objpfx
)tst-dl_find_object.out
: \
2671 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2672 $(objpfx
)tst-dl_find_object-static.out
: \
2673 $(objpfx
)tst-dl_find_object-mod1.so
$(objpfx
)tst-dl_find_object-mod2.so
2674 tst-dl_find_object-static-ENV
= $(static-dlopen-environment
)
2675 CFLAGS-tst-dl_find_object.c
+= -funwind-tables
2676 CFLAGS-tst-dl_find_object-static.c
+= -funwind-tables
2677 LDFLAGS-tst-dl_find_object-static
+= -Wl
,--eh-frame-hdr
2678 CFLAGS-tst-dl_find_object-mod1.c
+= -funwind-tables
2679 CFLAGS-tst-dl_find_object-mod2.c
+= -funwind-tables
2680 LDFLAGS-tst-dl_find_object-mod2.so
+= -Wl
,--enable-new-dtags
,-z
,nodelete
2681 $(objpfx
)tst-dl_find_object-threads
: $(shared-thread-library
)
2682 CFLAGS-tst-dl_find_object-threads.c
+= -funwind-tables
2683 $(objpfx
)tst-dl_find_object-threads.out
: \
2684 $(objpfx
)tst-dl_find_object-mod1.so \
2685 $(objpfx
)tst-dl_find_object-mod2.so \
2686 $(objpfx
)tst-dl_find_object-mod3.so \
2687 $(objpfx
)tst-dl_find_object-mod4.so \
2688 $(objpfx
)tst-dl_find_object-mod5.so \
2689 $(objpfx
)tst-dl_find_object-mod6.so \
2690 $(objpfx
)tst-dl_find_object-mod7.so \
2691 $(objpfx
)tst-dl_find_object-mod8.so \
2692 $(objpfx
)tst-dl_find_object-mod9.so
2693 CFLAGS-tst-dl_find_object-mod3.c
+= -funwind-tables
2694 CFLAGS-tst-dl_find_object-mod4.c
+= -funwind-tables
2695 CFLAGS-tst-dl_find_object-mod5.c
+= -funwind-tables
2696 CFLAGS-tst-dl_find_object-mod6.c
+= -funwind-tables
2697 CFLAGS-tst-dl_find_object-mod7.c
+= -funwind-tables
2698 CFLAGS-tst-dl_find_object-mod8.c
+= -funwind-tables
2699 CFLAGS-tst-dl_find_object-mod9.c
+= -funwind-tables
2701 $(objpfx
)tst-p_alignmod-base.so
: $(libsupport
)
2702 LDFLAGS-tst-p_alignmod-base.so
+= -Wl
,-z
,max-page-size
=0x200000
2704 $(objpfx
)tst-p_align1
: $(objpfx
)tst-p_alignmod1.so
2706 # Make a copy of tst-p_alignmod-base.so and lower p_align of the first
2708 $(objpfx
)tst-p_alignmod1.so
: $(objpfx
)tst-p_alignmod-base.so
2710 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2711 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a half
$@
2713 $(objpfx
)tst-p_align2
: $(objpfx
)tst-p_alignmod2.so
2715 # Make a copy of tst-p_alignmod-base.so and update p_align of the first
2717 $(objpfx
)tst-p_alignmod2.so
: $(objpfx
)tst-p_alignmod-base.so
2719 cp
$(objpfx
)tst-p_alignmod-base.so
$@
2720 $(PYTHON
) $(..
)scripts
/tst-elf-edit.py
-a
1 $@
2722 LDFLAGS-tst-p_alignmod3.so
+= -Wl
,-z
,max-page-size
=0x100,-z
,common-page-size
=0x100
2724 $(objpfx
)tst-p_align3
: $(objpfx
)tst-p_alignmod3.so
2725 $(objpfx
)tst-p_align3.out
: tst-p_align3.sh
$(objpfx
)tst-p_align3
2726 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)'; \