This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc generated memcpy calls symbol version
- From: Tom Mason <wheybags at wheybags dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Sat, 27 Jan 2018 13:26:33 +0000
- Subject: Re: gcc generated memcpy calls symbol version
- Authentication-results: sourceware.org; auth=none
- References: <CAMK3W+RvVk5n0GWwua9V=PrytHecLVN9vqhyR8+_WBzYype2eg@mail.gmail.com> <CAMe9rOrF55oH=9J0PsfLT+8vHJP-9eTV9Hj9kWh1arGUSu1Jsw@mail.gmail.com> <CAMK3W+SWNDpZAsP_mMBosG8Z0Q0mZk50zYviPztcw7Ndh9sGQg@mail.gmail.com> <CAMe9rOqN864b_qiLfGa9S-RPiZWPGn=2xKUvm0m8JR4C936r7Q@mail.gmail.com>
Actually, never mind, it's working fine:
https://gist.github.com/wheybags/b7e4152daf76c72503e9e1f52f3dca3d and I
have some other problem.
On Fri, Jan 26, 2018 at 9:22 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Jan 26, 2018 at 1:17 PM, Tom Mason <wheybags@wheybags.com> wrote:
> > I'm not entirely sure I understand that issue. From what I understand,
> calls
> > to a function in a shared library should always use the PLT?
> > Also, I don't understand the purpose of applying hidden visibility to an
> > extern symbol,
>
> There is no need for PLT since hidden symbol is defined locally. But
> GCC ignores hidden visibility for libcalls, like memcpy. If GCC treats
> them like normal calls, your scheme and my testcase should work.
>
>
> > But anyway, doesn't matter terribly much if I understand :p
> >
> > On Fri, Jan 26, 2018 at 8:37 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> >>
> >> On Fri, Jan 26, 2018 at 12:29 PM, Tom Mason <wheybags@wheybags.com>
> wrote:
> >> > Hi,
> >> > I've got a project here:
> >> > https://github.com/wheybags/glibc_version_header
> >> > which uses .symver directives to link to a specified version of glibc,
> >> > so
> >> > long as it's older than the version on your system.
> >> > This works, but a problem I'm having is that gcc itself will sometimes
> >> > insert calls to memcpy (or memmove, memset and memcmp), as documented
> >> > here:
> >> > https://gcc.gnu.org/onlinedocs/gcc/Standards.html
> >> > When it does so, it doesn't respect the .symver directives, and uses
> the
> >> > default version.
> >> > Is there any way for me to force the version for these symbols aswell?
> >> > I'm aware that I can disable the whole mechanism with -freestanding,
> but
> >> > I
> >> > don't want to cripple the optimiser.
> >>
> >> I think this is related to:
> >>
> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67220
> >>
> >> --
> >> H.J.
> >
> >
>
>
>
> --
> H.J.
>