On Fri, Sep 17, 2021 at 10:37 AM Florian Weimer <fwei...@redhat.com> wrote:
>
> * Richard Biener:
>
> > On Fri, Sep 17, 2021 at 10:08 AM Florian Weimer <fwei...@redhat.com> wrote:
> >>
> >> * Richard Biener via Gcc:
> >>
> >> > On Thu, Sep 16, 2021 at 10:36 PM Joseph Myers <jos...@codesourcery.com> 
> >> > wrote:
> >> >>
> >> >> On Thu, 16 Sep 2021, Chris Kennelly wrote:
> >> >>
> >> >> > In terms of relying on the feature:  If __memcmpeq is ever exposed as 
> >> >> > an a
> >> >> > simple alias for memcmp (since the notes mention that it's a valid
> >> >> > implementation), does that open up the possibility of depending on the
> >> >> > bcmp-like behavior that we were trying to escape?
> >> >>
> >> >> The proposal is as an ABI only (compilers would generate calls to
> >> >> __memcmpeq from boolean uses of memcmp, users wouldn't write calls to
> >> >> __memcmpeq directly, __memcmpeq wouldn't be declared in installed libc
> >> >> headers).  If such dependence arises, that would suggest a compiler bug
> >> >> wrongly generating such calls for non-boolean memcmp uses.
> >> >
> >> > So the compiler would emit a call to __memcmpeq and at the same time
> >> > emit a weak alias of __memcmpeq to memcmp so the program links
> >> > when the libc version targeted does not provide __memcmpeq?  Or would
> >> > glibc through <string.h> magically communicate the availability of the 
> >> > new ABI
> >> > without actually declaring the function?
> >>
> >> I do not think ELF provides that capability.
> >
> > I guess a weak forwarder should do the trick at the cost of a jmp.
>
> How would this look like in practice.
>
> The GNU tools do not support weak symbol versions, so if you have a weak
> reference to __memcmpeq@GLIBC_2.35, that's still a reference to the
> GLIBC_2.35 symbol version.  The glibc 2.34 dynamic loader notes that
> version and rejects the binary because GLIBC_2.35 does not exist.

Aww, symbol versions. Yeah, that makes it difficult ...

Anyway, with a declaration available it's good enough I think.

Richard.

> (We should probably stop Cc:ing libc-coord because this is so very
> GNU-specific at this point.)
>
> Thanks,
> Florian
>

Reply via email to