1# Copyright (C) 1995-2021 Free Software Foundation, Inc. 2# This file is part of the GNU C Library. 3 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. 8 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. 13 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/>. 17 18# Makefile for elf subdirectory of GNU C Library. 19 20subdir := elf 21 22include ../Makeconfig 23 24headers = elf.h bits/elfclass.h link.h bits/link.h bits/link_lavcurrent.h 25routines = $(all-dl-routines) dl-support dl-iteratephdr \ 26 dl-addr dl-addr-obj enbl-secure dl-profstub \ 27 dl-origin dl-libc dl-sym dl-sysdep dl-error \ 28 dl-reloc-static-pie libc_early_init rtld_static_init \ 29 libc-dl_find_object 30 31# The core dynamic linking functions are in libc for the static and 32# profiled libraries. 33dl-routines = $(addprefix dl-,load lookup object reloc deps \ 34 runtime init fini debug misc \ 35 version profile tls origin scope \ 36 execstack open close trampoline \ 37 exception sort-maps lookup-direct \ 38 call-libc-early-init write \ 39 thread_gscope_wait tls_init_tp \ 40 debug-symbols minimal-malloc \ 41 find_object) 42ifeq (yes,$(use-ldconfig)) 43dl-routines += dl-cache 44endif 45 46ifneq (no,$(have-tunables)) 47dl-routines += dl-tunables 48tunables-type = $(addprefix TUNABLES_FRONTEND_,$(have-tunables)) 49CPPFLAGS-dl-tunables.c += -DTUNABLES_FRONTEND=$(tunables-type) 50 51ifeq (yesyes,$(build-shared)$(run-built-tests)) 52tests-special += $(objpfx)list-tunables.out 53endif 54 55# Make sure that the compiler does not insert any library calls in tunables 56# code paths. 57ifeq (yes,$(have-loop-to-function)) 58CFLAGS-dl-tunables.c += -fno-tree-loop-distribute-patterns 59endif 60endif 61 62all-dl-routines = $(dl-routines) $(sysdep-dl-routines) 63# But they are absent from the shared libc, because that code is in ld.so. 64elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \ 65 dl-sysdep dl-exception dl-reloc-static-pie \ 66 thread_gscope_wait rtld_static_init 67 68# These object files are only included in the dynamically-linked libc. 69shared-only-routines = libc-dl_find_object 70 71# ld.so uses those routines, plus some special stuff for being the program 72# interpreter and operating independent of libc. 73rtld-routines = rtld $(all-dl-routines) dl-sysdep dl-environ dl-minimal \ 74 dl-error-minimal dl-conflict dl-hwcaps dl-hwcaps_split dl-hwcaps-subdirs \ 75 dl-usage dl-diagnostics dl-diagnostics-kernel dl-diagnostics-cpu \ 76 dl-mutex dl-libc_freeres dl-audit 77all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines) 78 79CFLAGS-dl-runtime.c += -fexceptions -fasynchronous-unwind-tables 80CFLAGS-dl-lookup.c += -fexceptions -fasynchronous-unwind-tables 81CFLAGS-dl-iteratephdr.c += $(uses-callbacks) 82 83# Called during static library initialization, so turn stack-protection 84# off for non-shared builds. 85CFLAGS-dl-minimal-malloc.o = $(no-stack-protector) 86CFLAGS-dl-minimal-malloc.op = $(no-stack-protector) 87 88# On targets without __builtin_memset, rtld.c uses a hand-coded loop 89# in _dl_start. Make sure this isn't turned into a call to regular memset. 90ifeq (yes,$(have-loop-to-function)) 91CFLAGS-rtld.c += -fno-tree-loop-distribute-patterns 92endif 93 94# Compile rtld itself without stack protection. 95# Also compile all routines in the static library that are elided from 96# the shared libc because they are in libc.a in the same way. 97 98CFLAGS-.o += $(call elide-stack-protector,.o,$(elide-routines.os)) 99CFLAGS-.op += $(call elide-stack-protector,.op,$(elide-routines.os)) 100CFLAGS-.os += $(call elide-stack-protector,.os,$(all-rtld-routines)) 101 102ifeq ($(unwind-find-fde),yes) 103routines += unwind-dw2-fde-glibc 104shared-only-routines += unwind-dw2-fde-glibc 105endif 106 107before-compile += $(objpfx)trusted-dirs.h 108generated += trusted-dirs.h trusted-dirs.st for-renamed/renamed.so 109generated-dirs += for-renamed 110 111ifeq ($(build-shared),yes) 112ld-map = $(common-objpfx)ld.map 113endif 114 115ifeq (yes,$(build-shared)) 116extra-objs = $(all-rtld-routines:%=%.os) sofini.os interp.os 117generated += librtld.os dl-allobjs.os ld.so ldd 118install-others = $(inst_rtlddir)/$(rtld-installed-name) $(inst_bindir)/ld.so 119install-bin-script = ldd 120endif 121 122others = sprof sln 123install-bin = sprof 124others-static = sln 125install-rootsbin = sln 126sln-modules := static-stubs 127extra-objs += $(sln-modules:=.o) 128 129ifeq (yes,$(use-ldconfig)) 130ifeq (yes,$(build-shared)) 131others-static += ldconfig 132others += ldconfig 133install-rootsbin += ldconfig 134 135ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon static-stubs \ 136 stringtable 137extra-objs += $(ldconfig-modules:=.o) 138others-extras = $(ldconfig-modules) 139endif 140endif 141 142# To find xmalloc.c and xstrdup.c 143vpath %.c ../locale/programs 144 145ifeq ($(build-shared),yes) 146extra-objs += sotruss-lib.os sotruss-lib.so 147install-others += $(inst_auditdir)/sotruss-lib.so 148install-bin-script += sotruss 149generated += sotruss 150libof-sotruss-lib = extramodules 151LDFLAGS-sotruss-lib.so += $(z-now-$(bind-now)) 152$(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os 153 $(build-module-asneeded) 154$(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \ 155 $(common-objpfx)libc_nonshared.a 156 157$(objpfx)sotruss: sotruss.sh $(common-objpfx)config.make 158 sed -e 's%@VERSION@%$(version)%g' \ 159 -e 's%@TEXTDOMAINDIR@%$(localedir)%g' \ 160 -e 's%@PREFIX@%$(prefix)%g' \ 161 -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ 162 -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \ 163 < $< > $@.new 164 chmod 555 $@.new 165 mv -f $@.new $@ 166$(inst_auditdir)/sotruss-lib.so: $(objpfx)sotruss-lib.so $(+force) 167 $(do-install-program) 168endif 169 170tests-static-normal := tst-array1-static tst-array5-static \ 171 tst-dl-iter-static \ 172 tst-tlsalign-static tst-tlsalign-extern-static \ 173 tst-linkall-static tst-env-setuid tst-env-setuid-tunables \ 174 tst-single_threaded-static tst-single_threaded-pthread-static \ 175 tst-dst-static tst-getauxval-static 176 177tests-static-internal := tst-tls1-static \ 178 tst-ptrguard1-static tst-stackguard1-static \ 179 tst-tls1-static-non-pie \ 180 tst-dl_find_object-static 181 182CRT-tst-tls1-static-non-pie := $(csu-objpfx)crt1.o 183tst-tls1-static-non-pie-no-pie = yes 184 185tests-container := \ 186 tst-ldconfig-bad-aux-cache \ 187 tst-ldconfig-ld_so_conf-update 188 189ifeq (no,$(build-hardcoded-path-in-tests)) 190# This is an ld.so.cache test, and RPATH/RUNPATH in the executable 191# interferes with its test objectives. 192tests-container += tst-glibc-hwcaps-prepend-cache 193endif 194 195tests := tst-tls9 tst-leaks1 \ 196 tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \ 197 tst-auxv tst-stringtable 198tests-internal := tst-tls1 $(tests-static-internal) 199tests-static := $(tests-static-normal) $(tests-static-internal) 200 201ifeq (yes,$(build-shared)) 202tests-static += tst-tls9-static tst-single_threaded-static-dlopen 203static-dlopen-environment = \ 204 LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)dlfcn 205tst-tls9-static-ENV = $(static-dlopen-environment) 206tst-single_threaded-static-dlopen-ENV = $(static-dlopen-environment) 207 208tests += restest1 preloadtest loadfail multiload origtest resolvfail \ 209 constload1 order noload filter \ 210 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \ 211 nodlopen nodlopen2 lateglobal initfirst global \ 212 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \ 213 tst-tls4 tst-tls5 \ 214 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \ 215 tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \ 216 tst-align tst-align2 tst-align3 \ 217 tst-dlmodcount tst-dlopenrpath tst-deep1 \ 218 tst-dlmopen1 tst-dlmopen3 tst-dlmopen4 \ 219 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \ 220 tst-audit1 tst-audit2 tst-audit8 tst-audit9 \ 221 tst-addr1 tst-thrlock \ 222 tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \ 223 tst-nodelete tst-dlopen-nodelete-reloc) \ 224 tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \ 225 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \ 226 tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \ 227 tst-latepthread tst-tls-manydynamic tst-nodelete-dlclose \ 228 tst-debug1 tst-main1 tst-absolute-sym tst-absolute-zero tst-big-note \ 229 tst-unwind-ctor tst-unwind-main tst-audit13 \ 230 tst-sonamemove-link tst-sonamemove-dlopen tst-dlopen-tlsmodid \ 231 tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenfail \ 232 tst-dlopenfail-2 \ 233 tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlopen \ 234 tst-single_threaded tst-single_threaded-pthread \ 235 tst-tls-ie tst-tls-ie-dlmopen argv0test \ 236 tst-glibc-hwcaps tst-glibc-hwcaps-prepend tst-glibc-hwcaps-mask \ 237 tst-tls20 tst-tls21 tst-dlmopen-dlerror tst-dlmopen-gethostbyname \ 238 tst-dl-is_dso tst-ro-dynamic \ 239 tst-audit18 \ 240 tst-audit19b \ 241 tst-audit20 \ 242 tst-audit22 \ 243 tst-rtld-run-static \ 244# reldep9 245tests-internal += loadtest unload unload2 circleload1 \ 246 neededtest neededtest2 neededtest3 neededtest4 \ 247 tst-tls3 tst-tls6 tst-tls7 tst-tls8 tst-dlmopen2 \ 248 tst-ptrguard1 tst-stackguard1 \ 249 tst-create_format1 tst-tls-surplus tst-dl-hwcaps_split \ 250 tst-audit19a \ 251 tst-dl_find_object tst-dl_find_object-threads 252tests-container += tst-pldd tst-dlopen-tlsmodid-container \ 253 tst-dlopen-self-container tst-preload-pthread-libc 254test-srcs = tst-pathopt 255ifeq (yes,$(have-fpie)) 256tests-pie += tst-align3 257endif 258selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null) 259ifneq ($(selinux-enabled),1) 260tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog 261endif 262ifeq ($(have-depaudit),yes) 263tests += tst-audit14 tst-audit15 tst-audit16 264ifeq ($(run-built-tests),yes) 265tests-special += $(objpfx)tst-audit14-cmp.out $(objpfx)tst-audit15-cmp.out \ 266 $(objpfx)tst-audit16-cmp.out 267endif 268endif 269endif 270tests += $(tests-execstack-$(have-z-execstack)) 271ifeq ($(run-built-tests),yes) 272tests-special += $(objpfx)tst-leaks1-mem.out \ 273 $(objpfx)noload-mem.out \ 274 $(objpfx)tst-ldconfig-X.out $(objpfx)tst-rtld-help.out 275endif 276tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 277tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 278tlsmod17a-modules = $(addprefix tst-tlsmod17a, $(tlsmod17a-suffixes)) 279tlsmod18a-modules = $(addprefix tst-tlsmod18a, $(tlsmod17a-suffixes)) 280one-hundred = $(foreach x,0 1 2 3 4 5 6 7 8 9, \ 281 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x) 282tst-tls-many-dynamic-modules := \ 283 $(foreach n,$(one-hundred),tst-tls-manydynamic$(n)mod) 284tst-tls-many-dynamic-modules-dep-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 \ 285 14 15 16 17 18 19 286tst-tls-many-dynamic-modules-dep = \ 287 $(foreach n,$(tst-tls-many-dynamic-modules-dep-suffixes),tst-tls-manydynamic$(n)mod-dep) 288tst-tls-many-dynamic-modules-dep-bad-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 289tst-tls-many-dynamic-modules-dep-bad = \ 290 $(foreach n,$(tst-tls-many-dynamic-modules-dep-bad-suffixes),tst-tls-manydynamic$(n)mod-dep-bad) 291extra-test-objs += $(tlsmod17a-modules:=.os) $(tlsmod18a-modules:=.os) \ 292 tst-tlsalign-vars.o 293test-extras += tst-tlsmod17a tst-tlsmod18a tst-tlsalign-vars 294modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ 295 testobj1_1 failobj constload2 constload3 unloadmod \ 296 dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \ 297 nodelmod1 nodelmod2 nodelmod3 nodelmod4 \ 298 nodel2mod1 nodel2mod2 nodel2mod3 \ 299 nodlopenmod nodlopenmod2 filtmod1 filtmod2 \ 300 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \ 301 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \ 302 neededobj1 neededobj2 neededobj3 neededobj4 \ 303 neededobj5 neededobj6 firstobj globalmod1 \ 304 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \ 305 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \ 306 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \ 307 reldep7mod1 reldep7mod2 \ 308 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \ 309 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \ 310 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \ 311 tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \ 312 tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \ 313 $(tlsmod17a-modules) tst-tlsmod17b $(tlsmod18a-modules) \ 314 tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \ 315 circlemod1 circlemod1a circlemod2 circlemod2a \ 316 circlemod3 circlemod3a \ 317 reldep8mod1 reldep8mod2 reldep8mod3 \ 318 reldep9mod1 reldep9mod2 reldep9mod3 \ 319 tst-alignmod tst-alignmod2 tst-alignmod3 \ 320 $(modules-execstack-$(have-z-execstack)) \ 321 tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \ 322 tst-dlmopen1mod tst-auditmod1 \ 323 unload3mod1 unload3mod2 unload3mod3 unload3mod4 \ 324 unload4mod1 unload4mod2 unload4mod3 unload4mod4 \ 325 unload6mod1 unload6mod2 unload6mod3 \ 326 unload7mod1 unload7mod2 \ 327 unload8mod1 unload8mod1x unload8mod2 unload8mod3 \ 328 order2mod1 order2mod2 order2mod3 order2mod4 \ 329 tst-unique1mod1 tst-unique1mod2 \ 330 tst-unique2mod1 tst-unique2mod2 \ 331 tst-auditmod9a tst-auditmod9b \ 332 $(if $(CXX),tst-unique3lib tst-unique3lib2 tst-unique4lib \ 333 tst-nodelete-uniquemod tst-nodelete-rtldmod \ 334 tst-nodelete-zmod \ 335 tst-dlopen-nodelete-reloc-mod1 \ 336 tst-dlopen-nodelete-reloc-mod2 \ 337 tst-dlopen-nodelete-reloc-mod3 \ 338 tst-dlopen-nodelete-reloc-mod4 \ 339 tst-dlopen-nodelete-reloc-mod5 \ 340 tst-dlopen-nodelete-reloc-mod6 \ 341 tst-dlopen-nodelete-reloc-mod7 \ 342 tst-dlopen-nodelete-reloc-mod8 \ 343 tst-dlopen-nodelete-reloc-mod9 \ 344 tst-dlopen-nodelete-reloc-mod10 \ 345 tst-dlopen-nodelete-reloc-mod11 \ 346 tst-dlopen-nodelete-reloc-mod12 \ 347 tst-dlopen-nodelete-reloc-mod13 \ 348 tst-dlopen-nodelete-reloc-mod14 \ 349 tst-dlopen-nodelete-reloc-mod15 \ 350 tst-dlopen-nodelete-reloc-mod16 \ 351 tst-dlopen-nodelete-reloc-mod17) \ 352 tst-initordera1 tst-initorderb1 \ 353 tst-initordera2 tst-initorderb2 \ 354 tst-initordera3 tst-initordera4 \ 355 tst-initorder2a tst-initorder2b tst-initorder2c \ 356 tst-initorder2d \ 357 tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \ 358 tst-array5dep tst-null-argv-lib \ 359 tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod \ 360 tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \ 361 tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \ 362 tst-latepthreadmod $(tst-tls-many-dynamic-modules) \ 363 $(tst-tls-many-dynamic-modules-dep) \ 364 $(tst-tls-many-dynamic-modules-dep-bad) \ 365 tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \ 366 tst-main1mod tst-absolute-sym-lib \ 367 tst-absolute-zero-lib tst-big-note-lib tst-unwind-ctor-lib \ 368 tst-audit13mod1 tst-sonamemove-linkmod1 \ 369 tst-sonamemove-runmod1 tst-sonamemove-runmod2 \ 370 tst-auditmanymod1 tst-auditmanymod2 tst-auditmanymod3 \ 371 tst-auditmanymod4 tst-auditmanymod5 tst-auditmanymod6 \ 372 tst-auditmanymod7 tst-auditmanymod8 tst-auditmanymod9 \ 373 tst-initlazyfailmod tst-finilazyfailmod \ 374 tst-dlopenfailmod1 tst-dlopenfaillinkmod tst-dlopenfailmod2 \ 375 tst-dlopenfailmod3 tst-dlopenfailnodelmod tst-ldconfig-ld-mod \ 376 tst-filterobj-flt tst-filterobj-aux tst-filterobj-filtee \ 377 tst-auditlogmod-1 tst-auditlogmod-2 tst-auditlogmod-3 \ 378 tst-single_threaded-mod1 tst-single_threaded-mod2 \ 379 tst-single_threaded-mod3 tst-single_threaded-mod4 \ 380 tst-tls-ie-mod0 tst-tls-ie-mod1 tst-tls-ie-mod2 \ 381 tst-tls-ie-mod3 tst-tls-ie-mod4 tst-tls-ie-mod5 \ 382 tst-tls-ie-mod6 libmarkermod1-1 libmarkermod1-2 libmarkermod1-3 \ 383 libmarkermod2-1 libmarkermod2-2 \ 384 libmarkermod3-1 libmarkermod3-2 libmarkermod3-3 \ 385 libmarkermod4-1 libmarkermod4-2 libmarkermod4-3 libmarkermod4-4 \ 386 tst-tls20mod-bad tst-tls21mod tst-dlmopen-dlerror-mod \ 387 tst-auxvalmod \ 388 tst-dlmopen-gethostbyname-mod tst-ro-dynamic-mod \ 389 tst-auditmod18 \ 390 tst-audit18mod \ 391 tst-auditmod19a \ 392 tst-auditmod19b \ 393 tst-audit19bmod \ 394 tst-auditmod20 \ 395 tst-auditmod22 \ 396 tst-dl_find_object-mod1 \ 397 tst-dl_find_object-mod2 \ 398 tst-dl_find_object-mod3 \ 399 tst-dl_find_object-mod4 \ 400 tst-dl_find_object-mod5 \ 401 tst-dl_find_object-mod6 \ 402 tst-dl_find_object-mod7 \ 403 tst-dl_find_object-mod8 \ 404 tst-dl_find_object-mod9 \ 405 406# Most modules build with _ISOMAC defined, but those filtered out 407# depend on internal headers. 408modules-names-tests = $(filter-out ifuncmod% tst-tlsmod%,\ 409 $(modules-names)) 410 411ifeq (yes,$(have-mtls-dialect-gnu2)) 412tests += tst-gnu2-tls1 413modules-names += tst-gnu2-tls1mod 414$(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so 415tst-gnu2-tls1mod.so-no-z-defs = yes 416CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2 417 418tests += tst-audit-tlsdesc tst-audit-tlsdesc-dlopen 419modules-names += tst-audit-tlsdesc-mod1 tst-audit-tlsdesc-mod2 tst-auditmod-tlsdesc 420$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \ 421 $(objpfx)tst-audit-tlsdesc-mod2.so \ 422 $(shared-thread-library) 423CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2 424CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2 425$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library) 426$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \ 427 $(objpfx)tst-audit-tlsdesc-mod2.so 428$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so 429$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so 430tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so 431$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so 432tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so 433endif 434ifeq (yes,$(have-protected-data)) 435modules-names += tst-protected1moda tst-protected1modb 436tests += tst-protected1a tst-protected1b 437$(objpfx)tst-protected1a: $(addprefix $(objpfx),tst-protected1moda.so tst-protected1modb.so) 438$(objpfx)tst-protected1b: $(addprefix $(objpfx),tst-protected1modb.so tst-protected1moda.so) 439tst-protected1modb.so-no-z-defs = yes 440# These tests fail with GCC versions prior to 5.1 and with some versions 441# of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709 442# and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details. 443# Perhaps in future we can make these XFAILs conditional on some detection 444# of compiler/linker behavior/version. 445test-xfail-tst-protected1a = yes 446test-xfail-tst-protected1b = yes 447endif 448ifeq (yesyes,$(have-fpie)$(build-shared)) 449modules-names += tst-piemod1 450tests += tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \ 451 tst-dlopen-self-pie 452tests-pie += tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie 453ifeq (yes,$(have-protected-data)) 454tests += vismain 455tests-pie += vismain 456CFLAGS-vismain.c += $(PIE-ccflag) 457endif 458endif 459modules-execstack-yes = tst-execstack-mod 460extra-test-objs += $(addsuffix .os,$(strip $(modules-names))) 461 462# filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special 463# rules. 464modules-names-nobuild := filtmod1 tst-big-note-lib tst-ro-dynamic-mod 465 466tests += $(tests-static) 467 468ifeq (yes,$(have-ifunc)) 469tests-ifuncstatic := ifuncmain1static ifuncmain1picstatic \ 470 ifuncmain2static ifuncmain2picstatic \ 471 ifuncmain4static ifuncmain4picstatic \ 472 ifuncmain5static ifuncmain5picstatic \ 473 ifuncmain7static ifuncmain7picstatic 474ifeq (yes,$(have-gcc-ifunc)) 475tests-ifuncstatic += ifuncmain9static ifuncmain9picstatic 476endif 477tests-static += $(tests-ifuncstatic) 478tests-internal += $(tests-ifuncstatic) 479ifeq (yes,$(build-shared)) 480tests += tst-ifunc-fault-lazy tst-ifunc-fault-bindnow 481# Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8. 482tests-internal += \ 483 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \ 484 ifuncmain1staticpic \ 485 ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \ 486 ifuncmain5staticpic \ 487 ifuncmain7 ifuncmain7pic 488ifeq (no,$(with-lld)) 489tests-internal += ifuncmain1 ifuncmain5 ifuncmain5pic 490endif 491ifeq (yes,$(have-gcc-ifunc)) 492tests-internal += ifuncmain9 ifuncmain9pic 493endif 494ifunc-test-modules = ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \ 495 ifuncdep5 ifuncdep5pic 496extra-test-objs += $(ifunc-test-modules:=.o) 497test-internal-extras += $(ifunc-test-modules) 498ifeq (yes,$(have-fpie)) 499ifunc-pie-tests = ifuncmain1pie ifuncmain1vispie ifuncmain1staticpie \ 500 ifuncmain6pie ifuncmain7pie 501ifeq (yes,$(have-gcc-ifunc)) 502ifunc-pie-tests += ifuncmain9pie 503endif 504ifeq (no,$(with-lld)) 505ifunc-pie-tests += ifuncmain5pie 506endif 507ifeq (yes,$(have-textrel_ifunc)) 508ifunc-pie-tests += tst-ifunc-textrel 509endif 510tests-internal += $(ifunc-pie-tests) 511tests-pie += $(ifunc-pie-tests) 512endif 513modules-names += ifuncmod1 ifuncmod3 ifuncmod6 514ifeq (no,$(with-lld)) 515modules-names += ifuncmod5 516endif 517endif 518endif 519 520ifeq (yes,$(build-shared)) 521ifeq ($(run-built-tests),yes) 522tests-special += $(objpfx)tst-pathopt.out $(objpfx)tst-rtld-load-self.out \ 523 $(objpfx)tst-rtld-preload.out $(objpfx)argv0test.out \ 524 $(objpfx)tst-rtld-help.out 525endif 526tests-special += $(objpfx)check-textrel.out $(objpfx)check-execstack.out \ 527 $(objpfx)check-wx-segment.out \ 528 $(objpfx)check-localplt.out $(objpfx)check-initfini.out 529endif 530 531ifeq ($(run-built-tests),yes) 532tests-special += $(objpfx)order-cmp.out $(objpfx)tst-array1-cmp.out \ 533 $(objpfx)tst-array1-static-cmp.out \ 534 $(objpfx)tst-array2-cmp.out $(objpfx)tst-array3-cmp.out \ 535 $(objpfx)tst-array4-cmp.out $(objpfx)tst-array5-cmp.out \ 536 $(objpfx)tst-array5-static-cmp.out $(objpfx)order2-cmp.out \ 537 $(objpfx)tst-initorder-cmp.out \ 538 $(objpfx)tst-initorder2-cmp.out $(objpfx)tst-unused-dep.out \ 539 $(objpfx)tst-unused-dep-cmp.out 540endif 541 542ifndef avoid-generated 543# DSO sorting tests: 544# The dso-ordering-test.py script generates testcase source files in $(objpfx), 545# creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a 546# Makefile fragment to be included. 547define include_dsosort_tests 548$(objpfx)$(1).generated-makefile: $(1) 549 $(PYTHON) $(..)scripts/dso-ordering-test.py \ 550 --description-file $$< --objpfx $(objpfx) --output-makefile $$@T 551 mv $$@T $$@ 552-include $(objpfx)$(1).generated-makefile 553endef 554endif 555 556postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \ 557 $(objpfx)/dso-sort-tests-2.generated-makefile 558 559# Generate from each testcase description file 560ifeq (yes,$(have-tunables)) 561$(eval $(call include_dsosort_tests,dso-sort-tests-1.def)) 562$(eval $(call include_dsosort_tests,dso-sort-tests-2.def)) 563endif 564 565check-abi: $(objpfx)check-abi-ld.out 566tests-special += $(objpfx)check-abi-ld.out 567update-abi: update-abi-ld 568update-all-abi: update-all-abi-ld 569 570ifeq ($(have-glob-dat-reloc),yes) 571tests += tst-prelink 572tests-internal += tst-prelink-cmp 573# Don't compile tst-prelink.c with PIE for GLOB_DAT relocation. 574CFLAGS-tst-prelink.c += -fno-pie 575tst-prelink-no-pie = yes 576endif 577 578# The test requires shared _and_ PIE because the executable 579# unit test driver must be able to link with the shared object 580# that is going to eventually go into an installed DSO. 581ifeq (yesyes,$(have-fpie)$(build-shared)) 582tests-internal += tst-_dl_addr_inside_object 583tests-pie += tst-_dl_addr_inside_object 584$(objpfx)tst-_dl_addr_inside_object: $(objpfx)dl-addr-obj.os 585CFLAGS-tst-_dl_addr_inside_object.c += $(PIE-ccflag) 586endif 587 588# We can only test static libcrypt use if libcrypt has been built, 589# and either NSS crypto is not in use, or static NSS libraries are 590# available. 591ifeq ($(build-crypt),no) 592CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=0 593else 594ifeq ($(nss-crypt),no) 595CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=1 596else 597ifeq ($(static-nss-crypt),no) 598CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=0 599else 600CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=1 601endif 602endif 603endif 604 605include ../Rules 606 607ifeq (yes,$(build-shared)) 608# Make sure these things are built in the `make lib' pass so they can be used 609# to run programs during the `make others' pass. 610lib-noranlib: $(objpfx)$(rtld-installed-name) \ 611 $(addprefix $(objpfx),$(extra-objs)) 612endif 613 614# Command to link into a larger single relocatable object. 615reloc-link = $(LINK.o) -nostdlib -nostartfiles -r 616 617$(objpfx)sotruss-lib.so: $(shlib-lds) 618 619$(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os) 620 $(reloc-link) -o $@ $^ 621 622# Link together the dynamic linker into a single relocatable object. 623# First we do a link against libc_pic.a just to get a link map, 624# and discard the object produced by that link. From the link map 625# we can glean all the libc modules that need to go into the dynamic 626# linker. Then we do a recursive make that goes into all the subdirs 627# those modules come from and builds special rtld-foo.os versions that 628# are compiled with special flags, and puts these modules into rtld-libc.a 629# for us. Then we do the real link using rtld-libc.a instead of libc_pic.a. 630 631# These symbols need to be stubbed out during symbol discovery because 632# their implementation is provided differently in rtld, and the symbol 633# discovery mechanism is not compatible with the libc implementation 634# when compiled for libc. 635rtld-stubbed-symbols = \ 636 __GI___pthread_disable_asynccancel \ 637 __GI___pthread_enable_asynccancel \ 638 __pthread_disable_asynccancel \ 639 __pthread_enable_asynccancel \ 640 calloc \ 641 free \ 642 malloc \ 643 realloc \ 644 645ifeq ($(have-ssp),yes) 646# rtld is not built with the stack protector, so these references will 647# go away in the rebuilds. 648rtld-stubbed-symbols += __stack_chk_fail __stack_chk_fail_local 649endif 650 651$(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a 652 @-rm -f $@T 653 for symbol in $(rtld-stubbed-symbols); do \ 654 echo ".globl $$symbol"; \ 655 echo "$$symbol:"; \ 656 done | $(CC) -o $@T.o $(ASFLAGS) -c -x assembler - 657 $(reloc-link) -o $@.o $@T.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T 658 rm -f %@T.o $@.o 659 mv -f $@T $@ 660 661# For lld, skip preceding addresses and values before matching the archive and the member. 662$(objpfx)librtld.mk: $(objpfx)librtld.map Makefile 663 LC_ALL=C \ 664 sed -n 's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \ 665 $< | \ 666 while read lib file; do \ 667 case $$lib in \ 668 libc_pic.a) \ 669 LC_ALL=C fgrep -l /$$file \ 670 $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \ 671 LC_ALL=C \ 672 sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\ 673 ;; \ 674 */*.a) \ 675 echo rtld-$${lib%%/*} += $$file ;; \ 676 *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \ 677 esac; \ 678 done > $@T 679 echo rtld-subdirs = `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \ 680 | LC_ALL=C sort -u` >> $@T 681 mv -f $@T $@ 682 683$(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE 684 $(MAKE) -f $< -f rtld-Rules 685 686$(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a 687 $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \ 688 -Wl,-Map,$@.map 689 690generated += librtld.map librtld.mk rtld-libc.a librtld.os.map 691 692z-now-yes = -Wl,-z,now 693 694$(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) 695# Link into a temporary file so that we don't touch $@ at all 696# if the sanity check below fails. 697 $(LINK.o) -nostdlib -nostartfiles -shared -o $@.new \ 698 $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \ 699 $(filter-out $(map-file),$^) $(load-map-file) \ 700 -Wl,-soname=$(rtld-installed-name) \ 701 -Wl,-defsym=_begin=0 702 $(call after-link,$@.new) 703 $(READELF) -s $@.new \ 704 | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' 705 mv -f $@.new $@ 706 707ifeq (yes,$(build-shared)) 708# interp.c exists just to get the runtime linker path into libc.so. 709$(objpfx)interp.os: $(common-objpfx)runtime-linker.h 710endif 711 712ifneq (ld.so,$(rtld-installed-name)) 713# Make sure ld.so.1 exists in the build directory so we can link 714# against it. 715$(objpfx)$(rtld-installed-name): $(objpfx)ld.so 716 $(make-link) 717generated += $(rtld-installed-name) 718endif 719 720# Build a file mentioning all trustworthy directories to look for shared 721# libraries when using LD_LIBRARY_PATH in a setuid program. The user can 722# add directories to the list by defining $(user-defined-trusted-dirs) 723# before starting make. 724$(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @: 725$(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig 726 $(make-target-directory) 727 echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \ 728 | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T}; 729 echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T} 730 $(move-if-change) ${@:st=T} ${@:st=h} 731 touch $@ 732CPPFLAGS-dl-load.c += -I$(objpfx). -I$(csu-objpfx). 733 734ifeq (yes,$(build-shared)) 735$(inst_rtlddir)/$(rtld-installed-name): $(objpfx)ld.so $(+force) 736 $(make-target-directory) 737 $(do-install-program) 738 739# Creates the relative /usr/bin/ld.so symbolic link. 740$(inst_bindir)/ld.so: $(inst_rtlddir)/$(rtld-installed-name) 741 $(make-target-directory) 742 $(make-link) 743 744# Special target called by parent to install just the dynamic linker. 745.PHONY: ldso_install 746ldso_install: $(inst_rtlddir)/$(rtld-installed-name) 747endif # $(build-shared) 748 749 750# Workarounds for ${exec_prefix} expansion in configure variables. 751# config.status cannot be used directly for processing ldd.bash.in or 752# expanding variables such as sysconfdir because the expansion 753# contains the literal string ${exec_prefix}, which is not valid in C 754# headers or installed shell scripts. 755 756ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \ 757 -e 's%@VERSION@%$(version)%g' \ 758 -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ 759 -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \ 760 -e 's%@TEXTDOMAINDIR@%$(localedir)%g' 761 762ifeq ($(ldd-rewrite-script),no) 763define gen-ldd 764LC_ALL=C sed $(ldd-rewrite) < $< > $@.new 765endef 766else 767define gen-ldd 768LC_ALL=C sed $(ldd-rewrite) < $< \ 769| LC_ALL=C sed -f $(patsubst $(..)/%,/%,$(..)$(ldd-rewrite-script)) > $@.new 770endef 771endif 772 773$(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \ 774 $(common-objpfx)config.make 775 $(gen-ldd) 776 chmod 555 $@.new 777 mv -f $@.new $@ 778 779$(objpfx)sln: $(sln-modules:%=$(objpfx)%.o) 780 781$(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) 782 783SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' 784CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ 785 -D'SLIBDIR="$(slibdir)"' 786libof-ldconfig = ldconfig 787CFLAGS-dl-cache.c += $(SYSCONF-FLAGS) 788CFLAGS-cache.c += $(SYSCONF-FLAGS) 789CFLAGS-rtld.c += $(SYSCONF-FLAGS) 790CFLAGS-dl-usage.c += $(SYSCONF-FLAGS) \ 791 -D'RTLD="$(rtlddir)/$(rtld-installed-name)"' 792CFLAGS-dl-diagnostics.c += $(SYSCONF-FLAGS) \ 793 -D'PREFIX="$(prefix)"' \ 794 -D'RTLD="$(rtlddir)/$(rtld-installed-name)"' 795 796cpp-srcs-left := $(all-rtld-routines:=.os) 797lib := rtld 798include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left)) 799 800test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) 801generated += $(addsuffix .so,$(strip $(modules-names))) 802 803$(objpfx)testobj1_1.so: $(objpfx)testobj1.so 804$(objpfx)testobj2.so: $(objpfx)testobj1.so 805$(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so 806$(objpfx)failobj.so: $(objpfx)testobj6.so 807$(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so 808$(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so 809$(objpfx)dep4.so: $(objpfx)dep3.so 810$(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so 811$(objpfx)neededobj2.so: $(objpfx)neededobj1.so 812$(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so 813$(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ 814 $(objpfx)neededobj3.so 815$(objpfx)neededobj6.so: $(objpfx)neededobj5.so 816$(objpfx)unload2mod.so: $(objpfx)unload2dep.so 817$(objpfx)firstobj.so: $(shared-thread-library) 818$(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so 819$(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so 820$(objpfx)dblloadmod1.so: $(objpfx)dblloadmod3.so 821$(objpfx)dblloadmod2.so: $(objpfx)dblloadmod3.so 822$(objpfx)reldepmod5.so: $(objpfx)reldepmod2.so 823$(objpfx)reldepmod6.so: $(objpfx)reldepmod2.so 824$(objpfx)reldep6mod1.so: $(objpfx)reldep6mod0.so 825$(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so 826$(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so 827$(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so 828$(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so 829$(objpfx)tst-tlsmod8.so: $(objpfx)tst-tlsmod7.so 830$(objpfx)tst-tlsmod10.so: $(objpfx)tst-tlsmod9.so 831$(objpfx)tst-tlsmod12.so: $(objpfx)tst-tlsmod11.so 832$(objpfx)tst-tlsmod13a.so: $(objpfx)tst-tlsmod13.so 833# For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED 834$(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so 835$(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so 836$(objpfx)tst-tls19mod1.so: $(objpfx)tst-tls19mod2.so $(objpfx)tst-tls19mod3.so 837$(objpfx)tst-tls19mod3.so: $(objpfx)ld.so 838$(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so 839$(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so 840$(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so 841$(objpfx)reldep9mod3.so: $(objpfx)reldep9mod1.so $(objpfx)reldep9mod2.so 842$(objpfx)unload3mod1.so: $(objpfx)unload3mod3.so 843$(objpfx)unload3mod2.so: $(objpfx)unload3mod3.so 844$(objpfx)unload3mod3.so: $(objpfx)unload3mod4.so 845$(objpfx)unload4mod1.so: $(objpfx)unload4mod2.so $(objpfx)unload4mod3.so 846$(objpfx)unload4mod2.so: $(objpfx)unload4mod4.so $(objpfx)unload4mod3.so 847$(objpfx)unload7mod2.so: $(objpfx)unload7mod1.so 848$(objpfx)unload8mod1.so: $(objpfx)unload8mod2.so 849$(objpfx)unload8mod2.so: $(objpfx)unload8mod3.so 850$(objpfx)tst-initordera2.so: $(objpfx)tst-initordera1.so 851$(objpfx)tst-initorderb2.so: $(objpfx)tst-initorderb1.so $(objpfx)tst-initordera2.so 852$(objpfx)tst-initordera3.so: $(objpfx)tst-initorderb2.so $(objpfx)tst-initorderb1.so 853$(objpfx)tst-initordera4.so: $(objpfx)tst-initordera3.so 854$(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-initorderb2.so 855$(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so 856$(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so 857$(objpfx)tst-nodelete-opened.out: $(objpfx)tst-nodelete-opened-lib.so 858 859$(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o 860$(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o 861 862tst-null-argv-ENV = LD_DEBUG=all LD_DEBUG_OUTPUT=$(objpfx)tst-null-argv.debug.out 863LDFLAGS-nodel2mod3.so = -Wl,--no-as-needed 864LDFLAGS-reldepmod5.so = -Wl,--no-as-needed 865LDFLAGS-reldep6mod1.so = -Wl,--no-as-needed 866LDFLAGS-reldep6mod4.so = -Wl,--no-as-needed 867LDFLAGS-reldep8mod3.so = -Wl,--no-as-needed 868LDFLAGS-unload4mod1.so = -Wl,--no-as-needed 869LDFLAGS-unload4mod2.so = -Wl,--no-as-needed 870LDFLAGS-tst-initorder = -Wl,--no-as-needed 871LDFLAGS-tst-initordera2.so = -Wl,--no-as-needed 872LDFLAGS-tst-initordera3.so = -Wl,--no-as-needed 873LDFLAGS-tst-initordera4.so = -Wl,--no-as-needed 874LDFLAGS-tst-initorderb2.so = -Wl,--no-as-needed 875LDFLAGS-tst-tlsmod5.so = -nostdlib -Wl,--no-as-needed 876LDFLAGS-tst-tlsmod6.so = -nostdlib -Wl,--no-as-needed 877 878testobj1.so-no-z-defs = yes 879testobj3.so-no-z-defs = yes 880testobj4.so-no-z-defs = yes 881testobj5.so-no-z-defs = yes 882testobj6.so-no-z-defs = yes 883failobj.so-no-z-defs = yes 884constload2.so-no-z-defs = yes 885constload3.so-no-z-defs = yes 886nodelmod1.so-no-z-defs = yes 887nodelmod2.so-no-z-defs = yes 888nodelmod4.so-no-z-defs = yes 889nodel2mod2.so-no-z-defs = yes 890reldepmod2.so-no-z-defs = yes 891reldepmod3.so-no-z-defs = yes 892reldepmod4.so-no-z-defs = yes 893reldep4mod4.so-no-z-defs = yes 894reldep4mod2.so-no-z-defs = yes 895ltglobmod2.so-no-z-defs = yes 896dblloadmod3.so-no-z-defs = yes 897tst-tlsmod1.so-no-z-defs = yes 898tst-tlsmod2.so-no-z-defs = yes 899tst-tlsmod3.so-no-z-defs = yes 900tst-tlsmod4.so-no-z-defs = yes 901tst-tlsmod7.so-no-z-defs = yes 902tst-tlsmod8.so-no-z-defs = yes 903tst-tlsmod9.so-no-z-defs = yes 904tst-tlsmod10.so-no-z-defs = yes 905tst-tlsmod12.so-no-z-defs = yes 906tst-tlsmod14a.so-no-z-defs = yes 907tst-tlsmod14b.so-no-z-defs = yes 908tst-tlsmod15a.so-no-z-defs = yes 909tst-tlsmod16b.so-no-z-defs = yes 910circlemod2.so-no-z-defs = yes 911circlemod3.so-no-z-defs = yes 912circlemod3a.so-no-z-defs = yes 913reldep8mod2.so-no-z-defs = yes 914reldep9mod1.so-no-z-defs = yes 915unload3mod4.so-no-z-defs = yes 916unload4mod1.so-no-z-defs = yes 917ifuncmod1.so-no-z-defs = yes 918ifuncmod5.so-no-z-defs = yes 919ifuncmod6.so-no-z-defs = yes 920tst-auditmod9a.so-no-z-defs = yes 921tst-auditmod9b.so-no-z-defs = yes 922tst-nodelete-uniquemod.so-no-z-defs = yes 923tst-nodelete-rtldmod.so-no-z-defs = yes 924tst-nodelete-zmod.so-no-z-defs = yes 925tst-nodelete2mod.so-no-z-defs = yes 926 927ifeq ($(build-shared),yes) 928# Build all the modules even when not actually running test programs. 929tests: $(test-modules) 930endif 931 932LDFLAGS-loadtest = -rdynamic 933 934$(objpfx)loadtest.out: $(test-modules) 935 936$(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ 937 $(objpfx)neededobj3.so 938 939$(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ 940 $(objpfx)neededobj3.so 941 942$(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ 943 $(objpfx)neededobj3.so $(objpfx)neededobj4.so 944 945$(objpfx)neededtest4: $(objpfx)neededobj1.so 946$(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so 947 948$(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so 949LDFLAGS-restest1 = -rdynamic 950 951LDFLAGS-restest2 = -rdynamic 952 953$(objpfx)restest1.out: $(test-modules) 954 955preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5 956$(objpfx)preloadtest: $(objpfx)testobj6.so 957LDFLAGS-preloadtest = -rdynamic 958$(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so) 959preloadtest-ENV = \ 960 LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so))) 961 962LDFLAGS-loadfail = -rdynamic 963 964$(objpfx)loadfail.out: $(objpfx)failobj.so 965 966LDFLAGS-multiload = -rdynamic 967CFLAGS-multiload.c += -DOBJDIR=\"$(elf-objpfx)\" 968 969$(objpfx)multiload.out: $(objpfx)testobj1.so 970 971LDFLAGS-origtest = -rdynamic 972$(objpfx)origtest.out: $(objpfx)testobj1.so 973 974ifeq ($(have-thread-library),yes) 975$(objpfx)resolvfail: $(shared-thread-library) 976endif 977 978$(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so 979 980$(objpfx)circleload1.out: $(objpfx)circlemod1.so \ 981 $(objpfx)circlemod1a.so 982 983$(objpfx)circlemod1.so: $(objpfx)circlemod2.so 984$(objpfx)circlemod2.so: $(objpfx)circlemod3.so 985$(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so 986$(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so 987 988$(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so) 989 990$(objpfx)order-cmp.out: $(objpfx)order.out 991 (echo "0123456789" | cmp $< -) > $@; \ 992 $(evaluate-test) 993 994$(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so) 995$(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so) 996vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so) 997 998$(objpfx)noload: $(objpfx)testobj1.so 999LDFLAGS-noload = -rdynamic -Wl,--no-as-needed 1000$(objpfx)noload.out: $(objpfx)testobj5.so 1001 1002$(objpfx)noload-mem.out: $(objpfx)noload.out 1003 $(common-objpfx)malloc/mtrace $(objpfx)noload.mtrace > $@; \ 1004 $(evaluate-test) 1005noload-ENV = MALLOC_TRACE=$(objpfx)noload.mtrace \ 1006 LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so 1007 1008LDFLAGS-nodelete = -rdynamic 1009LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete 1010LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete 1011$(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \ 1012 $(objpfx)nodelmod3.so 1013 1014LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen 1015$(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so 1016 1017$(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so 1018$(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so 1019 1020$(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so 1021 $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \ 1022 -L$(subst :, -L,$(rpath-link)) \ 1023 -Wl,-rpath-link=$(rpath-link) \ 1024 $< -Wl,-F,$(objpfx)filtmod2.so 1025$(objpfx)filter: $(objpfx)filtmod1.so 1026 1027# This does not link against libc. 1028CFLAGS-filtmod1.c += $(no-stack-protector) 1029 1030$(objpfx)unload.out: $(objpfx)unloadmod.so 1031 1032$(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so 1033 1034$(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so 1035 1036$(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so 1037 1038$(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so 1039 1040$(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so 1041LDFLAGS-next = -Wl,--no-as-needed 1042 1043$(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so 1044 1045$(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so 1046 1047$(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \ 1048 $(objpfx)pathoptobj.so 1049 $(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' \ 1050 '$(run-program-env)'; \ 1051 $(evaluate-test) 1052 1053$(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so 1054 $(SHELL) $^ '$(test-wrapper)' '$(test-wrapper-env)' > $@; \ 1055 $(evaluate-test) 1056 1057tst-rtld-preload-OBJS = $(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so))) 1058$(objpfx)tst-rtld-preload.out: tst-rtld-preload.sh $(objpfx)ld.so \ 1059 $(objpfx)preloadtest \ 1060 $(preloadtest-preloads:%=$(objpfx)%.so) 1061 $(SHELL) $< $(objpfx)ld.so $(objpfx)preloadtest \ 1062 '$(test-wrapper-env)' '$(run_program_env)' \ 1063 '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@; \ 1064 $(evaluate-test) 1065 1066$(objpfx)initfirst.out: $(objpfx)firstobj.so 1067 1068$(objpfx)global: $(objpfx)globalmod1.so 1069$(objpfx)global.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so 1070 1071$(objpfx)dblload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so 1072 1073$(objpfx)dblunload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so 1074 1075$(objpfx)reldep5.out: $(objpfx)reldepmod5.so $(objpfx)reldepmod6.so 1076 1077$(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so 1078 1079$(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so 1080 1081$(objpfx)reldep8.out: $(objpfx)reldep8mod3.so 1082 1083LDFLAGS-nodel2mod2.so = -Wl,--enable-new-dtags,-z,nodelete 1084$(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so 1085 1086$(objpfx)reldep9.out: $(objpfx)reldep9mod3.so 1087 1088$(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so 1089 1090$(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so 1091 1092$(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so 1093 1094$(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so 1095 1096$(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so 1097 1098$(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so 1099 1100$(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so 1101 1102$(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so 1103 1104$(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so 1105 1106$(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so 1107 1108$(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so 1109 1110$(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so 1111$(objpfx)tst-tls14.out: $(objpfx)tst-tlsmod14b.so 1112 1113$(objpfx)tst-tls15.out: $(objpfx)tst-tlsmod15a.so $(objpfx)tst-tlsmod15b.so 1114 1115$(objpfx)tst-tls-dlinfo.out: $(objpfx)tst-tlsmod2.so 1116 1117 1118 1119$(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so 1120 1121$(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so 1122$(patsubst %,$(objpfx)%.os,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.os: tst-tlsmod17a.c 1123 $(compile-command.c) -DN=$* 1124$(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so 1125$(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules)) 1126 1127$(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)) 1128$(patsubst %,$(objpfx)%.os,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c 1129 $(compile-command.c) -DN=$* 1130$(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so 1131 1132$(objpfx)tst-tls19.out: $(objpfx)tst-tls19mod1.so 1133 1134CFLAGS-tst-align.c += $(stack-align-test-flags) 1135CFLAGS-tst-align2.c += $(stack-align-test-flags) 1136CFLAGS-tst-alignmod.c += $(stack-align-test-flags) 1137CFLAGS-tst-alignmod2.c += $(stack-align-test-flags) 1138$(objpfx)tst-align.out: $(objpfx)tst-alignmod.so 1139$(objpfx)tst-align2: $(objpfx)tst-alignmod2.so 1140$(objpfx)tst-align3: $(objpfx)tst-alignmod3.so 1141ifeq (yes,$(have-fpie)) 1142CFLAGS-tst-align3.c += $(PIE-ccflag) 1143endif 1144LDFLAGS-tst-align3 += -Wl,-z,max-page-size=0x200000 1145LDFLAGS-tst-alignmod3.so += -Wl,-z,max-page-size=0x200000 1146$(objpfx)tst-alignmod3.so: $(libsupport) 1147 1148$(objpfx)unload3.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \ 1149 $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so 1150 1151$(objpfx)unload4.out: $(objpfx)unload4mod1.so $(objpfx)unload4mod3.so 1152 1153$(objpfx)unload5.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \ 1154 $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so 1155 1156$(objpfx)unload6.out: $(objpfx)unload6mod1.so $(objpfx)unload6mod2.so \ 1157 $(objpfx)unload6mod3.so 1158 1159$(objpfx)unload7.out: $(objpfx)unload7mod1.so $(objpfx)unload7mod2.so 1160unload7-ENV = MALLOC_PERTURB_=85 1161 1162$(objpfx)unload8.out: $(objpfx)unload8mod1.so $(objpfx)unload8mod1x.so 1163 1164$(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so 1165 1166ifeq ($(have-z-execstack),yes) 1167$(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so 1168CPPFLAGS-tst-execstack.c += -DUSE_PTHREADS=0 1169LDFLAGS-tst-execstack = -Wl,-z,noexecstack 1170LDFLAGS-tst-execstack-mod.so = -Wl,-z,execstack 1171 1172$(objpfx)tst-execstack-needed: $(objpfx)tst-execstack-mod.so 1173LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack 1174 1175LDFLAGS-tst-execstack-prog = -Wl,-z,execstack 1176CFLAGS-tst-execstack-prog.c += -Wno-trampolines 1177CFLAGS-tst-execstack-mod.c += -Wno-trampolines 1178endif 1179 1180LDFLAGS-tst-array2 = -Wl,--no-as-needed 1181LDFLAGS-tst-array5 = -Wl,--no-as-needed 1182 1183$(objpfx)tst-array1-cmp.out: tst-array1.exp $(objpfx)tst-array1.out 1184 cmp $^ > $@; \ 1185 $(evaluate-test) 1186 1187$(objpfx)tst-array1-static-cmp.out: tst-array1.exp \ 1188 $(objpfx)tst-array1-static.out 1189 cmp $^ > $@; \ 1190 $(evaluate-test) 1191 1192$(objpfx)tst-array2: $(objpfx)tst-array2dep.so 1193$(objpfx)tst-array2-cmp.out: tst-array2.exp $(objpfx)tst-array2.out 1194 cmp $^ > $@; \ 1195 $(evaluate-test) 1196 1197$(objpfx)tst-array3-cmp.out: tst-array1.exp $(objpfx)tst-array3.out 1198 cmp $^ > $@; \ 1199 $(evaluate-test) 1200 1201$(objpfx)tst-array4.out: $(objpfx)tst-array2dep.so 1202$(objpfx)tst-array4-cmp.out: tst-array4.exp $(objpfx)tst-array4.out 1203 cmp $^ > $@; \ 1204 $(evaluate-test) 1205 1206$(objpfx)tst-array5: $(objpfx)tst-array5dep.so 1207$(objpfx)tst-array5-cmp.out: tst-array5.exp $(objpfx)tst-array5.out 1208 cmp $^ > $@; \ 1209 $(evaluate-test) 1210 1211$(objpfx)tst-array5-static-cmp.out: tst-array5-static.exp \ 1212 $(objpfx)tst-array5-static.out 1213 cmp $^ > $@; \ 1214 $(evaluate-test) 1215 1216CFLAGS-tst-pie1.c += $(pie-ccflag) 1217CFLAGS-tst-pie2.c += $(pie-ccflag) 1218 1219$(objpfx)tst-piemod1.so: $(libsupport) 1220$(objpfx)tst-pie1: $(objpfx)tst-piemod1.so 1221$(objpfx)tst-dlopen-pie.out: $(objpfx)tst-pie1 1222 1223ifeq (yes,$(build-shared)) 1224# NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with 1225# all-built-dso here. 1226all-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \ 1227 $(filter-out $(common-objpfx)linkobj/libc.so, \ 1228 $(sort $(wildcard $(addprefix $(common-objpfx), \ 1229 */lib*.so \ 1230 iconvdata/*.so)))) 1231 1232$(all-built-dso:=.dyn): %.dyn: % 1233 @rm -f $@T 1234 LC_ALL=C $(READELF) -W -d $< > $@T 1235 test -s $@T 1236 mv -f $@T $@ 1237common-generated += $(all-built-dso:$(common-objpfx)%=%.dyn) 1238 1239$(objpfx)check-textrel.out: $(..)scripts/check-textrel.awk \ 1240 $(all-built-dso:=.dyn) 1241 LC_ALL=C $(AWK) -f $^ > $@; \ 1242 $(evaluate-test) 1243generated += check-textrel.out 1244 1245$(objpfx)execstack-default: $(first-word $(wildcard $(sysdirs:%=%/stackinfo.h))) 1246 $(make-target-directory) 1247 { echo '#include <elf.h>'; \ 1248 echo '#include <stackinfo.h>'; \ 1249 echo '#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \ 1250 echo '@@@execstack-no@@@'; \ 1251 echo '#else'; \ 1252 echo '@@@execstack-yes@@@'; \ 1253 echo '#endif'; } | \ 1254 $(CC) $(CFLAGS) $(CPPFLAGS) -E -x c-header - | \ 1255 sed -n -e 's/^@@@\(.*\)@@@/\1/p' > $@T 1256 mv -f $@T $@ 1257generated += execstack-default 1258 1259$(all-built-dso:=.phdr): %.phdr: % 1260 @rm -f $@T 1261 LC_ALL=C $(READELF) -W -l $< > $@T 1262 test -s $@T 1263 mv -f $@T $@ 1264common-generated += $(all-built-dso:$(common-objpfx)%=%.phdr) 1265 1266$(objpfx)check-execstack.out: $(..)scripts/check-execstack.awk \ 1267 $(objpfx)execstack-default \ 1268 $(all-built-dso:=.phdr) 1269 LC_ALL=C $(AWK) -v "xfail=$(check-execstack-xfail)" -f $^ > $@; \ 1270 $(evaluate-test) 1271generated += check-execstack.out 1272 1273$(objpfx)check-wx-segment.out: $(..)scripts/check-wx-segment.py \ 1274 $(all-built-dso:=.phdr) 1275 $(PYTHON) $^ --xfail="$(check-wx-segment-xfail)" > $@; \ 1276 $(evaluate-test) 1277generated += check-wx-segment.out 1278 1279$(objpfx)tst-dlmodcount.out: $(test-modules) 1280 1281$(all-built-dso:=.jmprel): %.jmprel: % Makefile 1282 @rm -f $@T 1283 LC_ALL=C $(READELF) -W -S -d -r $< > $@T 1284 test -s $@T 1285 mv -f $@T $@ 1286common-generated += $(all-built-dso:$(common-objpfx)%=%.jmprel) 1287 1288localplt-built-dso := $(addprefix $(common-objpfx),\ 1289 libc.so \ 1290 elf/ld.so \ 1291 math/libm.so \ 1292 dlfcn/libdl.so \ 1293 resolv/libresolv.so \ 1294 ) 1295ifeq ($(build-mathvec),yes) 1296localplt-built-dso += $(addprefix $(common-objpfx), mathvec/libmvec.so) 1297endif 1298ifeq ($(have-thread-library),yes) 1299localplt-built-dso += $(filter-out %_nonshared.a, $(shared-thread-library)) 1300endif 1301ifeq ($(build-crypt),yes) 1302localplt-built-dso += $(addprefix $(common-objpfx), crypt/libcrypt.so) 1303endif 1304ifneq ($(pthread-in-libc),yes) 1305localplt-built-dso += $(addprefix $(common-objpfx), rt/librt.so) 1306endif 1307 1308vpath localplt.data $(+sysdep_dirs) 1309 1310$(objpfx)check-localplt.out: $(..)scripts/check-localplt.awk \ 1311 $(..)scripts/localplt.awk \ 1312 $(localplt-built-dso:=.jmprel) \ 1313 localplt.data 1314 LC_ALL=C $(AWK) -f $(filter-out $< %localplt.data,$^) | \ 1315 LC_ALL=C $(AWK) -f $< $(filter %localplt.data,$^) - \ 1316 > $@; \ 1317 $(evaluate-test) 1318endif 1319 1320$(all-built-dso:=.dynsym): %.dynsym: % 1321 @rm -f $@T 1322 LC_ALL=C $(READELF) -W --dyn-syms $< > $@T 1323 test -s $@T 1324 mv -f $@T $@ 1325common-generated += $(all-built-dso:$(common-objpfx)%=%.dynsym) 1326 1327$(objpfx)check-initfini.out: $(..)scripts/check-initfini.awk \ 1328 $(all-built-dso:=.dynsym) 1329 LC_ALL=C $(AWK) -f $^ > $@; \ 1330 $(evaluate-test) 1331generated += check-initfini.out 1332 1333$(objpfx)tst-dlopenrpath: $(objpfx)tst-dlopenrpathmod.so 1334CFLAGS-tst-dlopenrpath.c += -DPFX=\"$(objpfx)\" 1335LDFLAGS-tst-dlopenrpathmod.so += -Wl,-rpath,\$$ORIGIN/test-subdir 1336$(objpfx)tst-dlopenrpath.out: $(objpfx)firstobj.so 1337 1338$(objpfx)tst-deep1mod2.so: $(objpfx)tst-deep1mod3.so 1339$(objpfx)tst-deep1: $(objpfx)tst-deep1mod1.so 1340$(objpfx)tst-deep1.out: $(objpfx)tst-deep1mod2.so 1341LDFLAGS-tst-deep1 += -rdynamic 1342tst-deep1mod3.so-no-z-defs = yes 1343 1344$(objpfx)tst-dlmopen1.out: $(objpfx)tst-dlmopen1mod.so 1345 1346$(objpfx)tst-dlmopen2.out: $(objpfx)tst-dlmopen1mod.so 1347 1348$(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so 1349 1350$(objpfx)tst-dlmopen4.out: $(objpfx)tst-dlmopen1mod.so 1351 1352$(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so 1353tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so 1354 1355$(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so $(objpfx)tst-auditmod9b.so 1356# Prevent GCC-5 from translating a malloc/memset pair into calloc 1357CFLAGS-tst-audit2.c += -fno-builtin 1358tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so 1359 1360$(objpfx)tst-audit9.out: $(objpfx)tst-auditmod9a.so $(objpfx)tst-auditmod9b.so 1361tst-audit9-ENV = LD_AUDIT=$(objpfx)tst-auditmod9a.so 1362 1363$(objpfx)tst-audit8: $(libm) 1364$(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so 1365tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so 1366 1367$(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so 1368 1369$(objpfx)order2.out: $(objpfx)order2mod1.so $(objpfx)order2mod2.so 1370$(objpfx)order2-cmp.out: $(objpfx)order2.out 1371 (echo "12345" | cmp $< -) > $@; \ 1372 $(evaluate-test) 1373$(objpfx)order2mod1.so: $(objpfx)order2mod4.so 1374$(objpfx)order2mod4.so: $(objpfx)order2mod3.so 1375$(objpfx)order2mod2.so: $(objpfx)order2mod3.so 1376order2mod2.so-no-z-defs = yes 1377LDFLAGS-order2mod1.so = -Wl,--no-as-needed 1378LDFLAGS-order2mod2.so = -Wl,--no-as-needed 1379 1380tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child" 1381tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child" 1382 1383tst-ptrguard1-ARGS = --command "$(host-test-program-cmd) --child" 1384# When built statically, the pointer guard interface uses 1385# __pointer_chk_guard_local. 1386CFLAGS-tst-ptrguard1-static.c += -DPTRGUARD_LOCAL 1387tst-ptrguard1-static-ARGS = --command "$(objpfx)tst-ptrguard1-static --child" 1388 1389$(objpfx)tst-leaks1-mem.out: $(objpfx)tst-leaks1.out 1390 $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@; \ 1391 $(evaluate-test) 1392 1393tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace \ 1394 LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so 1395 1396$(objpfx)tst-thrlock: $(shared-thread-library) 1397$(objpfx)tst-thrlock.out: $(libm) 1398$(objpfx)tst-noload.out: $(libm) 1399 1400tst-tst-dlopen-tlsmodid-no-pie = yes 1401$(objpfx)tst-dlopen-tlsmodid: $(shared-thread-library) 1402$(objpfx)tst-dlopen-tlsmodid.out: $(objpfx)tst-dlopen-self 1403CFLAGS-tst-dlopen-tlsmodid-pie.c += $(pie-ccflag) 1404$(objpfx)tst-dlopen-tlsmodid-pie: $(shared-thread-library) 1405$(objpfx)tst-dlopen-tlsmodid-pie.out: $(objpfx)tst-dlopen-self-pie 1406$(objpfx)tst-dlopen-tlsmodid-container: $(shared-thread-library) 1407LDFLAGS-tst-dlopen-tlsmodid-container += -Wl,-rpath,\$$ORIGIN 1408 1409tst-tst-dlopen-self-no-pie = yes 1410CFLAGS-tst-dlopen-self-pie.c += $(pie-ccflag) 1411LDFLAGS-tst-dlopen-self-container += -Wl,-rpath,\$$ORIGIN 1412 1413CFLAGS-ifuncmain1pic.c += $(pic-ccflag) 1414CFLAGS-ifuncmain1picstatic.c += $(pic-ccflag) 1415CFLAGS-ifuncmain1staticpic.c += $(pic-ccflag) 1416CFLAGS-ifuncdep1pic.c += $(pic-ccflag) 1417CFLAGS-ifuncmain1vispic.c += $(pic-ccflag) 1418CFLAGS-ifuncmain2pic.c += $(pic-ccflag) 1419CFLAGS-ifuncmain2picstatic.c += $(pic-ccflag) 1420CFLAGS-ifuncdep2pic.c += $(pic-ccflag) 1421CFLAGS-ifuncmain4picstatic.c += $(pic-ccflag) 1422CFLAGS-ifuncmain5pic.c += $(pic-ccflag) 1423CFLAGS-ifuncmain5picstatic.c += $(pic-ccflag) 1424CFLAGS-ifuncmain5staticpic.c += $(pic-ccflag) 1425CFLAGS-ifuncdep5pic.c += $(pic-ccflag) 1426CFLAGS-ifuncmain7pic.c += $(pic-ccflag) 1427CFLAGS-ifuncmain7picstatic.c += $(pic-ccflag) 1428CFLAGS-ifuncmain9pic.c += $(pic-ccflag) 1429CFLAGS-ifuncmain9picstatic.c += $(pic-ccflag) 1430 1431LDFLAGS-ifuncmain3 = -Wl,-export-dynamic 1432 1433CFLAGS-ifuncmain1pie.c += $(pie-ccflag) 1434CFLAGS-ifuncmain1vispie.c += $(pie-ccflag) 1435CFLAGS-ifuncmain1staticpie.c += $(pie-ccflag) 1436CFLAGS-ifuncmain5pie.c += $(pie-ccflag) 1437CFLAGS-ifuncmain6pie.c += $(pie-ccflag) 1438CFLAGS-ifuncmain7pie.c += $(pie-ccflag) 1439CFLAGS-ifuncmain9pie.c += $(pie-ccflag) 1440CFLAGS-tst-ifunc-textrel.c += $(pic-ccflag) 1441 1442LDFLAGS-ifuncmain6pie = -Wl,-z,lazy 1443 1444$(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so 1445$(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o 1446$(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so 1447$(objpfx)ifuncmain5pie: $(objpfx)ifuncmod5.so 1448$(objpfx)ifuncmain6pie: $(objpfx)ifuncmod6.so 1449 1450$(objpfx)ifuncmain1: $(addprefix $(objpfx),ifuncmod1.so) 1451$(objpfx)ifuncmain1pic: $(addprefix $(objpfx),ifuncmod1.so) 1452$(objpfx)ifuncmain1staticpic: $(addprefix $(objpfx),ifuncdep1pic.o) 1453$(objpfx)ifuncmain1static: $(addprefix $(objpfx),ifuncdep1.o) 1454$(objpfx)ifuncmain1picstatic: $(addprefix $(objpfx),ifuncdep1pic.o) 1455$(objpfx)ifuncmain1vis: $(addprefix $(objpfx),ifuncmod1.so) 1456$(objpfx)ifuncmain1vispic: $(addprefix $(objpfx),ifuncmod1.so) 1457$(objpfx)ifuncmain2: $(addprefix $(objpfx),ifuncdep2.o) 1458$(objpfx)ifuncmain2pic: $(addprefix $(objpfx),ifuncdep2pic.o) 1459$(objpfx)ifuncmain2static: $(addprefix $(objpfx),ifuncdep2.o) 1460$(objpfx)ifuncmain2picstatic: $(addprefix $(objpfx),ifuncdep2pic.o) 1461 1462$(objpfx)ifuncmain3.out: $(objpfx)ifuncmod3.so 1463 1464$(objpfx)ifuncmain5: $(addprefix $(objpfx),ifuncmod5.so) 1465$(objpfx)ifuncmain5pic: $(addprefix $(objpfx),ifuncmod5.so) 1466$(objpfx)ifuncmain5static: $(addprefix $(objpfx),ifuncdep5.o) 1467$(objpfx)ifuncmain5staticpic: $(addprefix $(objpfx),ifuncdep5pic.o) 1468$(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o) 1469 1470LDFLAGS-tst-ifunc-fault-lazy = -Wl,-z,lazy 1471LDFLAGS-tst-ifunc-fault-bindnow = -Wl,-z,now 1472define tst-ifunc-fault-script 1473( $(test-wrapper) $(rtld-prefix) --verify $^ \ 1474 && $(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 $(rtld-prefix) $^ \ 1475 && $(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 LD_DEBUG=unused \ 1476 $(rtld-prefix) $^ \ 1477) > $@; $(evaluate-test) 1478endef 1479$(objpfx)tst-ifunc-fault-lazy.out: $(objpfx)tst-ifunc-fault-lazy $(objpfx)ld.so 1480 $(tst-ifunc-fault-script) 1481$(objpfx)tst-ifunc-fault-bindnow.out: $(objpfx)tst-ifunc-fault-bindnow \ 1482 $(objpfx)ld.so 1483 $(tst-ifunc-fault-script) 1484 1485$(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \ 1486 $(objpfx)tst-unique1mod2.so 1487 1488$(objpfx)tst-unique2: $(objpfx)tst-unique2mod1.so 1489$(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so 1490 1491$(objpfx)tst-unique3: $(objpfx)tst-unique3lib.so 1492$(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so 1493 1494$(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so 1495 1496$(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \ 1497 $(objpfx)tst-nodelete-rtldmod.so \ 1498 $(objpfx)tst-nodelete-zmod.so 1499 1500LDFLAGS-tst-nodelete = -rdynamic 1501LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete 1502 1503$(objpfx)tst-nodelete2.out: $(objpfx)tst-nodelete2mod.so 1504 1505LDFLAGS-tst-nodelete2 = -rdynamic 1506 1507$(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out 1508 cmp $^ > $@; \ 1509 $(evaluate-test) 1510 1511$(objpfx)tst-initorder2: $(objpfx)tst-initorder2a.so $(objpfx)tst-initorder2d.so $(objpfx)tst-initorder2c.so 1512$(objpfx)tst-initorder2a.so: $(objpfx)tst-initorder2b.so 1513$(objpfx)tst-initorder2b.so: $(objpfx)tst-initorder2c.so 1514$(objpfx)tst-initorder2c.so: $(objpfx)tst-initorder2d.so 1515LDFLAGS-tst-initorder2 = -Wl,--no-as-needed 1516LDFLAGS-tst-initorder2a.so = -Wl,--no-as-needed 1517LDFLAGS-tst-initorder2b.so = -Wl,--no-as-needed 1518LDFLAGS-tst-initorder2c.so = -Wl,--no-as-needed 1519define o-iterator-doit 1520$(objpfx)tst-initorder2$o.os: tst-initorder2.c; \ 1521$$(compile-command.c) -DNAME=\"$o\" 1522endef 1523object-suffixes-left := a b c d 1524include $(o-iterator) 1525 1526$(objpfx)tst-initorder2-cmp.out: tst-initorder2.exp $(objpfx)tst-initorder2.out 1527 cmp $^ > $@; \ 1528 $(evaluate-test) 1529 1530$(objpfx)tst-relsort1mod1.so: $(libm) $(objpfx)tst-relsort1mod2.so 1531$(objpfx)tst-relsort1mod2.so: $(libm) 1532$(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \ 1533 $(objpfx)tst-relsort1mod2.so 1534 1535$(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so 1536 $(test-wrapper-env) \ 1537 LD_TRACE_LOADED_OBJECTS=1 \ 1538 LD_DEBUG=unused \ 1539 LD_PRELOAD= \ 1540 $(rtld-prefix) \ 1541 $< > $@; \ 1542 $(evaluate-test) 1543 1544$(objpfx)tst-unused-dep-cmp.out: $(objpfx)tst-unused-dep.out 1545 cmp $< /dev/null > $@; \ 1546 $(evaluate-test) 1547 1548$(objpfx)tst-audit11.out: $(objpfx)tst-auditmod11.so $(objpfx)tst-audit11mod1.so 1549tst-audit11-ENV = LD_AUDIT=$(objpfx)tst-auditmod11.so 1550$(objpfx)tst-audit11mod1.so: $(objpfx)tst-audit11mod2.so 1551LDFLAGS-tst-audit11mod2.so = -Wl,--version-script=tst-audit11mod2.map,-soname,tst-audit11mod2.so 1552 1553$(objpfx)tst-audit12.out: $(objpfx)tst-auditmod12.so $(objpfx)tst-audit12mod1.so $(objpfx)tst-audit12mod3.so 1554tst-audit12-ENV = LD_AUDIT=$(objpfx)tst-auditmod12.so 1555$(objpfx)tst-audit12mod1.so: $(objpfx)tst-audit12mod2.so 1556LDFLAGS-tst-audit12mod2.so = -Wl,--version-script=tst-audit12mod2.map 1557 1558$(objpfx)tst-audit13.out: $(objpfx)tst-audit13mod1.so 1559LDFLAGS-tst-audit13mod1.so = -Wl,-z,lazy 1560tst-audit13-ENV = LD_AUDIT=$(objpfx)tst-audit13mod1.so 1561 1562$(objpfx)tst-auditmany.out: $(objpfx)tst-auditmanymod1.so \ 1563 $(objpfx)tst-auditmanymod2.so $(objpfx)tst-auditmanymod3.so \ 1564 $(objpfx)tst-auditmanymod4.so $(objpfx)tst-auditmanymod5.so \ 1565 $(objpfx)tst-auditmanymod6.so $(objpfx)tst-auditmanymod7.so \ 1566 $(objpfx)tst-auditmanymod8.so $(objpfx)tst-auditmanymod9.so 1567tst-auditmany-ENV = \ 1568 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 1569 1570LDFLAGS-tst-audit14 = -Wl,--audit=tst-auditlogmod-1.so 1571$(objpfx)tst-auditlogmod-1.so: $(libsupport) 1572$(objpfx)tst-audit14.out: $(objpfx)tst-auditlogmod-1.so 1573LDFLAGS-tst-audit15 = \ 1574 -Wl,--audit=tst-auditlogmod-1.so,--depaudit=tst-auditlogmod-2.so 1575$(objpfx)tst-auditlogmod-2.so: $(libsupport) 1576$(objpfx)tst-audit15.out: \ 1577 $(objpfx)tst-auditlogmod-1.so $(objpfx)tst-auditlogmod-2.so 1578LDFLAGS-tst-audit16 = \ 1579 -Wl,--audit=tst-auditlogmod-1.so:tst-auditlogmod-2.so \ 1580 -Wl,--depaudit=tst-auditlogmod-3.so 1581$(objpfx)tst-auditlogmod-3.so: $(libsupport) 1582$(objpfx)tst-audit16.out: \ 1583 $(objpfx)tst-auditlogmod-1.so $(objpfx)tst-auditlogmod-2.so \ 1584 $(objpfx)tst-auditlogmod-3.so 1585$(objpfx)tst-audit17.out: $(objpfx)tst-auditmod17.so 1586# The test check if a audit library without libc.so on DT_NEEDED works as 1587# intended, so it uses an explicit link rule. 1588$(objpfx)tst-auditmod17.so: $(objpfx)tst-auditmod17.os 1589 $(CC) -nostdlib -nostartfiles -shared -o $@.new \ 1590 $(filter-out $(map-file),$^) 1591 $(call after-link,$@.new) 1592 mv -f $@.new $@ 1593CFLAGS-.os += $(call elide-stack-protector,.os,tst-auditmod17) 1594tst-audit17-ENV = LD_AUDIT=$(objpfx)tst-auditmod17.so 1595 1596$(objpfx)tst-audit14-cmp.out: tst-audit14.exp $(objpfx)tst-audit14.out 1597 cmp $^ > $@; \ 1598 $(evaluate-test) 1599$(objpfx)tst-audit15-cmp.out: tst-audit15.exp $(objpfx)tst-audit15.out 1600 cmp $^ > $@; \ 1601 $(evaluate-test) 1602$(objpfx)tst-audit16-cmp.out: tst-audit16.exp $(objpfx)tst-audit16.out 1603 cmp $^ > $@; \ 1604 $(evaluate-test) 1605 1606$(objpfx)tst-audit18.out: $(objpfx)tst-auditmod18.so \ 1607 $(objpfx)tst-audit18mod.so 1608tst-audit18-ARGS = -- $(host-test-program-cmd) 1609 1610$(objpfx)tst-audit19a.out: $(objpfx)tst-auditmod19a.so 1611tst-audit19a-ENV = LD_AUDIT=$(objpfx)tst-auditmod19a.so 1612 1613$(objpfx)tst-audit19b.out: $(objpfx)tst-auditmod19b.so 1614$(objpfx)tst-audit19b: $(objpfx)tst-audit19bmod.so 1615tst-audit19b-ARGS = -- $(host-test-program-cmd) 1616 1617$(objpfx)tst-audit20.out: $(objpfx)tst-auditmod20.so 1618tst-audit20-ENV = LD_AUDIT=$(objpfx)tst-auditmod20.so 1619 1620$(objpfx)tst-audit22.out: $(objpfx)tst-auditmod22.so 1621tst-audit22-ARGS = -- $(host-test-program-cmd) 1622 1623# tst-sonamemove links against an older implementation of the library. 1624LDFLAGS-tst-sonamemove-linkmod1.so = \ 1625 -Wl,--version-script=tst-sonamemove-linkmod1.map \ 1626 -Wl,-soname,tst-sonamemove-runmod1.so 1627LDFLAGS-tst-sonamemove-runmod1.so = -Wl,--no-as-needed \ 1628 -Wl,--version-script=tst-sonamemove-runmod1.map \ 1629 -Wl,-soname,tst-sonamemove-runmod1.so 1630LDFLAGS-tst-sonamemove-runmod2.so = \ 1631 -Wl,--version-script=tst-sonamemove-runmod2.map \ 1632 -Wl,-soname,tst-sonamemove-runmod2.so 1633$(objpfx)tst-sonamemove-runmod1.so: $(objpfx)tst-sonamemove-runmod2.so 1634# Link against the link module, but depend on the run-time modules 1635# for execution. 1636$(objpfx)tst-sonamemove-link: $(objpfx)tst-sonamemove-linkmod1.so 1637$(objpfx)tst-sonamemove-link.out: \ 1638 $(objpfx)tst-sonamemove-runmod1.so \ 1639 $(objpfx)tst-sonamemove-runmod2.so 1640$(objpfx)tst-sonamemove-dlopen.out: \ 1641 $(objpfx)tst-sonamemove-runmod1.so \ 1642 $(objpfx)tst-sonamemove-runmod2.so 1643 1644$(objpfx)tst-dlmopen-dlerror-mod.so: $(libsupport) 1645$(objpfx)tst-dlmopen-dlerror.out: $(objpfx)tst-dlmopen-dlerror-mod.so 1646 1647# Override -z defs, so that we can reference an undefined symbol. 1648# Force lazy binding for the same reason. 1649LDFLAGS-tst-latepthreadmod.so = \ 1650 -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all 1651# Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for 1652# function this_function_is_not_defined. 1653CFLAGS-tst-latepthreadmod.c += -fno-optimize-sibling-calls 1654$(objpfx)tst-latepthreadmod.so: $(shared-thread-library) 1655$(objpfx)tst-latepthread.out: $(objpfx)tst-latepthreadmod.so 1656 1657# The test modules are parameterized by preprocessor macros. 1658$(patsubst %,$(objpfx)%.os,$(tst-tls-many-dynamic-modules)): \ 1659 $(objpfx)tst-tls-manydynamic%mod.os : tst-tls-manydynamicmod.c 1660 $(compile-command.c) \ 1661 -DNAME=tls_global_$* -DSETTER=set_value_$* -DGETTER=get_value_$* 1662$(objpfx)tst-tls-manydynamic: $(shared-thread-library) 1663$(objpfx)tst-tls-manydynamic.out: \ 1664 $(patsubst %,$(objpfx)%.so,$(tst-tls-many-dynamic-modules)) 1665 1666tst-prelink-ENV = LD_TRACE_PRELINKING=1 1667 1668$(objpfx)tst-prelink-conflict.out: $(objpfx)tst-prelink.out 1669 grep stdout $< | grep conflict | $(AWK) '{ print $$10, $$11 }' > $@ 1670 1671$(objpfx)tst-prelink-cmp.out: $(objpfx)tst-prelink-conflict.out 1672 1673$(objpfx)tst-ldconfig-X.out : tst-ldconfig-X.sh $(objpfx)ldconfig 1674 $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' \ 1675 '$(run-program-env)' > $@; \ 1676 $(evaluate-test) 1677 1678# Test static linking of all the libraries we can possibly link 1679# together. Note that in some configurations this may be less than the 1680# complete list of libraries we build but we try to maxmimize this list. 1681$(objpfx)tst-linkall-static: \ 1682 $(common-objpfx)math/libm.a \ 1683 $(common-objpfx)resolv/libresolv.a \ 1684 $(common-objpfx)login/libutil.a \ 1685 $(common-objpfx)rt/librt.a \ 1686 $(common-objpfx)resolv/libanl.a \ 1687 $(static-thread-library) 1688 1689ifeq ($(build-crypt),yes) 1690# If we are using NSS crypto and we have the ability to link statically 1691# then we include libcrypt.a, otherwise we leave out libcrypt.a and 1692# link as much as we can into the tst-linkall-static test. This assumes 1693# that linking with libcrypt.a does everything required to include the 1694# static NSS crypto library. 1695ifeq (yesyes,$(nss-crypt)$(static-nss-crypt)) 1696$(objpfx)tst-linkall-static: \ 1697 $(common-objpfx)crypt/libcrypt.a 1698endif 1699# If we are not using NSS crypto then we always have the ability to link 1700# with libcrypt.a. 1701ifeq (no,$(nss-crypt)) 1702$(objpfx)tst-linkall-static: \ 1703 $(common-objpfx)crypt/libcrypt.a 1704endif 1705endif 1706 1707# The application depends on the DSO, and the DSO loads the plugin. 1708# The plugin also depends on the DSO. This creates the circular 1709# dependency via dlopen that we're testing to make sure works. 1710$(objpfx)tst-nodelete-dlclose-plugin.so: $(objpfx)tst-nodelete-dlclose-dso.so 1711$(objpfx)tst-nodelete-dlclose: $(objpfx)tst-nodelete-dlclose-dso.so 1712$(objpfx)tst-nodelete-dlclose.out: $(objpfx)tst-nodelete-dlclose-dso.so \ 1713 $(objpfx)tst-nodelete-dlclose-plugin.so 1714 1715tst-env-setuid-ENV = MALLOC_CHECK_=2 MALLOC_MMAP_THRESHOLD_=4096 \ 1716 LD_HWCAP_MASK=0x1 1717 1718$(objpfx)tst-debug1.out: $(objpfx)tst-debug1mod1.so 1719 1720$(objpfx)tst-debug1mod1.so: $(objpfx)testobj1.so 1721 $(OBJCOPY) --only-keep-debug $< $@ 1722 1723$(objpfx)tst-main1: $(objpfx)tst-main1mod.so 1724CRT-tst-main1 := $(csu-objpfx)crt1.o 1725tst-main1-no-pie = yes 1726LDLIBS-tst-main1 = $(libsupport) 1727tst-main1mod.so-no-z-defs = yes 1728 1729LDLIBS-tst-absolute-sym-lib.so = tst-absolute-sym-lib.lds 1730$(objpfx)tst-absolute-sym-lib.so: $(LDLIBS-tst-absolute-sym-lib.so) 1731$(objpfx)tst-absolute-sym: $(objpfx)tst-absolute-sym-lib.so 1732 1733LDLIBS-tst-absolute-zero-lib.so = tst-absolute-zero-lib.lds 1734$(objpfx)tst-absolute-zero-lib.so: $(LDLIBS-tst-absolute-zero-lib.so) 1735$(objpfx)tst-absolute-zero: $(objpfx)tst-absolute-zero-lib.so 1736 1737$(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so 1738# Avoid creating an ABI tag note, which may come before the 1739# artificial, large note in tst-big-note-lib.o and invalidate the 1740# test. 1741$(objpfx)tst-big-note-lib.so: $(objpfx)tst-big-note-lib.o 1742 $(LINK.o) -shared -o $@ $(LDFLAGS.so) $< 1743 1744$(objpfx)tst-unwind-ctor: $(objpfx)tst-unwind-ctor-lib.so 1745 1746CFLAGS-tst-unwind-main.c += -funwind-tables -DUSE_PTHREADS=0 1747 1748$(objpfx)tst-initfinilazyfail.out: \ 1749 $(objpfx)tst-initlazyfailmod.so $(objpfx)tst-finilazyfailmod.so 1750# Override -z defs, so that we can reference an undefined symbol. 1751# Force lazy binding for the same reason. 1752LDFLAGS-tst-initlazyfailmod.so = \ 1753 -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all 1754LDFLAGS-tst-finilazyfailmod.so = \ 1755 -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all 1756 1757$(objpfx)tst-dlopenfail.out: \ 1758 $(objpfx)tst-dlopenfailmod1.so $(objpfx)tst-dlopenfailmod2.so 1759# Order matters here. tst-dlopenfaillinkmod.so's soname ensures a 1760# run-time loader failure. --as-needed breaks this test because 1761# nothing actually references tst-dlopenfailmod2.so (with its soname 1762# tst-dlopenfail-missingmod.so). 1763LDFLAGS-tst-dlopenfailmod1.so = -Wl,--no-as-needed 1764$(objpfx)tst-dlopenfailmod1.so: \ 1765 $(shared-thread-library) $(objpfx)tst-dlopenfaillinkmod.so 1766LDFLAGS-tst-dlopenfaillinkmod.so = -Wl,-soname,tst-dlopenfail-missingmod.so 1767$(objpfx)tst-dlopenfailmod2.so: $(objpfx)tst-dlopenfailnodelmod.so 1768$(objpfx)tst-dlopenfail-2.out: \ 1769 $(objpfx)tst-dlopenfailmod1.so $(objpfx)tst-dlopenfailmod2.so \ 1770 $(objpfx)tst-dlopenfailmod3.so 1771# tst-dlopenfailnodelmod.so emulates how libpthread was linked. 1772$(objpfx)tst-dlopenfailnodelmod.so: $(libsupport) 1773LDFLAGS-tst-dlopenfailnodelmod.so = \ 1774 -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst 1775# tst-dlopenfail should export the libsupport symbols, so that 1776# tst-dlopenfailnodelmod.so uses them for error reporting. 1777LDFLAGS-tst-dlopenfail = -Wl,-E 1778 1779$(objpfx)tst-dlopen-nodelete-reloc.out: \ 1780 $(objpfx)tst-dlopen-nodelete-reloc-mod1.so \ 1781 $(objpfx)tst-dlopen-nodelete-reloc-mod2.so \ 1782 $(objpfx)tst-dlopen-nodelete-reloc-mod3.so \ 1783 $(objpfx)tst-dlopen-nodelete-reloc-mod4.so \ 1784 $(objpfx)tst-dlopen-nodelete-reloc-mod5.so \ 1785 $(objpfx)tst-dlopen-nodelete-reloc-mod6.so \ 1786 $(objpfx)tst-dlopen-nodelete-reloc-mod7.so \ 1787 $(objpfx)tst-dlopen-nodelete-reloc-mod8.so \ 1788 $(objpfx)tst-dlopen-nodelete-reloc-mod9.so \ 1789 $(objpfx)tst-dlopen-nodelete-reloc-mod10.so \ 1790 $(objpfx)tst-dlopen-nodelete-reloc-mod11.so \ 1791 $(objpfx)tst-dlopen-nodelete-reloc-mod12.so \ 1792 $(objpfx)tst-dlopen-nodelete-reloc-mod13.so \ 1793 $(objpfx)tst-dlopen-nodelete-reloc-mod14.so \ 1794 $(objpfx)tst-dlopen-nodelete-reloc-mod15.so \ 1795 $(objpfx)tst-dlopen-nodelete-reloc-mod16.so \ 1796 $(objpfx)tst-dlopen-nodelete-reloc-mod17.so 1797tst-dlopen-nodelete-reloc-mod2.so-no-z-defs = yes 1798LDFLAGS-tst-dlopen-nodelete-reloc-mod2.so = -Wl,-z,nodelete 1799$(objpfx)tst-dlopen-nodelete-reloc-mod4.so: \ 1800 $(objpfx)tst-dlopen-nodelete-reloc-mod3.so 1801LDFLAGS-tst-dlopen-nodelete-reloc-mod4.so = -Wl,--no-as-needed 1802$(objpfx)tst-dlopen-nodelete-reloc-mod5.so: \ 1803 $(objpfx)tst-dlopen-nodelete-reloc-mod4.so 1804LDFLAGS-tst-dlopen-nodelete-reloc-mod5.so = -Wl,-z,nodelete,--no-as-needed 1805tst-dlopen-nodelete-reloc-mod5.so-no-z-defs = yes 1806tst-dlopen-nodelete-reloc-mod7.so-no-z-defs = yes 1807tst-dlopen-nodelete-reloc-mod11.so-no-z-defs = yes 1808$(objpfx)tst-dlopen-nodelete-reloc-mod13.so: \ 1809 $(objpfx)tst-dlopen-nodelete-reloc-mod12.so 1810$(objpfx)tst-dlopen-nodelete-reloc-mod15.so: \ 1811 $(objpfx)tst-dlopen-nodelete-reloc-mod14.so 1812tst-dlopen-nodelete-reloc-mod16.so-no-z-defs = yes 1813$(objpfx)tst-dlopen-nodelete-reloc-mod16.so: \ 1814 $(objpfx)tst-dlopen-nodelete-reloc-mod15.so 1815LDFLAGS-tst-dlopen-nodelete-reloc-mod16.so = -Wl,--no-as-needed 1816$(objpfx)tst-dlopen-nodelete-reloc-mod17.so: \ 1817 $(objpfx)tst-dlopen-nodelete-reloc-mod15.so \ 1818 $(objpfx)tst-dlopen-nodelete-reloc-mod16.so 1819LDFLAGS-tst-dlopen-nodelete-reloc-mod17.so = -Wl,--no-as-needed 1820 1821$(objpfx)tst-ldconfig-ld_so_conf-update.out: $(objpfx)tst-ldconfig-ld-mod.so 1822 1823LDFLAGS-tst-filterobj-flt.so = -Wl,--filter=$(objpfx)tst-filterobj-filtee.so 1824$(objpfx)tst-filterobj: $(objpfx)tst-filterobj-flt.so 1825$(objpfx)tst-filterobj.out: $(objpfx)tst-filterobj-filtee.so 1826$(objpfx)tst-filterobj-dlopen.out: $(objpfx)tst-filterobj-filtee.so 1827 1828LDFLAGS-tst-filterobj-aux.so = -Wl,--auxiliary=$(objpfx)tst-filterobj-filtee.so 1829$(objpfx)tst-auxobj: $(objpfx)tst-filterobj-aux.so 1830$(objpfx)tst-auxobj.out: $(objpfx)tst-filterobj-filtee.so 1831$(objpfx)tst-auxobj-dlopen.out: $(objpfx)tst-filterobj-filtee.so 1832 1833$(objpfx)tst-single_threaded: $(objpfx)tst-single_threaded-mod1.so 1834$(objpfx)tst-single_threaded.out: \ 1835 $(objpfx)tst-single_threaded-mod2.so $(objpfx)tst-single_threaded-mod3.so 1836$(objpfx)tst-single_threaded-static-dlopen: \ 1837 $(objpfx)tst-single_threaded-mod1.o 1838$(objpfx)tst-single_threaded-static-dlopen.out: \ 1839 $(objpfx)tst-single_threaded-mod2.so 1840$(objpfx)tst-single_threaded-pthread: \ 1841 $(objpfx)tst-single_threaded-mod1.so $(shared-thread-library) 1842$(objpfx)tst-single_threaded-pthread.out: \ 1843 $(objpfx)tst-single_threaded-mod2.so $(objpfx)tst-single_threaded-mod3.so \ 1844 $(objpfx)tst-single_threaded-mod4.so 1845$(objpfx)tst-single_threaded-pthread-static: $(static-thread-library) 1846 1847$(objpfx)tst-tls-ie: $(shared-thread-library) 1848$(objpfx)tst-tls-ie.out: \ 1849 $(objpfx)tst-tls-ie-mod0.so \ 1850 $(objpfx)tst-tls-ie-mod1.so \ 1851 $(objpfx)tst-tls-ie-mod2.so \ 1852 $(objpfx)tst-tls-ie-mod3.so \ 1853 $(objpfx)tst-tls-ie-mod4.so \ 1854 $(objpfx)tst-tls-ie-mod5.so \ 1855 $(objpfx)tst-tls-ie-mod6.so 1856 1857$(objpfx)tst-tls-ie-dlmopen: $(shared-thread-library) 1858$(objpfx)tst-tls-ie-dlmopen.out: \ 1859 $(objpfx)tst-tls-ie-mod0.so \ 1860 $(objpfx)tst-tls-ie-mod1.so \ 1861 $(objpfx)tst-tls-ie-mod2.so \ 1862 $(objpfx)tst-tls-ie-mod3.so \ 1863 $(objpfx)tst-tls-ie-mod4.so \ 1864 $(objpfx)tst-tls-ie-mod5.so \ 1865 $(objpfx)tst-tls-ie-mod6.so 1866 1867$(objpfx)argv0test.out: tst-rtld-argv0.sh $(objpfx)ld.so \ 1868 $(objpfx)argv0test 1869 $(SHELL) $< $(objpfx)ld.so $(objpfx)argv0test \ 1870 '$(test-wrapper-env)' '$(run_program_env)' \ 1871 '$(rpath-link)' 'test-argv0' > $@; \ 1872 $(evaluate-test) 1873 1874# A list containing the name of the most likely searched subdirectory 1875# of the glibc-hwcaps directory, for each supported architecture (in 1876# other words, the oldest hardware level recognized by the 1877# glibc-hwcaps mechanism for this architecture). Used to obtain test 1878# coverage for some glibc-hwcaps tests for the widest possible range 1879# of systems. 1880glibc-hwcaps-first-subdirs-for-tests = power9 x86-64-v2 z13 1881 1882# The test modules are parameterized by preprocessor macros. 1883LDFLAGS-libmarkermod1-1.so += -Wl,-soname,libmarkermod1.so 1884LDFLAGS-libmarkermod2-1.so += -Wl,-soname,libmarkermod2.so 1885LDFLAGS-libmarkermod3-1.so += -Wl,-soname,libmarkermod3.so 1886LDFLAGS-libmarkermod4-1.so += -Wl,-soname,libmarkermod4.so 1887$(objpfx)libmarkermod%.os : markermodMARKER-VALUE.c 1888 $(compile-command.c) \ 1889 -DMARKER=marker$(firstword $(subst -, ,$*)) \ 1890 -DVALUE=$(lastword $(subst -, ,$*)) 1891$(objpfx)libmarkermod1.so: $(objpfx)libmarkermod1-1.so 1892 cp $< $@ 1893$(objpfx)libmarkermod2.so: $(objpfx)libmarkermod2-1.so 1894 cp $< $@ 1895$(objpfx)libmarkermod3.so: $(objpfx)libmarkermod3-1.so 1896 cp $< $@ 1897$(objpfx)libmarkermod4.so: $(objpfx)libmarkermod4-1.so 1898 cp $< $@ 1899 1900# tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is 1901# preferred over auto-detected subdirectories. 1902$(objpfx)tst-glibc-hwcaps-prepend: $(objpfx)libmarkermod1-1.so 1903$(objpfx)glibc-hwcaps/prepend-markermod1/libmarkermod1.so: \ 1904 $(objpfx)libmarkermod1-2.so 1905 $(make-target-directory) 1906 cp $< $@ 1907$(objpfx)glibc-hwcaps/%/libmarkermod1.so: $(objpfx)libmarkermod1-3.so 1908 $(make-target-directory) 1909 cp $< $@ 1910$(objpfx)tst-glibc-hwcaps-prepend.out: \ 1911 $(objpfx)tst-glibc-hwcaps-prepend $(objpfx)libmarkermod1.so \ 1912 $(patsubst %,$(objpfx)glibc-hwcaps/%/libmarkermod1.so,prepend-markermod1 \ 1913 $(glibc-hwcaps-first-subdirs-for-tests)) 1914 $(test-wrapper) $(rtld-prefix) \ 1915 --glibc-hwcaps-prepend prepend-markermod1 \ 1916 $< > $@; \ 1917 $(evaluate-test) 1918 1919# Like tst-glibc-hwcaps-prepend, but uses a container and loads the 1920# library via ld.so.cache. Test setup is contained in the test 1921# itself. 1922$(objpfx)tst-glibc-hwcaps-prepend-cache.out: \ 1923 $(objpfx)tst-glibc-hwcaps-prepend-cache $(objpfx)libmarkermod1-1.so \ 1924 $(objpfx)libmarkermod1-2.so $(objpfx)libmarkermod1-3.so 1925 1926# tst-glibc-hwcaps-mask checks that --glibc-hwcaps-mask can be used to 1927# suppress all auto-detected subdirectories. 1928$(objpfx)tst-glibc-hwcaps-mask: $(objpfx)libmarkermod1-1.so 1929$(objpfx)tst-glibc-hwcaps-mask.out: \ 1930 $(objpfx)tst-glibc-hwcaps-mask $(objpfx)libmarkermod1.so \ 1931 $(patsubst %,$(objpfx)glibc-hwcaps/%/libmarkermod1.so,\ 1932 $(glibc-hwcaps-first-subdirs-for-tests)) 1933 $(test-wrapper) $(rtld-prefix) \ 1934 --glibc-hwcaps-mask does-not-exist \ 1935 $< > $@; \ 1936 $(evaluate-test) 1937 1938# Generic dependency for sysdeps implementation of 1939# tst-glibc-hwcaps-cache. 1940$(objpfx)tst-glibc-hwcaps-cache.out: $(objpfx)tst-glibc-hwcaps 1941 1942$(objpfx)list-tunables.out: tst-rtld-list-tunables.sh $(objpfx)ld.so 1943 $(SHELL) $< $(objpfx)ld.so '$(test-wrapper-env)' \ 1944 '$(run_program_env)' > $(objpfx)/tst-rtld-list-tunables.out 1945 cmp tst-rtld-list-tunables.exp \ 1946 $(objpfx)/tst-rtld-list-tunables.out > $@; \ 1947 $(evaluate-test) 1948 1949tst-dst-static-ENV = LD_LIBRARY_PATH='$$ORIGIN' 1950 1951$(objpfx)tst-rtld-help.out: $(objpfx)ld.so 1952 $(test-wrapper) $(rtld-prefix) --help > $@; \ 1953 status=$$?; \ 1954 echo "info: ld.so exit status: $$status" >> $@; \ 1955 if ! grep -q 'Legacy HWCAP subdirectories under library search path directories' $@; then \ 1956 echo "error: missing subdirectory pattern" >> $@; \ 1957 if test $$status -eq 0; then \ 1958 status=1; \ 1959 fi; \ 1960 fi; \ 1961 (exit $$status); \ 1962 $(evaluate-test) 1963 1964# Reuses tst-tls-many-dynamic-modules 1965$(patsubst %,$(objpfx)%.os,$(tst-tls-many-dynamic-modules-dep)): \ 1966 $(objpfx)tst-tls-manydynamic%mod-dep.os : tst-tls-manydynamicmod.c 1967 $(compile-command.c) \ 1968 -DNAME=tls_global_$* -DSETTER=set_value_$* -DGETTER=get_value_$* 1969$(patsubst %,$(objpfx)%.os,$(tst-tls-many-dynamic-modules-dep-bad)): \ 1970 $(objpfx)tst-tls-manydynamic%mod-dep-bad.os : tst-tls-manydynamicmod.c 1971 $(compile-command.c) \ 1972 -DNAME=tls_global_$* -DSETTER=set_value_$* -DGETTER=get_value_$* 1973tst-tls20mod-bad.so-no-z-defs = yes 1974# Single dependency. 1975$(objpfx)tst-tls-manydynamic0mod-dep.so: $(objpfx)tst-tls-manydynamic1mod-dep.so 1976# Double dependencies. 1977$(objpfx)tst-tls-manydynamic2mod-dep.so: $(objpfx)tst-tls-manydynamic3mod-dep.so \ 1978 $(objpfx)tst-tls-manydynamic4mod-dep.so 1979# Double dependencies with each dependency depent of another module. 1980$(objpfx)tst-tls-manydynamic5mod-dep.so: $(objpfx)tst-tls-manydynamic6mod-dep.so \ 1981 $(objpfx)tst-tls-manydynamic7mod-dep.so 1982$(objpfx)tst-tls-manydynamic6mod-dep.so: $(objpfx)tst-tls-manydynamic8mod-dep.so 1983$(objpfx)tst-tls-manydynamic7mod-dep.so: $(objpfx)tst-tls-manydynamic8mod-dep.so 1984# Long chain with one double dependency in the middle 1985$(objpfx)tst-tls-manydynamic9mod-dep.so: $(objpfx)tst-tls-manydynamic10mod-dep.so \ 1986 $(objpfx)tst-tls-manydynamic11mod-dep.so 1987$(objpfx)tst-tls-manydynamic10mod-dep.so: $(objpfx)tst-tls-manydynamic12mod-dep.so 1988$(objpfx)tst-tls-manydynamic12mod-dep.so: $(objpfx)tst-tls-manydynamic13mod-dep.so 1989# Long chain with two double depedencies in the middle 1990$(objpfx)tst-tls-manydynamic14mod-dep.so: $(objpfx)tst-tls-manydynamic15mod-dep.so 1991$(objpfx)tst-tls-manydynamic15mod-dep.so: $(objpfx)tst-tls-manydynamic16mod-dep.so \ 1992 $(objpfx)tst-tls-manydynamic17mod-dep.so 1993$(objpfx)tst-tls-manydynamic16mod-dep.so: $(objpfx)tst-tls-manydynamic18mod-dep.so \ 1994 $(objpfx)tst-tls-manydynamic19mod-dep.so 1995# Same but with an invalid module. 1996# Single dependency. 1997$(objpfx)tst-tls-manydynamic0mod-dep-bad.so: $(objpfx)tst-tls20mod-bad.so 1998LDFLAGS-tst-tls-manydynamic0mod-dep-bad.so = -Wl,--no-as-needed 1999# Double dependencies. 2000$(objpfx)tst-tls-manydynamic1mod-dep-bad.so: $(objpfx)tst-tls-manydynamic2mod-dep-bad.so \ 2001 $(objpfx)tst-tls20mod-bad.so 2002LDFLAGS-tst-tls-manydynamic1mod-dep-bad.so = -Wl,--no-as-needed 2003# Double dependencies with each dependency depent of another module. 2004$(objpfx)tst-tls-manydynamic3mod-dep-bad.so: $(objpfx)tst-tls-manydynamic4mod-dep-bad.so \ 2005 $(objpfx)tst-tls-manydynamic5mod-dep-bad.so 2006LDFLAGS-tst-tls-manydynamic3mod-dep-bad.so = -Wl,--no-as-needed 2007$(objpfx)tst-tls-manydynamic4mod-dep-bad.so: $(objpfx)tst-tls20mod-bad.so 2008LDFLAGS-tst-tls-manydynamic4mod-dep-bad.so = -Wl,--no-as-needed 2009$(objpfx)tst-tls-manydynamic5mod-dep-bad.so: $(objpfx)tst-tls20mod-bad.so 2010LDFLAGS-tst-tls-manydynamic5mod-dep-bad.so = -Wl,--no-as-needed 2011# Long chain with one double dependency in the middle 2012$(objpfx)tst-tls-manydynamic6mod-dep-bad.so: $(objpfx)tst-tls-manydynamic7mod-dep-bad.so \ 2013 $(objpfx)tst-tls-manydynamic8mod-dep-bad.so 2014LDFLAGS-tst-tls-manydynamic6mod-dep-bad.so = -Wl,--no-as-needed 2015$(objpfx)tst-tls-manydynamic7mod-dep-bad.so: $(objpfx)tst-tls-manydynamic9mod-dep-bad.so 2016LDFLAGS-tst-tls-manydynamic7mod-dep-bad.so = -Wl,--no-as-needed 2017$(objpfx)tst-tls-manydynamic9mod-dep-bad.so: $(objpfx)tst-tls20mod-bad.so 2018LDFLAGS-tst-tls-manydynamic9mod-dep-bad.so = -Wl,--no-as-needed 2019# Long chain with two double depedencies in the middle 2020$(objpfx)tst-tls-manydynamic10mod-dep-bad.so: $(objpfx)tst-tls-manydynamic11mod-dep-bad.so 2021LDFLAGS-tst-tls-manydynamic10mod-dep-bad.so = -Wl,--no-as-needed 2022$(objpfx)tst-tls-manydynamic11mod-dep-bad.so: $(objpfx)tst-tls-manydynamic12mod-dep-bad.so \ 2023 $(objpfx)tst-tls-manydynamic13mod-dep-bad.so 2024LDFLAGS-tst-tls-manydynamic11mod-dep-bad.so = -Wl,--no-as-needed 2025$(objpfx)tst-tls-manydynamic12mod-dep-bad.so: $(objpfx)tst-tls-manydynamic14mod-dep-bad.so \ 2026 $(objpfx)tst-tls20mod-bad.so 2027LDFLAGS-tst-tls-manydynamic12mod-dep-bad.so = -Wl,--no-as-needed 2028$(objpfx)tst-tls20: $(shared-thread-library) 2029$(objpfx)tst-tls20.out: $(objpfx)tst-tls20mod-bad.so \ 2030 $(tst-tls-many-dynamic-modules:%=$(objpfx)%.so) \ 2031 $(tst-tls-many-dynamic-modules-dep:%=$(objpfx)%.so) \ 2032 $(tst-tls-many-dynamic-modules-dep-bad:%=$(objpfx)%.so) \ 2033 2034# Reuses tst-tls-many-dynamic-modules 2035$(objpfx)tst-tls21: $(shared-thread-library) 2036$(objpfx)tst-tls21.out: $(objpfx)tst-tls21mod.so 2037$(objpfx)tst-tls21mod.so: $(tst-tls-many-dynamic-modules:%=$(objpfx)%.so) 2038 2039$(objpfx)tst-getauxval-static.out: $(objpfx)tst-auxvalmod.so 2040tst-getauxval-static-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx) 2041 2042$(objpfx)tst-dlmopen-gethostbyname.out: $(objpfx)tst-dlmopen-gethostbyname-mod.so 2043 2044$(objpfx)tst-ro-dynamic: $(objpfx)tst-ro-dynamic-mod.so 2045$(objpfx)tst-ro-dynamic-mod.so: $(objpfx)tst-ro-dynamic-mod.os \ 2046 tst-ro-dynamic-mod.map 2047 $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \ 2048 -Wl,--script=tst-ro-dynamic-mod.map \ 2049 $(objpfx)tst-ro-dynamic-mod.os 2050 2051$(objpfx)tst-rtld-run-static.out: $(objpfx)/ldconfig 2052 2053$(objpfx)tst-dl_find_object.out: \ 2054 $(objpfx)tst-dl_find_object-mod1.so $(objpfx)tst-dl_find_object-mod2.so 2055$(objpfx)tst-dl_find_object-static.out: \ 2056 $(objpfx)tst-dl_find_object-mod1.so $(objpfx)tst-dl_find_object-mod2.so 2057tst-dl_find_object-static-ENV = $(static-dlopen-environment) 2058CFLAGS-tst-dl_find_object.c += -funwind-tables 2059CFLAGS-tst-dl_find_object-static.c += -funwind-tables 2060LDFLAGS-tst-dl_find_object-static += -Wl,--eh-frame-hdr 2061CFLAGS-tst-dl_find_object-mod1.c += -funwind-tables 2062CFLAGS-tst-dl_find_object-mod2.c += -funwind-tables 2063LDFLAGS-tst-dl_find_object-mod2.so += -Wl,--enable-new-dtags,-z,nodelete 2064$(objpfx)tst-dl_find_object-threads: $(shared-thread-library) 2065CFLAGS-tst-dl_find_object-threads.c += -funwind-tables 2066$(objpfx)tst-dl_find_object-threads.out: \ 2067 $(objpfx)tst-dl_find_object-mod1.so \ 2068 $(objpfx)tst-dl_find_object-mod2.so \ 2069 $(objpfx)tst-dl_find_object-mod3.so \ 2070 $(objpfx)tst-dl_find_object-mod4.so \ 2071 $(objpfx)tst-dl_find_object-mod5.so \ 2072 $(objpfx)tst-dl_find_object-mod6.so \ 2073 $(objpfx)tst-dl_find_object-mod7.so \ 2074 $(objpfx)tst-dl_find_object-mod8.so \ 2075 $(objpfx)tst-dl_find_object-mod9.so 2076CFLAGS-tst-dl_find_object-mod3.c += -funwind-tables 2077CFLAGS-tst-dl_find_object-mod4.c += -funwind-tables 2078CFLAGS-tst-dl_find_object-mod5.c += -funwind-tables 2079CFLAGS-tst-dl_find_object-mod6.c += -funwind-tables 2080CFLAGS-tst-dl_find_object-mod7.c += -funwind-tables 2081CFLAGS-tst-dl_find_object-mod8.c += -funwind-tables 2082CFLAGS-tst-dl_find_object-mod9.c += -funwind-tables 2083