diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index ff0463d7ca..688b537a48 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -466,7 +466,7 @@ $(objpfx)tst-shstk-legacy-1e-static.out: \
   $(objpfx)tst-shstk-legacy-1e-static
 	$(SHELL) $< $(common-objpfx) 2> $@; \
 	$(evaluate-test)
-tst-shstk-legacy-1f-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-shstk-legacy-1f-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK LD_PRELOAD=$(objpfx)tst-shstk-legacy-mod-1.so
 $(objpfx)tst-shstk-legacy-1f: $(objpfx)tst-shstk-legacy-mod-1.so
 $(objpfx)tst-shstk-legacy-mod-1.so: \
   $(objpfx)tst-shstk-legacy-mod-1.os \
diff --git a/sysdeps/x86_64/tst-shstk-legacy-1g.sh b/sysdeps/x86_64/tst-shstk-legacy-1g.sh
index 449bf7493b..0453e3d3af 100755
--- a/sysdeps/x86_64/tst-shstk-legacy-1g.sh
+++ b/sysdeps/x86_64/tst-shstk-legacy-1g.sh
@@ -22,6 +22,7 @@ common_objpfx=$1; shift
 test_program_prefix=$1; shift
 
 GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK \
+LD_PRELOAD=${common_objpfx}elf/tst-shstk-legacy-mod-1.so \
 ${test_program_prefix} \
   ${common_objpfx}elf/tst-shstk-legacy-1g
 # The exit status should only be unsupported (77) or segfault (139).
