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