binutils Newspaper
JULY 29, 2026
testsuite Proposed

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

Patch extends exclusion of kfreebsd-gnu targets from STB_GNU_UNIQUE tests to improve consistency with BFD target handling.

This discussion revolves around a patch that extends the exclusion of *-*-kfreebsd*-gnu targets from STB_GNU_UNIQUE tests in binutils. Maciej W. Rozycki, the proposer, successfully applied the patch after agreeing with Jan Beulich that maintaining consistency in triplet matching patterns across components is beneficial, even if wider matches in testsuite patterns seem safe. The change aims to prevent discrepancies between different binutils components.

In the Thread 2 participants
  1. Maciej W. Rozycki proposer

    Applies a patch to exclude `*-*-kfreebsd*-gnu` targets from STB_GNU_UNIQUE tests, emphasizing the value of consistent triplet matching patterns across binutils components.

    “I think there's value in having triplet match patterns consistent where appropriate, as it makes tree-wide changes easier, in particular to avoid discrepancies between components. I've seen too many of them recently. Change committed now, thank you for your review.”
  2. Jan Beulich reviewer

    Discusses the consistency of triplet matching patterns, initially questioning the necessity of a wider match in tests compared to BFD configurations but ultimately yielding.

    “Afaict `foo-kfreebsd-bar' will simply not match anything, hitting the "BFD does not support target" case. Therefore I don't see it as wrong to have a wider match here than what bfd/config.bfd has. Yet no, I'm not going to insist.”

Technical Tradeoffs

  • Test Specificity vs. Consistency: Balancing the need for precise tests with the benefit of consistent target handling across the project.
  • Maintainability: Simplifying future maintenance by having consistent patterns for target exclusions.
  • Correctness: Ensuring tests accurately reflect linker behavior without being affected by unrelated symbol binding types.

In Details

This patch modifies the binutils test suite to include *-*-kfreebsd*-gnu triplets in the set of targets excluded from tests related to STB_GNU_UNIQUE symbols. The rationale, confirmed by the maintainer, is to ensure consistency in target pattern matching between different parts of binutils (like the testsuite and BFD). While the specific target might not be explicitly handled by BFD's configuration for these tests, maintaining consistent exclusion patterns simplifies tree-wide changes and avoids potential discrepancies in how targets are treated across the binutils project.

For Context
testsuite
A collection of automated tests designed to verify the correct functionality of a software system, in this case, the binutils linker.
STB_GNU_UNIQUE
A symbol binding type in ELF, indicating that a symbol has a unique instance within the dynamic symbol table, often used for interpositioning.
kfreebsd-gnu
A target triplet indicating a FreeBSD kernel combined with GNU userland tools, often used in build systems.
BFD
The Binary File Descriptor library, part of binutils, which provides a generic interface for reading and writing various object file formats.
triplet
A string commonly used to identify a target architecture, vendor, and operating system (e.g., x86_64-linux-gnu).
Filed Under: binutilstestsuiteELFkfreebsdconsistency