public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Fix compare-sections.exp with -fPIE/-pie
@ 2019-08-17  0:22 gdb-buildbot
  2019-08-17  0:17 ` Failures on Ubuntu-Aarch64-m64, branch master gdb-buildbot
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gdb-buildbot @ 2019-08-17  0:22 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 34dafe9f39e61de970c36ed636daa58e1caa386c ***

commit 34dafe9f39e61de970c36ed636daa58e1caa386c
Author:     Tom de Vries <tdevries@suse.de>
AuthorDate: Fri Aug 16 23:48:28 2019 +0200
Commit:     Tom de Vries <tdevries@suse.de>
CommitDate: Fri Aug 16 23:48:28 2019 +0200

    [gdb/testsuite] Fix compare-sections.exp with -fPIE/-pie
    
    When running gdb.base/compare-sections.exp with target board -fPIE/-pie, we
    get:
    ...
    FAIL: gdb.base/compare-sections.exp: after run to main: compare-sections -r
    ...
    
    The test expects the read-only sections to have the same contents as in the
    file:
    ...
        # Assume startup code doesn't change read-only sections.
        compare_sections "-r"
    ...
    but that's not the case for PIE executables.
    
    Fix this by allowing mismatched read-only sections for PIE executables.
    
    Tested on x86_64-linux.
    
    gdb/testsuite/ChangeLog:
    
    2019-08-16  Tom de Vries  <tdevries@suse.de>
    
            * gdb.base/compare-sections.exp ("after run to main"): Allow
            mismatched read-only sections for PIE executables.

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b3c815f29a..edf7d17801 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-16  Tom de Vries  <tdevries@suse.de>
+
+	* gdb.base/compare-sections.exp ("after run to main"): Allow
+	mismatched read-only sections for PIE executables.
+
 2019-08-16  Tom Tromey  <tom@tromey.com>
 
 	* lib/tuiterm.exp (_csi_Z): New proc.
diff --git a/gdb/testsuite/gdb.base/compare-sections.exp b/gdb/testsuite/gdb.base/compare-sections.exp
index 7dbae5b2c2..75667ee25c 100644
--- a/gdb/testsuite/gdb.base/compare-sections.exp
+++ b/gdb/testsuite/gdb.base/compare-sections.exp
@@ -21,6 +21,8 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
 }
 
+set is_pie [exec_is_pie $binfile]
+
 # Run the compare-sections command along with any options as specified
 # by OPTIONS, and check that no mismatch is found.
 proc compare_sections { {options ""} } {
@@ -87,8 +89,13 @@ with_test_prefix "after run to main" {
     gdb_test "compare-sections" \
 	"MIS-MATCHED.*warning.*One or more sections.*does not match.*loaded file"
 
-    # Assume startup code doesn't change read-only sections.
-    compare_sections "-r"
+    if { $is_pie == 1 } {
+	gdb_test "compare-sections -r" \
+	    "MIS-MATCHED.*warning.*One or more sections.*does not match.*loaded file"
+    } else {
+	# Assume startup code doesn't change read-only sections.
+	compare_sections "-r"
+    }
 }
 
 # Now test that "compare-sections -r" works as expected.  Look for an


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-08-18 21:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-17  0:22 [binutils-gdb] [gdb/testsuite] Fix compare-sections.exp with -fPIE/-pie gdb-buildbot
2019-08-17  0:17 ` Failures on Ubuntu-Aarch64-m64, branch master gdb-buildbot
2019-08-17  0:59 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, " gdb-buildbot
2019-08-18 21:00 ` Failures on Fedora-i686, " gdb-buildbot
2019-08-18 21:14 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-08-18 21:23 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-08-18 22:07 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-08-19  4:34 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2019-08-19 11:32 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

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).