testsuite: Exclude `*-*-kfreebsd*-gnu' from STB_GNU_UNIQUE tests
Patch updates binutils testsuite to correctly exclude kfreebsd-gnu targets from STB_GNU_UNIQUE symbol tests.
This patch updates the binutils test suite to correctly exclude *-*-kfreebsd*-gnu targets from tests related to STB_GNU_UNIQUE symbols. It aligns the exclusion logic with FreeBSD targets, which use the same BFD vectors and ELFOSABI_FREEBSD. This fix resolves several regressions observed on mips-kfreebsd-gnu related to symbol visibility and unique symbol handling.
- proposer
Submits a patch to correct testsuite exclusions for kfreebsd-gnu targets regarding STB_GNU_UNIQUE symbols.
“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.”
- reviewer
Questions if the '-gnu' suffix is strictly necessary in the exclusion pattern.
“Is the -gnu at the end really needed here? If yes, it'”
- contributor
Clarifies that the '-gnu' suffix is necessary because kfreebsd-gnu targets share characteristics with FreeBSD targets regarding ELFOSABI.
“On Tue, 21 Jul 2026, Jan Beulich wrote: > --- 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 *-*-freeb…”
Technical Tradeoffs
- Correctness of test suite exclusions for specific target architectures.
- Ensuring accurate reporting of feature support (STB_GNU_UNIQUE).
In Details
This patch modifies binutils' test suite, specifically the supports_gnu_unique function in binutils-common.exp. It adds *-*-kfreebsd*-gnu to the list of targets that do not support STB_GNU_UNIQUE symbols. This is because kfreebsd-gnu targets use the same BFD symbols and ELFOSABI_FREEBSD as *-*-freebsd* targets, which were already excluded. The change addresses regressions seen on mips-kfreebsd-gnu related to symbol visibility and unique symbol handling.
- STB_GNU_UNIQUE
- A symbol binding type in the ELF format, used for symbols that must be unique across shared libraries.
- kfreebsd-gnu
- A target triplet indicating a GNU system running on a FreeBSD kernel.
- BFD
- Binary File Descriptor library, used by binutils to handle various object file formats.
- ELFOSABI_FREEBSD
- An ELF operating system ABI (Application Binary Interface) identifier specific to FreeBSD.