public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed][testsuite] Handle readelf following links by default
@ 2021-03-20  8:38 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2021-03-20  8:38 UTC (permalink / raw)
  To: dwz, jakub, mark

Hi,

Since binutils commit c46b706620e "Change the readelf and objdump programs so
that they will automatically follow links to separate debug info files" there
are a few FAILs in the dwz testsuite.

This is just due to changing the default behaviour for readelf.

Fix this by testing whether the new -Wn readelf flag is supported,
and if so, adding it to the readelf call.

Committed to trunk.

Thanks,
- Tom

[testsuite] Handle readelf following links by default

2021-03-20  Tom de Vries  <tdevries@suse.de>

	PR dwz/27592
	* testsuite/dwz.tests/odr-struct-multifile.sh: Call readelf with -wN
	if supported.
	* testsuite/dwz.tests/cycle.sh: Same.

---
 testsuite/dwz.tests/cycle.sh                | 7 ++++++-
 testsuite/dwz.tests/odr-struct-multifile.sh | 9 +++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/testsuite/dwz.tests/cycle.sh b/testsuite/dwz.tests/cycle.sh
index 5c181dd..85aa556 100644
--- a/testsuite/dwz.tests/cycle.sh
+++ b/testsuite/dwz.tests/cycle.sh
@@ -1,3 +1,8 @@
+readelf_flags=""
+if readelf -h 2>&1 | grep -q "\-wN,"; then
+    readelf_flags=-wN
+fi
+
 cp $execs/cycle 1
 
 # Using mode 3 in checksum_die_ref.
@@ -21,7 +26,7 @@ $execs/dwz-for-test -m 3 1 2 --devel-no-checksum-cycle-opt --devel-ignore-size
 cnt=$(readelf -wi 3 | grep -c "DW_AT_name.*: s$")
 [ $cnt -eq 1 ]
 
-cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*: s$" || true)
+cnt=$(readelf -wi $readelf_flags 1 | grep -c "DW_AT_name.*: s$" || true)
 [ $cnt -eq 0 ]
 
 rm -f 1 2 3
diff --git a/testsuite/dwz.tests/odr-struct-multifile.sh b/testsuite/dwz.tests/odr-struct-multifile.sh
index cc462c9..20b682b 100644
--- a/testsuite/dwz.tests/odr-struct-multifile.sh
+++ b/testsuite/dwz.tests/odr-struct-multifile.sh
@@ -2,6 +2,11 @@ if ! $execs/dwz-for-test --odr -v 2>/dev/null; then
     exit 77
 fi
 
+readelf_flags=""
+if readelf -h 2>&1 | grep -q "\-wN,"; then
+    readelf_flags=-wN
+fi
+
 cp $execs/odr-struct 1
 cp 1 2
 
@@ -41,12 +46,12 @@ done
 
 
 for name in aaa bbb ccc; do
-    cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*$name" || true)
+    cnt=$(readelf -wi $readelf_flags 1 | grep -c "DW_AT_name.*:.*$name" || true)
     [ $cnt -eq 0 ]
 done
 
 for name in member_one member_two member_three member_four; do
-    cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*$name" || true)
+    cnt=$(readelf -wi $readelf_flags 1 | grep -c "DW_AT_name.*:.*$name" || true)
     [ $cnt -eq 0 ]
 done
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-20  8:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-20  8:38 [committed][testsuite] Handle readelf following links by default Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).