This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Multiple symbol versions for the same function
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Binutils <binutils at sourceware dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 26 Jun 2018 20:57:28 +0000
- Subject: Re: Multiple symbol versions for the same function
- References: <a5725550-aa99-73dd-2dec-a641129e4b54@redhat.com>
On Sat, 23 Jun 2018, Florian Weimer wrote:
> Is there a way to implement what I want that works with binutils 2.25? I'm not
> sure if we want to build glibc with --allow-multiple-definition.
See, for example, the various <fenv.h> functions, which have multiple
versions pointing to the same implementation because C99 TC1 changed
return types from void to int (so callers expecting void can safely call
an implementation returning int, but callers expecting int can't safely
run with an older implementation version returning void).
I think the difference from your example is that three names for the
function are involved, not two; each .symver directive ends up being of
the form ".symver func_alias, func@VERSION" (or @@VERSION), where there
are two different aliases, neither of which is the same as the symbol
being assigned a version.
--
Joseph S. Myers
joseph@codesourcery.com