This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
IFUNCs used by libc.so.6 internally on x86-64
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 6 Feb 2017 13:53:11 +0100
- Subject: IFUNCs used by libc.so.6 internally on x86-64
- Authentication-results: sourceware.org; auth=none
I put a debug printf into IRELATIVE processing and resolved the
addresses using GDB. This way, I identified the following IFUNC-based
relocations within libc.so.6:
gettimeofday
memmove
strcasecmp
strcspn
strncasecmp
strpbrk
strspn
time
time and gettimeofday appear to be side effects of the use of vsyscalls.
clock_gettime is not in this list because there is no direct call to
the function in libc.so, I think. timespec_get could use it, but it
currently has INTERNAL_VSYSCALL instead.
The selection of string functions is rather curious. Were these choices
deliberate? Why memmove and not memcpy, for example?
Should we revisit our previous approach not to use IFUNCs within
libc.so? Not using IFUNCs means that we increase the icache footprint
because libc.so and and other code in the process use different
implementations. And if we want to optimize the callers of functions
which normally call those IFUNCs, we'd need to turn them into IFUNCs as
well. (IFUNCs are contagious in this way.)
Thanks,
Florian