This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/16585] dlsym() shouldn't be declared as leaf


https://sourceware.org/bugzilla/show_bug.cgi?id=16585

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugdal at aerifal dot cx

--- Comment #7 from Rich Felker <bugdal at aerifal dot cx> ---
It seems like a bug to me that dlsym is calling malloc. Whatever resources it
might need should already have been allocated as part of dlopen. The IFUNC
issue potentially remains, but really there should be formal restrictions on
what functions IFUNC resolvers are allowed to call; without that, I don't think
any code can be safe in the presence of IFUNCs unless the dynamic linker
resolves them all at load time rather than lazily (BTW, this would probably be
a good idea.)

As for working around the issue reported here, an alternate approach is calling
dlsym via a volatile function pointer with non-leaf type. This will ensure that
the compiler cannot optimize based on the leaf property.

Still, I agree dlsym is not a hot path, so the leaf property should probably
just be removed. See issue #14989 for details on why dlsym is _required_ to be
slow and how glibc is non-conforming in this regard.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]