8a8cfb
commit 61a7c9df71ee4e6f94b56c20f0d37c6e17d5f284
8a8cfb
Author: Florian Weimer <fweimer@redhat.com>
8a8cfb
Date:   Mon Dec 2 14:53:16 2019 +0100
8a8cfb
8a8cfb
    elf/tst-dlopenfail: Disable --no-as-needed for tst-dlopenfailmod1.so
8a8cfb
    
8a8cfb
    Otherwise, the shared object dependency which triggers the load
8a8cfb
    failure is dropped, invalidating the test.
8a8cfb
8a8cfb
diff --git a/elf/Makefile b/elf/Makefile
8a8cfb
index bf7c41f38be42184..467e810e784bb96d 100644
8a8cfb
--- a/elf/Makefile
8a8cfb
+++ b/elf/Makefile
8a8cfb
@@ -1543,8 +1543,11 @@ LDFLAGS-tst-finilazyfailmod.so = \
8a8cfb
 $(objpfx)tst-dlopenfail: $(libdl)
8a8cfb
 $(objpfx)tst-dlopenfail.out: \
8a8cfb
   $(objpfx)tst-dlopenfailmod1.so $(objpfx)tst-dlopenfailmod2.so
8a8cfb
-# Order matters here.  tst-dlopenfaillinkmod.so's soname ensures
8a8cfb
-# a run-time loader failure.
8a8cfb
+# Order matters here.  tst-dlopenfaillinkmod.so's soname ensures a
8a8cfb
+# run-time loader failure.  --as-needed breaks this test because
8a8cfb
+# nothing actually references tst-dlopenfailmod2.so (with its soname
8a8cfb
+# tst-dlopenfail-missingmod.so).
8a8cfb
+LDFLAGS-tst-dlopenfailmod1.so = -Wl,--no-as-needed
8a8cfb
 $(objpfx)tst-dlopenfailmod1.so: \
8a8cfb
   $(shared-thread-library) $(objpfx)tst-dlopenfaillinkmod.so
8a8cfb
 LDFLAGS-tst-dlopenfaillinkmod.so = -Wl,-soname,tst-dlopenfail-missingmod.so