5de29b
# commit 9b874b2f1eb2550e39d3e9c38772e64a767e9de2
5de29b
# Author: Alan Modra <amodra@gmail.com>
5de29b
# Date:   Sat Aug 17 18:35:40 2013 +0930
5de29b
# 
5de29b
#     PowerPC ugly symbol versioning
5de29b
#     http://sourceware.org/ml/libc-alpha/2013-08/msg00090.html
5de29b
#     
5de29b
#     This patch fixes symbol versioning in setjmp/longjmp.  The existing
5de29b
#     code uses raw versions, which results in wrong symbol versioning when
5de29b
#     you want to build glibc with a base version of 2.19 for LE.
5de29b
#     
5de29b
#     Note that the merging the 64-bit and 32-bit versions in novmx-lonjmp.c
5de29b
#     and pt-longjmp.c doesn't result in GLIBC_2.0 versions for 64-bit, due
5de29b
#     to the base in shlib_versions.
5de29b
#     
5de29b
#         * sysdeps/powerpc/longjmp.c: Use proper symbol versioning macros.
5de29b
#         * sysdeps/powerpc/novmx-longjmp.c: Likewise.
5de29b
#         * sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise.
5de29b
#         * sysdeps/powerpc/powerpc32/bsd-setjmp.S: Likewise.
5de29b
#         * sysdeps/powerpc/powerpc32/fpu/__longjmp.S: Likewise.
5de29b
#         * sysdeps/powerpc/powerpc32/fpu/setjmp.S: Likewise.
5de29b
#         * sysdeps/powerpc/powerpc32/mcount.c: Likewise.
5de29b
#         * sysdeps/powerpc/powerpc32/setjmp.S: Likewise.
5de29b
#         * sysdeps/powerpc/powerpc64/setjmp.S: Likewise.
5de29b
#         * nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Likewise.
5de29b
# 
12745e
diff -urN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
12745e
--- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c	2014-05-27 23:22:12.000000000 -0500
12745e
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c	2014-05-27 23:23:44.000000000 -0500
5de29b
@@ -41,13 +41,8 @@
5de29b
   __novmx__libc_longjmp (env, val);
5de29b
 }
5de29b
 
5de29b
-# if __WORDSIZE == 64
5de29b
-symbol_version (__novmx_longjmp,longjmp,GLIBC_2.3);
5de29b
-symbol_version (__novmx_siglongjmp,siglongjmp,GLIBC_2.3);
5de29b
-# else
5de29b
-symbol_version (__novmx_longjmp,longjmp,GLIBC_2.0);
5de29b
-symbol_version (__novmx_siglongjmp,siglongjmp,GLIBC_2.0);
5de29b
-# endif
5de29b
+compat_symbol (libpthread, __novmx_longjmp, longjmp, GLIBC_2_0);
5de29b
+compat_symbol (libpthread, __novmx_siglongjmp, siglongjmp, GLIBC_2_0);
5de29b
 #endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4))  */ 
5de29b
 
5de29b
 void
5de29b
@@ -62,5 +57,5 @@
5de29b
   __libc_siglongjmp (env, val);
5de29b
 }
5de29b
 
5de29b
-versioned_symbol (libc, __vmx_longjmp, longjmp, GLIBC_2_3_4);
5de29b
-versioned_symbol (libc, __vmx_siglongjmp, siglongjmp, GLIBC_2_3_4);
5de29b
+versioned_symbol (libpthread, __vmx_longjmp, longjmp, GLIBC_2_3_4);
5de29b
+versioned_symbol (libpthread, __vmx_siglongjmp, siglongjmp, GLIBC_2_3_4);
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/longjmp.c glibc-2.17-c758a686/sysdeps/powerpc/longjmp.c
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/longjmp.c	2014-05-27 23:22:10.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/longjmp.c	2014-05-27 23:22:12.000000000 -0500
5de29b
@@ -56,6 +56,6 @@
5de29b
 
