Symver attribute

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Mon Nov 18 14:51:00 GMT 2019


Florian Weimer <fweimer@redhat.com> writes:

> * Rainer Orth:
>
>> Hi Jan,
>>
>>> Also I wonder for testsuite bits, I think I need to implement
>>> dl-require-symver and then use it to gate the individual tests? Or do we
>>> have some common way to check for ELF?
>>
>> there's a misunderstanding throughout here: symbol versioning is *not* a
>> (generic) ELF feature, i.e. it is not part of the ELF gABI.  Instead it
>> started off as a Solaris extension initially, later to be adopted and
>> extended again by gas/gld/glibc.
>
> The GNU implementation is incompatible at a conceptual level, it's not
> just an extension.

Huh?  The gld manual claims otherwise:

https://sourceware.org/binutils/docs/ld/VERSION.html#VERSION

and the ELF representation is certainly the same.  Check

https://docs.oracle.com/cd/E37838_01/html/E36783/chapter5-84101.html#scrolltoc

>> There are certainly ELF platforms that don't support it at all
>> (cf. HP-UX in gccinstall, maybe some of the BSDs, historically even
>> more like IRIX), so you cannot assume that any ELF platform will
>> support it.  On top of that, the GNU extension of having the same
>> symbol in multiple versions was never taken up by Solaris (and never
>> will be AFAICT), so even when using gas and gld, uses will break when
>> they reach ld.so.1.
>
> I think symbols don't carry versions in Solaris, which is the conceptual
> difference. 8-)

Huh again: you can certainly bind a symbol to a particular version (just
one though) using linker scripts which use exactly the same format as
gld (minus support for C++ mangling and globbing).

	Rainer

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



More information about the Gcc-patches mailing list