[PATCH 23/27] gdb.base/maint-info-sections.exp: Remove stale Windows DATA xfail

Pedro Alves <[email protected]> Thu, 23 Jul 2026 14:01:14 +0100
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
The "maint info sections DATA" test of
gdb.base/maint-info-sections.exp was marked XFAIL on cygwin and mingw,
on the grounds that Windows text sections were tagged DATA, so the
DATA filter would wrongly list the text section.

The Cygwin xfail dates back to commit dbdfa66c308 in 2005, the MinGW
one to commit 58e8570aabf ("gdb.base/maint.exp: XFAIL "maint info
sections DATA" on MinGW as well as Cygwin.") in 2011, and both moved
to this file unchanged in commit f4be677293a ("gdb/testsuite: split
'maint info sections' tests to a new file").

On current cygwin and mingw the text section is not reported as DATA,
the test passes, and the xfail turns into an XPASS:

 XPASS: gdb.base/maint-info-sections.exp: maint info sections DATA

I have not tracked down exactly which change fixed this -- given the
xfail is roughly fifteen to twenty years old, it could be a change in
GDB, in BFD's PE section-flag handling, or in the toolchains that
produce the section flags in the first place.

It does not really matter for this test IMHO: what it checks is GDB's
report of the current binary's section flags, and on the toolchains
anyone is realistically testing with today that report is correct, as
the XPASS shows.

A stale xfail that always XPASSes is just noise, so I'd rather remove
it and let the test report a plain PASS.  If it turns out this still
fails on a modern toolchain, we can add the xfail back with some more
targeted check, based on toolchain version or some such.

Tested on:

  x86_64-pc-linux-gnu
  x86_64-pc-cygwin
  x86_64-w64-mingw32
  x86_64-pc-windows-msvc

Change-Id: Ia64c4297fb219058353fb9d88913f89cca2cd68b
---
 gdb/testsuite/gdb.base/maint-info-sections.exp | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/gdb/testsuite/gdb.base/maint-info-sections.exp b/gdb/testsuite/gdb.base/maint-info-sections.exp
index 3cc128c0ad3..0bb15246d52 100644
--- a/gdb/testsuite/gdb.base/maint-info-sections.exp
+++ b/gdb/testsuite/gdb.base/maint-info-sections.exp
@@ -173,12 +173,6 @@ gdb_test_multiple "maint info sections CODE" "" {
 
 # Test for new option: DATA section flag
 # If your text section is tagged DATA, xfail this test.
-#
-# The "maint info sections DATA" test is marked for XFAIL on Windows,
-# because Windows has text sections marked DATA.
-setup_xfail "*-*-*cygwin*"
-setup_xfail "*-*-*mingw*"
-
 gdb_test_multiple "maint info sections DATA" "" {
     -re -wrap " $text_section .*" {
 	fail $gdb_test_name
-- 
2.54.0