5de29b
 default_symbol_version (__vmx__libc_longjmp, __libc_longjmp, GLIBC_PRIVATE);
5de29b
 default_symbol_version (__vmx__libc_siglongjmp, __libc_siglongjmp, GLIBC_PRIVATE);
5de29b
-default_symbol_version (__vmx_longjmp, _longjmp, GLIBC_2.3.4);
5de29b
-default_symbol_version (__vmxlongjmp, longjmp, GLIBC_2.3.4);
5de29b
-default_symbol_version (__vmxsiglongjmp, siglongjmp, GLIBC_2.3.4);
5de29b
+versioned_symbol (libc, __vmx_longjmp, _longjmp, GLIBC_2_3_4);
5de29b
+versioned_symbol (libc, __vmxlongjmp, longjmp, GLIBC_2_3_4);
5de29b
+versioned_symbol (libc, __vmxsiglongjmp, siglongjmp, GLIBC_2_3_4);
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/novmx-longjmp.c glibc-2.17-c758a686/sysdeps/powerpc/novmx-longjmp.c
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/novmx-longjmp.c	2014-05-27 23:22:10.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/novmx-longjmp.c	2014-05-27 23:22:12.000000000 -0500
5de29b
@@ -51,13 +51,7 @@
5de29b
 weak_alias (__novmx__libc_siglongjmp, __novmxlongjmp)
5de29b
 weak_alias (__novmx__libc_siglongjmp, __novmxsiglongjmp)
5de29b
 
5de29b
-# if __WORDSIZE == 64
5de29b
-symbol_version (__novmx_longjmp,_longjmp,GLIBC_2.3);
5de29b
-symbol_version (__novmxlongjmp,longjmp,GLIBC_2.3);
5de29b
-symbol_version (__novmxsiglongjmp,siglongjmp,GLIBC_2.3);
5de29b
-# else
5de29b
-symbol_version (__novmx_longjmp,_longjmp,GLIBC_2.0);
5de29b
-symbol_version (__novmxlongjmp,longjmp,GLIBC_2.0);
5de29b
-symbol_version (__novmxsiglongjmp,siglongjmp,GLIBC_2.0);
5de29b
-# endif
5de29b
+compat_symbol (libc, __novmx_longjmp, _longjmp, GLIBC_2_0);
5de29b
+compat_symbol (libc, __novmxlongjmp, longjmp, GLIBC_2_0);
5de29b
+compat_symbol (libc, __novmxsiglongjmp, siglongjmp, GLIBC_2_0);
5de29b
 #endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4))  */
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-_setjmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-_setjmp.S	2014-05-27 23:22:10.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-_setjmp.S	2014-05-27 23:22:12.000000000 -0500
5de29b
@@ -32,7 +32,7 @@
5de29b
 /* Build a versioned object for libc.  */
5de29b
 
5de29b
 # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
5de29b
-symbol_version (__novmx_setjmp,_setjmp,GLIBC_2.0);
5de29b
+compat_symbol (libc, __novmx_setjmp, _setjmp, GLIBC_2_0);
5de29b
 
5de29b
 ENTRY (BP_SYM (__novmx_setjmp))
5de29b
 	li r4,0			/* Set second argument to 0.  */
5de29b
@@ -41,7 +41,7 @@
5de29b
 libc_hidden_def (__novmx_setjmp)
5de29b
 # endif /* defined SHARED  && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) */
5de29b
 
5de29b
-default_symbol_version (__vmx_setjmp,_setjmp,GLIBC_2.3.4)
5de29b
+versioned_symbol (libc, __vmx_setjmp, _setjmp, GLIBC_2_3_4)
5de29b
 /* __GI__setjmp prototype is needed for ntpl i.e. _setjmp is defined
5de29b
    as a libc_hidden_proto & is used in sysdeps/generic/libc-start.c
5de29b
    if HAVE_CLEANUP_JMP_BUF is defined */
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S	2014-05-27 23:22:10.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S	2014-05-27 23:22:12.000000000 -0500
5de29b
@@ -27,7 +27,7 @@
5de29b
 	b __novmx__sigsetjmp@local
