This is the mail archive of the libc-alpha@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]

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


On 13-01-2014 12:36, Adhemerval Zanella wrote:
> 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.
>>
> Indeed, I'll change it on my patch. Thanks.
>
Andreas, wich such change is that ok to commit?


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