[PATCH 3/8] i386, x86: Use libc_ifunc macro for time, gettimeofday.
Stefan Liebler
stli@linux.vnet.ibm.com
Mon Jul 4 13:53:00 GMT 2016
On 07/04/2016 10:54 AM, Florian Weimer wrote:
> On 06/23/2016 01:55 PM, Stefan Liebler wrote:
>> This patch uses the libc_ifunc macro to create already existing ifunc
>> functions
>> time and gettimeofday on intel. This way, the libc_hidden_def macro
>> can be used
>> instead of the libc_ifunc_hidden_def one which was only used here.
>> Thus the
>> macro is removed from libc-symbols.h.
>> On i386, the __GI_* symbols do not target the ifunc symbol and thus the
>> redirection construct has to be applied here.
>
> I'm not sure if I understand what is going on here.
> sysdeps/unix/sysv/linux/x86/gettimeofday.c is compiled straight for
> x86_64, but wrapped on i386, right?
Yes you are right, e.g. ...:
-x86_64 compiles sysdeps/unix/sysv/linux/x86/gettimeofday.c
-i686 compiles sysdeps/unix/sysv/linux/i386/gettimeofday.c
>
> I wonder if it possible to avoid some of the preprocessor magic by
> introducing a separate x86_64 file.
Do you mean moving x86/gettimeofday.c to x86_64/gettimeofday.c
and get rid of #include <sysdeps/unix/sysv/linux/x86/gettimeofday.c>?
I think it won't save much of the preprocessor stuff.
The redirection of __gettimeofday in sys/time.h and the redifinition of
libc_hidden_def are needed.
We can only save the define/undef __gettimeofday around inclusion of
x86/gettimeofday.c. But then we have to duplicate the code.
In file sysdeps/unix/sysv/linux/i386/time.c we can't save anything.
>
> Thanks,
> Florian
>
The attached patch only updates the typo in ChangeLog.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-i386-x86-Use-libc_ifunc-macro-for-time-gettimeofday.patch
Type: text/x-patch
Size: 6282 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160704/d8ee2940/attachment.bin>
More information about the Libc-alpha
mailing list