[binutils-gdb] xfail gdb.base/break-on-linker-gcd-function.exp with Solaris ld [PR34534]

Rainer Orth via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8737a7be46bb304d8d09566ce2e6d3bfdd7ff60e

commit 8737a7be46bb304d8d09566ce2e6d3bfdd7ff60e
Author: Rainer Orth <[email protected]>
Date:   Sat Aug 22 19:43:41 2026 +0200

    xfail gdb.base/break-on-linker-gcd-function.exp with Solaris ld [PR34534]
    
    As detailed in PR testsuite/34534, a test FAILs on Solaris when using
    the native ld:
    
    FAIL: gdb.base/break-on-linker-gcd-function.exp: break on line in garbage collected function
    FAIL: gdb.base/break-on-linker-gcd-function.exp: readnow: break on line in garbage collected function
    
    Even though ld supports --gc-sections as an alias for the native -z
    discard-unused=sections, this doesn't work in this particular case.
    While the issue is under investigation, this patch xfail's the test when
    Solaris ld is in use.
    
    Approved-By: Tom Tromey <[email protected]>
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34534

Diff:
---
 gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp b/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
index f430c51f946..18167b60592 100644
--- a/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
+++ b/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
@@ -42,6 +42,13 @@ proc set_breakpoint_on_gcd_function {} {
 
     set lineno [gdb_get_line_number "gdb break here"]
     gdb_test "set breakpoint pending on"
+
+    # PR testsuite/34534
+    set compiler [find_g++]
+    set res [catch {exec $compiler -Wl,--version} output]
+    if {[regexp "Solaris Link Editors" $output]} {
+	setup_xfail "*-*-solaris2*"
+    }
     gdb_test "b $lineno" \
 	[multi_line \
 	     "^No compiled code for line $lineno in the current file\\." \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.