[PATCH] PowerPC: Fix ftime gettimeofday internal call returning bogus
Andreas Schwab
schwab@linux-m68k.org
Mon Jan 13 13:09:00 GMT 2014
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.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
More information about the Libc-alpha
mailing list