This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] Prevent tailcall optimizations of libdl functions
On Wed, Jan 25, 2017 at 2:34 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Wed, 25 Jan 2017, Rich Felker wrote:
>
>> FWIW this technique is non-conforming, at least for any standard
>> functions it's used on, since it breaks pointer equality. A conforming
>> program can evaluate p1==p2, where p1=dlsym is assigned in one dso and
>> p2=dlsym is assigned in another, and must see equality on a conforming
>> implementation. As such I think this hack needs to be removed from
>> other functions like stat.
>
> A conforming program does not use shared libraries other than those
> provided by the system and POSIX does not define any way to build shared
> libraries. If shared libraries are supported as an extension, ISO C and
> POSIX impose no requirements on how symbol resolution semantics when that
> feature is used might differ from symbol resolution semantics when only
> standard features are used.
>
> (I put stat in the category of "do this differently if we move to
> libc.so.7", i.e. replace the very old versioning mechanism by normal
> symbol versioning if making such an (unlikely) global ABI transition.)
FWIW it sounds like GCC attribute would be the most natural solution
(and probably also useful in other contexts). I'll try to cook a patch
for GCC if there are no objections.
-I