This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC 2/2] Update prototype of IFUNC resolver for MIPS
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Matthew Fortune <Matthew dot Fortune at imgtec dot com>, Ondřej Bílka <neleai at seznam dot cz>
- Cc: Faraz Shahbazker <Faraz dot Shahbazker at imgtec dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, Robert Suchanek <Robert dot Suchanek at imgtec dot com>
- Date: Mon, 14 Sep 2015 17:39:48 +0100
- Subject: Re: [RFC 2/2] Update prototype of IFUNC resolver for MIPS
- Authentication-results: sourceware.org; auth=none
- References: <55CE5217 dot 5020902 at imgtec dot com> <87io8f2gc9 dot fsf at googlemail dot com> <55D23368 dot 1070705 at imgtec dot com> <87io8dhegb dot fsf at googlemail dot com> <55D269D2 dot 2030208 at imgtec dot com> <87si7h6oyv dot fsf at googlemail dot com> <55D7A3C5 dot 8050600 at imgtec dot com> <87vbc7u1df dot fsf at googlemail dot com> <55E8C3C5 dot 8000107 at imgtec dot com> <55E99A04 dot 4050809 at arm dot com> <20150905053211 dot GA12405 at domone> <6D39441BF12EF246A7ABCE6654B02353212709C3 at LEMAIL01 dot le dot imgtec dot org>
On 14/09/15 15:33, Matthew Fortune wrote:
Ondřej Bílka <neleai@seznam.cz>
the ifunc situation is quite messy, is it supposed to be used outside
of the libc? (i know on x86, gcc target libs and function
multi-versioning use it, but i'd assume other targets would move away
from it outside the libc).
Yes, its public but there isn't clear whats allowed and what isn't.
Are you asking whether ifunc should be usable by an ordinary programmer in
their library? I'd say that it absolutely should be usable. We have some
yes
syntactic sugar in GCC to simplify defining ifuncs and for those who do
then they need to follow a few rules about what can and cannot be done in
i think the rules currently depend on dynamic
linker internals and are target specific.
(which is ok if ifunc is only used in the libc
but not ok if users write ifunc resolvers).
e.g. i don't see the fp registers saved/restored
in mips _dl_runtime_resolve, so the ifunc resolver
must not clobber fp (argument) regs.
(on x86 an ifunc resolver can clobber fp regs.)
a resolver. You could go as far as to say that the idea proposed in this
patch could be the only way for an ifunc resolver to do anything other than
plain C code. i.e. no library calls allowed but some services are exposed
via a dynamic linker callback.
if no library calls are allowed from a resolver
then the ifunc dispatch mechanism is limited,
if some libc calls are allowed then those should
be documented.
(some libc calls may be generated by the compiler
e.g. memcpy)
Thanks,
Matthew