[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r5916 - in glibc-package/branches/eglibc-2.18/debian: . patches patches/powerpc



Author: adconrad
Date: 2014-01-17 20:16:41 +0000 (Fri, 17 Jan 2014)
New Revision: 5916

Added:
   glibc-package/branches/eglibc-2.18/debian/patches/powerpc/cvs-gettimeofday-32.diff
Removed:
   glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-32.diff
Modified:
   glibc-package/branches/eglibc-2.18/debian/changelog
   glibc-package/branches/eglibc-2.18/debian/patches/series
Log:
debian/patches/powerpc/cvs-gettimeofday-32.diff: Replace the submitted
version of this patch with the upstream commit, which also fixes time.

Modified: glibc-package/branches/eglibc-2.18/debian/changelog
===================================================================
--- glibc-package/branches/eglibc-2.18/debian/changelog	2014-01-14 22:17:19 UTC (rev 5915)
+++ glibc-package/branches/eglibc-2.18/debian/changelog	2014-01-17 20:16:41 UTC (rev 5916)
@@ -6,6 +6,8 @@
     from upstream to allow building longjmp and sigsetjmp code with Thumb.
   * debian/patches/arm/cvs-arm-pointer-mangle-frame.diff: Upstream diff to
     no longer apply pointer encryption to the frame pointer (LP: #1268937)
+  * debian/patches/powerpc/cvs-gettimeofday-32.diff: Replace the submitted
+    version of this patch with the upstream commit, which also fixes time.
 
   [ Aurelien Jarno ]
   * debian/testsuite-checking/expected-results-mips*: Update following

Added: glibc-package/branches/eglibc-2.18/debian/patches/powerpc/cvs-gettimeofday-32.diff
===================================================================
--- glibc-package/branches/eglibc-2.18/debian/patches/powerpc/cvs-gettimeofday-32.diff	                        (rev 0)
+++ glibc-package/branches/eglibc-2.18/debian/patches/powerpc/cvs-gettimeofday-32.diff	2014-01-17 20:16:41 UTC (rev 5916)
@@ -0,0 +1,86 @@
+commit 736c304a1ab4cee36a2f3343f1698bc0abae4608
+Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+Date:   Thu Jan 16 06:53:18 2014 -0600
+
+    PowerPC: Fix ftime gettimeofday internal call returning bogus data
+    
+    This patches fixes BZ#16430 by setting a different symbol for internal
+    GLIBC calls that points to ifunc resolvers. For PPC32, if the symbol
+    is defined as hidden (which is the case for gettimeofday and time) the
+    compiler will create local branches (symbol@local) and linker will not
+    create PLT calls (required for IFUNC). This will leads to internal symbol
+    calling the IFUNC resolver instead of the resolved symbol.
+    For PPC64 this behavior does not occur because a call to a function in
+    another translation unit might use a different toc pointer thus requiring
+    a PLT call.
+
+2014-01-16  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	[BZ#16430]
+	* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+	(__GI___gettimeofday): Alias for a different internal symbol to avoid
+	local calls issues by not having a PLT stub required for IFUNC calls.
+	* sysdeps/unix/sysv/linux/powerpc/time.c (__GI_time): Likewise.
+
+diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+index 29a5e08..2085b68 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
++++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+@@ -44,8 +44,24 @@ asm (".type __gettimeofday, %gnu_indirect_function");
+ /* This is doing "libc_hidden_def (__gettimeofday)" but the compiler won't
+    let us do it in C because it doesn't know we're defining __gettimeofday
+    here in this file.  */
+-asm (".globl __GI___gettimeofday\n"
+-     "__GI___gettimeofday = __gettimeofday");
++asm (".globl __GI___gettimeofday");
++
++/* __GI___gettimeofday 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___gettimeofday = __gettimeofday");
++#else
++int
++__gettimeofday_vsyscall (struct timeval *tv, struct timezone *tz)
++{
++  return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
++}
++asm ("__GI___gettimeofday = __gettimeofday_vsyscall");
++#endif
+ 
+ #else
+ 
+diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c
+index 089d0b6..023bc02 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)
++{
++  return INLINE_VSYSCALL (time, 1, t);
++}
++asm ("__GI_time = __time_vsyscall");
++#endif
+ 
+ #else
+ 

Deleted: glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-32.diff
===================================================================
--- glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-32.diff	2014-01-14 22:17:19 UTC (rev 5915)
+++ glibc-package/branches/eglibc-2.18/debian/patches/powerpc/submitted-gettimeofday-32.diff	2014-01-17 20:16:41 UTC (rev 5916)
@@ -1,41 +0,0 @@
-From 2d3f338fde5f73f42fce8f2167b15f9f4bd7e3a2 Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
-Date: Fri, 10 Jan 2014 10:28:42 -0600
-Subject: [PATCH 2/2] PowerPC: Fix gettimeofday internal call
-
-This patch fixes GLIBC internal call of gettimeofday for PPC32. The
-ppc32 build does not generate PLT calls for internal symbols, so
-__gettimeofday calls end up being calling the IFUNC resolver instead
-of the resolved symbol. This patches its behaviour by setting internal
-call to internal function that correctly calls gettimeofday functions.
----
- sysdeps/unix/sysv/linux/powerpc/gettimeofday.c | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
-index a90fd3e..802a43c 100644
---- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
-+++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
-@@ -49,8 +49,18 @@ asm (".type __gettimeofday, %gnu_indirect_function");
- /* This is doing "libc_hidden_def (__gettimeofday)" but the compiler won't
-    let us do it in C because it doesn't know we're defining __gettimeofday
-    here in this file.  */
--asm (".globl __GI___gettimeofday\n"
--     "__GI___gettimeofday = __gettimeofday");
-+asm (".globl __GI___gettimeofday");
-+
-+#ifdef __powerpc64__
-+asm ("__GI___gettimeofday = __gettimeofday");
-+#else
-+int
-+__gettimeofday_vsyscall (struct timeval *tv, struct timezone *tz)
-+{
-+  return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
-+}
-+asm ("__GI___gettimeofday = __gettimeofday_vsyscall");
-+#endif
- 
- #else
- 
--- 
-1.8.4

Modified: glibc-package/branches/eglibc-2.18/debian/patches/series
===================================================================
--- glibc-package/branches/eglibc-2.18/debian/patches/series	2014-01-14 22:17:19 UTC (rev 5915)
+++ glibc-package/branches/eglibc-2.18/debian/patches/series	2014-01-17 20:16:41 UTC (rev 5916)
@@ -183,7 +183,7 @@
 powerpc/local-math-logb.diff
 powerpc/cvs-ppc64-vdso-ifunc.diff
 powerpc/submitted-gettimeofday-vdso.diff
-powerpc/submitted-gettimeofday-32.diff
+powerpc/cvs-gettimeofday-32.diff
 
 s390/submitted-nexttowardf.diff
 s390/cvs-s390-tls-got-pointer.diff


Reply to: