aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elf/Makefile3
-rw-r--r--elf/tst-valgrind-smoke.sh5
-rw-r--r--sysdeps/x86_64/Makefile6
-rw-r--r--sysdeps/x86_64/tst-valgrind-smoke.supp17
4 files changed, 28 insertions, 3 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 02dc476e27..f0439ef634 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -617,7 +617,8 @@ tests-special += $(objpfx)tst-valgrind-smoke.out
endif
$(objpfx)tst-valgrind-smoke.out: tst-valgrind-smoke.sh $(objpfx)ld.so $(objpfx)valgrind-test
$(SHELL) $< $(objpfx)ld.so $(rtlddir)/$(rtld-installed-name) '$(test-wrapper-env)' \
- '$(run-program-env)' '$(rpath-link)' $(objpfx)valgrind-test > $@; $(evaluate-test)
+ '$(run-program-env)' '$(rpath-link)' $(objpfx)valgrind-test \
+ '$(valgrind-suppressions-tst-valgrind-smoke)' > $@; $(evaluate-test)
tests += $(tests-execstack-$(have-z-execstack))
ifeq ($(run-built-tests),yes)
diff --git a/elf/tst-valgrind-smoke.sh b/elf/tst-valgrind-smoke.sh
index e33b2fa1d7..7d0ceac6b1 100644
--- a/elf/tst-valgrind-smoke.sh
+++ b/elf/tst-valgrind-smoke.sh
@@ -25,6 +25,7 @@ test_wrapper_env="$3"
run_program_env="$4"
library_path="$5"
test_prog="$6"
+valgrind_suppressions="$7"
# Test whether valgrind is available in the test
# environment. If not, skip the test.
@@ -34,7 +35,7 @@ ${test_wrapper_env} ${run_program_env} \
# Test valgrind works with the system ld.so in the test environment
/bin/sh -c \
"${test_wrapper_env} ${run_program_env} \
- valgrind -q --error-exitcode=1 \
+ valgrind -q --error-exitcode=1 ${valgrind_suppressions} \
${system_rtld} /bin/echo ${system_rtld}" || exit 77
# Finally the actual test inside the test environment,
@@ -42,5 +43,5 @@ ${test_wrapper_env} ${run_program_env} \
# the smoke test under valgrind.
/bin/sh -c \
"${test_wrapper_env} ${run_program_env} \
- valgrind -q --error-exitcode=1 \
+ valgrind -q --error-exitcode=1 ${valgrind_suppressions} \
${rtld} --library-path ${library_path} ${test_prog} ${rtld}"
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 9337e95093..66b21954f3 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -211,6 +211,12 @@ tst-plt-rewrite2-ENV = GLIBC_TUNABLES=glibc.cpu.plt_rewrite=2
$(objpfx)tst-plt-rewrite2: $(objpfx)tst-plt-rewritemod2.so
endif
+# Check if ISA level is 3 or above.
+ifneq (,$(filter $(have-x86-isa-level),$(x86-isa-level-3-or-above)))
+valgrind-suppressions-tst-valgrind-smoke = \
+ --suppressions=$(..)sysdeps/x86_64/tst-valgrind-smoke.supp
+endif
+
endif # $(subdir) == elf
ifeq ($(subdir),csu)
diff --git a/sysdeps/x86_64/tst-valgrind-smoke.supp b/sysdeps/x86_64/tst-valgrind-smoke.supp
new file mode 100644
index 0000000000..533c2deaff
--- /dev/null
+++ b/sysdeps/x86_64/tst-valgrind-smoke.supp
@@ -0,0 +1,17 @@
+{
+ False positive at strcmp-avx2.S:462
+ Memcheck:Cond
+ fun:strcmp
+ fun:_dl_name_match_p
+ fun:_dl_map_object
+ fun:map_doit
+ fun:_dl_catch_exception
+ fun:_dl_catch_error
+ fun:do_preload
+ fun:handle_preload_list
+ fun:dl_main
+ fun:_dl_sysdep_start
+ fun:_dl_start_final
+ fun:_dl_start
+ obj:*/elf/ld.so
+}