5de29b
 END (__novmxsetjmp)
5de29b
 strong_alias (__novmxsetjmp, __novmx__setjmp)
5de29b
-symbol_version (__novmxsetjmp, setjmp, GLIBC_2.0)
5de29b
+compat_symbol (libc, __novmxsetjmp, setjmp, GLIBC_2_0)
5de29b
 
5de29b
 #endif  /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) ) */
5de29b
 
5de29b
@@ -37,4 +37,4 @@
5de29b
 END (__vmxsetjmp)
5de29b
 strong_alias (__vmxsetjmp, __vmx__setjmp)
5de29b
 strong_alias (__vmx__setjmp, __setjmp)
5de29b
-default_symbol_version (__vmxsetjmp,setjmp,GLIBC_2.3.4)
5de29b
+versioned_symbol (libc, __vmxsetjmp, setjmp, GLIBC_2_3_4)
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp.S	2014-05-27 23:22:10.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp.S	2014-05-27 23:22:12.000000000 -0500
5de29b
@@ -26,14 +26,14 @@
5de29b
 
5de29b
 #else /* !NOT_IN_libc */
5de29b
 /* Build a versioned object for libc.  */
5de29b
-default_symbol_version (__vmx__longjmp,__longjmp,GLIBC_2.3.4);
5de29b
+versioned_symbol (libc, __vmx__longjmp, __longjmp, GLIBC_2_3_4);
5de29b
 # define __longjmp  __vmx__longjmp
5de29b
 # include "__longjmp-common.S"
5de29b
 
5de29b
 # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
5de29b
 #  define __NO_VMX__
5de29b
 #  undef JB_SIZE
5de29b
-symbol_version (__novmx__longjmp,__longjmp,GLIBC_2.0);
5de29b
+compat_symbol (libc, __novmx__longjmp, __longjmp, GLIBC_2_0);
5de29b
 #  undef __longjmp
5de29b
 #  define __longjmp  __novmx__longjmp
5de29b
 #  include "__longjmp-common.S"
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp.S
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp.S	2014-05-27 23:22:10.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp.S	2014-05-27 23:22:12.000000000 -0500
5de29b
@@ -26,7 +26,7 @@
5de29b
 
5de29b
 #else /* !NOT_IN_libc */
5de29b
 /* Build a versioned object for libc.  */
5de29b
-default_symbol_version (__vmx__sigsetjmp,__sigsetjmp,GLIBC_2.3.4)
5de29b
+versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4)
5de29b
 # define __sigsetjmp __vmx__sigsetjmp
5de29b
 # define __sigjmp_save __vmx__sigjmp_save
5de29b
 # include "setjmp-common.S"
5de29b
@@ -36,7 +36,7 @@
5de29b
 #  undef __sigsetjmp
5de29b
 #  undef __sigjmp_save
5de29b
 #  undef JB_SIZE
5de29b
-symbol_version (__novmx__sigsetjmp,__sigsetjmp,GLIBC_2.0)
5de29b
+compat_symbol (libc, __novmx__sigsetjmp, __sigsetjmp, GLIBC_2_0)
5de29b
 #  define __sigsetjmp __novmx__sigsetjmp
5de29b
 #  define __sigjmp_save __novmx__sigjmp_save
5de29b
 #  include "setjmp-common.S"
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/mcount.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/mcount.c
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/mcount.c	2014-05-27 23:22:10.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/mcount.c	2014-05-27 23:22:12.000000000 -0500
5de29b
@@ -9,7 +9,7 @@
5de29b
 /* __mcount_internal was added in glibc 2.15 with version GLIBC_PRIVATE,
5de29b
    but it should have been put in version GLIBC_2.15.  Mark the
5de29b
    GLIBC_PRIVATE version obsolete and add it to GLIBC_2.16 instead.  */
