[PATCH] ld: don't use SAME_INODE for the duplicate-script check on hosts without inodes

Jan Dubiec jdx@o2.pl
Tue Aug 18 10:48:05 GMT 2026


On 18.08.2026 08:00, Alan Modra wrote:
[...]

> That says there is a bug in SAME_INODE, and in upstream gnulib too.
> I will apply the following.
IMO, it would also be nice to mark pr24576-1 and pr24576-2 as XFAIL 
rather than simply skipping them. Perhaps duplicate detection on Windows 
will be fixed at some point in the future.

/J.D.
-------------- next part --------------
 ld/testsuite/ld-scripts/pr24576-1.d | 3 +++
 ld/testsuite/ld-scripts/pr24576-2.d | 3 +++
 ld/testsuite/ld-scripts/script.exp  | 8 ++------
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/ld/testsuite/ld-scripts/pr24576-1.d b/ld/testsuite/ld-scripts/pr24576-1.d
index 6cc7621aadb..892a12ed4e3 100644
--- a/ld/testsuite/ld-scripts/pr24576-1.d
+++ b/ld/testsuite/ld-scripts/pr24576-1.d
@@ -1,3 +1,6 @@
 #source: default-script.s
 #ld: -defsym _START=0x800 -T default-script.t -T default-script.t
 #error: .*default-script.t\)' appears multiple times
+#
+# XFAIL the test case on MinGW/Windows hosts due to broken SAME_INODE macro.
+#xfail: [ishost\ *-mingw*]
diff --git a/ld/testsuite/ld-scripts/pr24576-2.d b/ld/testsuite/ld-scripts/pr24576-2.d
index 2d26ab32783..eba4770e228 100644
--- a/ld/testsuite/ld-scripts/pr24576-2.d
+++ b/ld/testsuite/ld-scripts/pr24576-2.d
@@ -1,3 +1,6 @@
 #source: default-script.s
 #ld: -defsym _START=0x800 -T ././/default-script.t -T default-script.t
 #error: .*default-script.t\)' appears multiple times
+#
+# XFAIL the test case on MinGW/Windows hosts due to broken SAME_INODE macro.
+#xfail: [ishost\ *-mingw*]
diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp
index ff65e397b6b..ed4cbf7660e 100644
--- a/ld/testsuite/ld-scripts/script.exp
+++ b/ld/testsuite/ld-scripts/script.exp
@@ -233,12 +233,8 @@ run_dump_test "pr20302"
 run_dump_test "output-section-types"
 run_dump_test "ld-version"
 run_dump_test "ld-version-2"
-# Windows hosts are likely to have filesystems where st_ino has no meaning,
-# breaking the test for accidental duplicate scripts.
-if { ![ishost *-mingw*] } {
-    run_dump_test "pr24576-1"
-    run_dump_test "pr24576-2"
-}
+run_dump_test "pr24576-1"
+run_dump_test "pr24576-2"
 run_dump_test "linker-script-not-found"
 
 run_dump_test "segment-start" {{name (default)}}


More information about the Binutils mailing list