meaning of supports_gnu_unique
Jan Beulich
jbeulich@suse.com
Fri Mar 27 07:42:33 GMT 2026
On 27.03.2026 00:27, Alan Modra wrote:
> On Thu, Mar 26, 2026 at 03:35:55PM +0100, Jan Beulich wrote:
>> may I ask what the purpose is of this predicate used by the testsuite?
>> By its name I would in particular expect it to cover the
>> %gnu_unique_object symbol type (supported by the comment there), but as
>> demonstrated by ld-unique/unique failing for arm-unknown-linux-gnu there
>> must be something I'm missing.
>
> I don't see any fails on my cross builds of arm-linux-gnueabi..
That one's fine indeed. The one I named (shorthand arm-linux) isn't.
> Maciej was the original author of that function. I extracted out
> supports_gnu_osabi, prior to which the comment for supports_gnu_unique
> said:
>
> # True if the ELF target supports STB_GNU_UNIQUE with the ELF header's
> # OSABI field set to ELFOSABI_GNU.
> #
> # This generally depends on the target OS only, however there are a
> # number of exceptions for bare metal targets as follows. The MSP430
> # and Visium targets set OSABI to ELFOSABI_STANDALONE and cannot
> # support STB_GNU_UNIQUE. Likewise non-EABI ARM targets set OSABI to
> # ELFOSABI_ARM, and TI C6X targets to ELFOSABI_C6000_*. Finally
> # rather than `bfd_elf_final_link' a number of targets use
> # `_bfd_generic_final_link', which does not support STB_GNU_UNIQUE
> # symbol binding causing assertion failures.
> #
The ELFOSABI_ARM aspect was even mentioned there (and still is in
today's form of the comment). If the comment is correct, the
*-*-gnu* pattern used in supports_gnu_osabi would need amending to
exclude the target above. But: How can *-*-*gnu* not be a GNU target?
What would the "gnu" in there indicate then?
Judging from the comments, I would have expected tic6x to have a
similar issue, but I haven't observed such in practice. This looks to
be a result of the assembler only ever using (OSABI-generic) targets
which bfd/config.bfd installs as secondary ones.
Jan
More information about the Binutils
mailing list