5de29b
-default_symbol_version (___mcount_internal, __mcount_internal, GLIBC_2.16);
5de29b
+versioned_symbol (libc, ___mcount_internal, __mcount_internal, GLIBC_2_16);
5de29b
 
5de29b
 #if SHLIB_COMPAT (libc, GLIBC_2_15, GLIBC_2_16)
5de29b
 strong_alias (___mcount_internal, ___mcount_internal_private);
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S	2014-05-27 23:22:10.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/setjmp.S	2014-05-27 23:22:12.000000000 -0500
5de29b
@@ -25,7 +25,7 @@
5de29b
 
5de29b
 #else /* !NOT_IN_libc */
5de29b
 /* Build a versioned object for libc.  */
5de29b
-default_symbol_version (__vmx__sigsetjmp,__sigsetjmp,GLIBC_2.3.4)
5de29b
+versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4)
5de29b
 # define __sigsetjmp __vmx__sigsetjmp
5de29b
 # define __sigjmp_save __vmx__sigjmp_save
5de29b
 # include "setjmp-common.S"
5de29b
@@ -35,7 +35,7 @@
5de29b
 #  undef __sigsetjmp
5de29b
 #  undef __sigjmp_save
5de29b
 #  undef JB_SIZE
5de29b
-symbol_version (__novmx__sigsetjmp,__sigsetjmp,GLIBC_2.0)
5de29b
+compat_symbol (libc, __novmx__sigsetjmp, __sigsetjmp, GLIBC_2_0)
5de29b
 #  define __sigsetjmp __novmx__sigsetjmp
5de29b
 #  define __sigjmp_save __novmx__sigjmp_save
5de29b
 #  include "setjmp-common.S"
12745e
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp.S
12745e
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp.S	2014-05-27 23:22:10.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp.S	2014-05-27 23:22:12.000000000 -0500
5de29b
@@ -26,9 +26,9 @@
5de29b
 
5de29b
 #else /* !NOT_IN_libc */
5de29b
 /* Build a versioned object for libc.  */
5de29b
-default_symbol_version (__vmxsetjmp, setjmp, GLIBC_2.3.4)
5de29b
-default_symbol_version (__vmx_setjmp,_setjmp,GLIBC_2.3.4)
5de29b
-default_symbol_version (__vmx__sigsetjmp,__sigsetjmp,GLIBC_2.3.4)
5de29b
+versioned_symbol (libc, __vmxsetjmp, setjmp, GLIBC_2_3_4)
5de29b
+versioned_symbol (libc, __vmx_setjmp, _setjmp, GLIBC_2_3_4)
5de29b
+versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4)
5de29b
 # define setjmp __vmxsetjmp
5de29b
 # define _setjmp __vmx_setjmp
5de29b
 # define __sigsetjmp __vmx__sigsetjmp
5de29b
@@ -44,9 +44,9 @@
5de29b
 #  undef __sigjmp_save
5de29b
 #  undef JB_SIZE
5de29b
 #  define __NO_VMX__
5de29b
-symbol_version (__novmxsetjmp, setjmp, GLIBC_2.3)
5de29b
-symbol_version (__novmx_setjmp,_setjmp,GLIBC_2.3);
5de29b
-symbol_version (__novmx__sigsetjmp,__sigsetjmp,GLIBC_2.3)
5de29b
+compat_symbol (libc, __novmxsetjmp, setjmp, GLIBC_2_3)
5de29b
+compat_symbol (libc, __novmx_setjmp,_setjmp, GLIBC_2_3);
5de29b
+compat_symbol (libc, __novmx__sigsetjmp,__sigsetjmp, GLIBC_2_3)
5de29b
 #  define setjmp __novmxsetjmp
5de29b
 #  define _setjmp __novmx_setjmp
5de29b
 #  define __sigsetjmp __novmx__sigsetjmp