This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] PowerPC: Fix ftime gettimeofday internal call returning bogus
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Thu, 16 Jan 2014 11:17:48 -0200
- Subject: Re: [PATCH] PowerPC: Fix ftime gettimeofday internal call returning bogus
- Authentication-results: sourceware.org; auth=none
- References: <52D3D883 dot 3030707 at linux dot vnet dot ibm dot com> <87mwj02fl9 dot fsf at igel dot home>
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.