From 98edd441ce4f7cf0a2bc650604325186d4c18807 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 9 Mar 2022 14:53:09 +0900 Subject: [PATCH] [ELF] Do not print out an error of `ldd --version` Some `ldd` impls don't support the --version option. We do not want to show the error message but instead just skip the test entirely. https://github.com/rui314/mold/pull/385 --- test/elf/hello-static-pie.sh | 2 +- test/elf/ifunc-static-pie.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/elf/hello-static-pie.sh b/test/elf/hello-static-pie.sh index 75616142..0e6f1efa 100755 --- a/test/elf/hello-static-pie.sh +++ b/test/elf/hello-static-pie.sh @@ -18,7 +18,7 @@ echo 'int main() {}' | $CC -o $t/exe -xc - ldd $t/exe | grep -q ld-musl && { echo OK; exit; } # -static-pie works only with a newer version of glibc -ldd --version | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; } +ldd --version 2>&1 | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; } cat < diff --git a/test/elf/ifunc-static-pie.sh b/test/elf/ifunc-static-pie.sh index 444fd6bf..98e5e5a0 100755 --- a/test/elf/ifunc-static-pie.sh +++ b/test/elf/ifunc-static-pie.sh @@ -18,7 +18,7 @@ echo 'int main() {}' | $CC -o $t/exe -xc - ldd $t/exe | grep -q ld-musl && { echo OK; exit; } # -static-pie works only with a newer version of glibc -ldd --version | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; } +ldd --version 2>&1 | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; } cat <