[PATCH] ld: testsuite: Skip pr33577 tests with GNU extensions on Solaris [PR33577]

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Fri Jan 23 20:23:59 GMT 2026


Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

drats: I forgot to expand on one crucial part.

> Several of the ld-elfvers pr33577 tests FAIL on Solaris, for either or
> both of two reasons:
>
> * Tests using ld --hash-style=gnu cannot work on Solaris:
>   .gnu.hash/SHT_GNU_HASH sections are a GNU extension not supported by
>   Solaris ld.so.1
>
> * Similarly, binding different implementations of the same symbol to
>   different symbol versions is a GNU extension that wasn't in the
>   original Solaris specification of symbol versioning.  ld.so.1 doesn't
>   support them and never will.

    This can be seen in the elfdump output for both the .dynsym section:

Symbol Table Section:  .dynsym
  index     value size  type bind oth ver shndx         name

    [8]     0x630  0xd  FUNC GLOB  D   1H .text         foo
   [10]     0x620  0x6  FUNC GLOB  D    2 .text         foo

    foo is bound to both version 1 (the Base version) and version 2
    (VERS_1 from pr33577.map)

    and .symtab:

Symbol Table Section:  .symtab
  index    value size  type bind oth ver shndx       name

   [28]     0x620  0x6  FUNC GLOB  D    0 .text         foo
   [35]     0x630  0xd  FUNC GLOB  D    0 .text         foo@

    As I said, ld.so.1 doesn't support <symbol>@<version> (in this case
    the Base version) at all.

> Therefore the tests that employ those extensions are guarded with
> supports_gnu_osabi.
>
> Tested on sparc{,v9}-sun-solaris2.11, sparc{,64}-unknown-linux-gnu,
> {i386,amd64}-pc-solaris2.11, and {x86_64,i686}-pc-linux-gnu.
>
> Ok for trunk?
>
> I firmly believe that any object that uses either extension should be
> marked as either the native OSABI (e.g. ELFOSABI_FREEBSD) or
> ELFOSABI_GNU so they fail to load rather than causing hard-to-debug
> runtime failures.
>
> 	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Binutils mailing list