[PATCH] PowerPC: Fix ftime gettimeofday internal call returning bogus

Adhemerval Zanella azanella@linux.vnet.ibm.com
Thu Jan 16 13:18:00 GMT 2014


On 13-01-2014 11:09, Andreas Schwab wrote:
> Adhemerval Zanella <azanella@linux.vnet.ibm.com> writes:
>
>> diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c
>> index 089d0b6..ab53fd9 100644
>> --- a/sysdeps/unix/sysv/linux/powerpc/time.c
>> +++ b/sysdeps/unix/sysv/linux/powerpc/time.c
>> @@ -54,8 +54,24 @@ asm (".type time, %gnu_indirect_function");
>>  /* This is doing "libc_hidden_def (time)" but the compiler won't
>>   * let us do it in C because it doesn't know we're defining time
>>   * here in this file.  */
>> -asm (".globl __GI_time\n"
>> -     "__GI_time = time");
>> +asm (".globl __GI_time");
>> +
>> +/* __GI_time is defined as hidden and for ppc32 it enables the
>> +   compiler make a local call (symbol@local) for internal GLIBC usage. It
>> +   means the PLT won't be used and the ifunc resolver will be called directly.
>> +   For ppc64 a call to a function in another translation unit might use a
>> +   different toc pointer thus disallowing direct branchess and making internal
>> +   ifuncs calls safe.  */
>> +#ifdef __powerpc64__
>> +asm ("__GI_time = time");
>> +#else
>> +time_t
>> +time_vsyscall (time_t *t)
> I think you want to use __time_vsyscall here.
>
> Andreas.
>
Pushed upstream as 736c304a1ab4cee36a2f3343f1698bc0abae4608 . I will leave the
bug open to remind me to add a testcase for 2.20, while stills mentions it as fixed on NEWS.



More information about the Libc-alpha mailing list