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: Andreas Schwab <schwab at linux-m68k dot org>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Mon, 13 Jan 2014 14:09:38 +0100
- 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>
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."