From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org, Florian Weimer <fweimer@redhat.com>
Subject: Re: [RFC 0/2] Transparent multi-version symbol support
Date: Fri, 19 Mar 2021 16:02:35 -0300 [thread overview]
Message-ID: <e3b600df-924b-aec6-f361-07f69b269e1d@linaro.org> (raw)
In-Reply-To: <cover.1616095061.git.fweimer@redhat.com>
On 18/03/2021 17:06, Florian Weimer via Libc-alpha wrote:
> This turned out to be way harder than it should be. Older binutils does
> not support multiple .symver directives for the same first symbol, so we
> have various kludges like (from time/clock_settime.c):
>
> | versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
> |
> | /* clock_settime moved to libc in version 2.17;
> | old binaries may expect the symbol version it had in librt. */
> | #if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
> | strong_alias (__clock_settime, __clock_settime_2);
> | compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
> | #endif
>
> I think I have found a way to do this with assembler hacks, so that it
> applies to function and data symbols alike. With this, the above
> snipper becomes:
>
> | versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
> |
> | /* clock_settime moved to libc in version 2.17;
> | old binaries may expect the symbol version it had in librt. */
> | #if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
> | compat_symbol (libc, __clock_settime, clock_settime, GLIBC_2_2);
> | #endif
>
> So the explicit aliases are gone.
>
> Built with build-many-glibcs.py with binutils 2.36 and 2.34. Tested on
> i686-linux-gnu and x86_64-linux-gnu with binutils 2.34 and 2.35.
>
> The object files aren't unchanged due to the __malloc_initialize_hook
> change (and presumably others, I haven't looked closely).
Thanks for working on this, I have checked on the all architectures that
generated abilist and I saw not regression on a make check (with
run-built-tests=no).
The only detail I am not sure is if SYMVER_NEEDS_ALIAS does yields any
substantial gain (and it require some refactoring and code to handle it).
What kind of improvement do you expect?
next prev parent reply other threads:[~2021-03-19 19:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 20:06 Florian Weimer
2021-03-18 20:07 ` [RFC 1/2] Change how the symbol_version_reference macro is defined Florian Weimer
2021-03-19 18:47 ` Adhemerval Zanella
2021-03-18 20:07 ` [RFC 2/2] Fold compat_symbol_unique functionality into compat_symbol Florian Weimer
2021-03-18 21:37 ` Joseph Myers
2021-03-19 18:59 ` Adhemerval Zanella
2021-03-19 19:13 ` Florian Weimer
2021-03-19 19:34 ` Adhemerval Zanella
2021-03-19 20:10 ` Adhemerval Zanella
2021-03-19 20:17 ` Florian Weimer
2021-03-19 20:26 ` Adhemerval Zanella
2021-03-19 20:29 ` Florian Weimer
2021-03-19 20:33 ` Adhemerval Zanella
2021-03-19 20:33 ` Adhemerval Zanella
2021-03-19 19:02 ` Adhemerval Zanella [this message]
2021-03-19 19:14 ` [RFC 0/2] Transparent multi-version symbol support Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e3b600df-924b-aec6-f361-07f69b269e1d@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).