[PATCH] testsuite: Also exclude `*-*-kfreebsd*-gnu' from STB_GNU_UNIQUE tests

"Maciej W. Rozycki" <[email protected]> Tue, 21 Jul 2026 13:56:07 +0100 (BST)
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
Fix commit 02e0be69012a ("mbind gas tests and supports_gnu_osabi 
testsuite infrastructure") and also match `*-*-kfreebsd*-gnu' targets 
when determining whether STB_GNU_UNIQUE binding is supported for 
symbols.  These targets use the same BFD vectors as `*-*-freebsd*' do, 
choosing ELFOSABI_FREEBSD, and therefore need to be treated analogously.

This fixes numerous regressions, e.g.:

mips-kfreebsd-gnu  -FAIL: weaken STB_GNU_UNIQUE symbols
mips-kfreebsd-gnu  -FAIL: strip on STB_GNU_UNIQUE
mips-kfreebsd-gnu  -FAIL: diagnostics for visibility directives
mips-kfreebsd-gnu  -FAIL: ld-unique/pr21529
mips-kfreebsd-gnu  -FAIL: Linker setting GNU OSABI on STB_GNU_UNIQUE symbol (PR 10549)

caused by the missing feature:

.../gas/testsuite/gas/elf/visibility.s:14: Error: symbol type "gnu_unique_object" is supported only by GNU targets
---
 binutils/testsuite/lib/binutils-common.exp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

binutils-test-gnu-unique-kfreebsd.diff
Index: binutils-gdb/binutils/testsuite/lib/binutils-common.exp
===================================================================
--- binutils-gdb.orig/binutils/testsuite/lib/binutils-common.exp
+++ binutils-gdb/binutils/testsuite/lib/binutils-common.exp
@@ -308,7 +308,7 @@ proc is_elf_unused_section_symbols {} {
 # This require ELFOSABI_GNU, and `bfd_elf_final_link'.
 #
 proc supports_gnu_unique {} {
-    if { [istarget *-*-freebsd*] } {
+    if { [istarget *-*-freebsd*] || [istarget *-*-kfreebsd*-gnu] } {
 	return 0
     }
     if { [supports_gnu_osabi] && ![is_generic] } {