about summary refs log tree commit diff
path: root/elf/Makefile
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-06-30 00:21:18 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-07-30 16:01:44 -0300
commit3908fa933a4354309225af616d9242f595e11ccf (patch)
treec5762614dfb75db96afc0e614c8bfa8f1cd23070 /elf/Makefile
parentc37fc3ebf0607ce1953c565ffe56d56555eeb25e (diff)
downloadglibc-3908fa933a4354309225af616d9242f595e11ccf.tar.gz
glibc-3908fa933a4354309225af616d9242f595e11ccf.tar.xz
glibc-3908fa933a4354309225af616d9242f595e11ccf.zip
elf: Fix audit regression
Commit 03e187a41d9 added a regression when an audit module does not have
libc as DT_NEEDED (although unusual it is possible).

Checked on x86_64-linux-gnu.
Diffstat (limited to 'elf/Makefile')
-rw-r--r--elf/Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 87a70d6c7a..d05f410592 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -219,7 +219,7 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \
 	 tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenfail \
 	 tst-dlopenfail-2 \
 	 tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlopen \
-	 tst-audit14 tst-audit15 tst-audit16 \
+	 tst-audit14 tst-audit15 tst-audit16 tst-audit17 \
 	 tst-single_threaded tst-single_threaded-pthread \
 	 tst-tls-ie tst-tls-ie-dlmopen argv0test \
 	 tst-glibc-hwcaps tst-glibc-hwcaps-prepend tst-glibc-hwcaps-mask \
@@ -1475,6 +1475,16 @@ $(objpfx)tst-auditlogmod-3.so: $(libsupport)
 $(objpfx)tst-audit16.out: \
   $(objpfx)tst-auditlogmod-1.so $(objpfx)tst-auditlogmod-2.so \
   $(objpfx)tst-auditlogmod-3.so
+$(objpfx)tst-audit17.out: $(objpfx)tst-auditmod17.so
+# The test check if a audit library without libc.so on DT_NEEDED works as
+# intended, so it uses an explicit link rule.
+$(objpfx)tst-auditmod17.so: $(objpfx)tst-auditmod17.os
+	$(CC) -nostdlib -nostartfiles -shared -o $@.new \
+	$(filter-out $(map-file),$^)
+	$(call after-link,$@.new)
+	mv -f $@.new $@
+CFLAGS-.os += $(call elide-stack-protector,.os,tst-auditmod17)
+tst-audit17-ENV = LD_AUDIT=$(objpfx)tst-auditmod17.so
 
 # tst-sonamemove links against an older implementation of the library.
 LDFLAGS-tst-sonamemove-linkmod1.so = \