5de29b
# commit 02f04a6c7fea2b474b026bbce721d8c658d71fda
5de29b
# Author: Alan Modra <amodra@gmail.com>
5de29b
# Date:   Sat Aug 17 18:36:11 2013 +0930
5de29b
# 
5de29b
#     PowerPC LE _dl_hwcap access
5de29b
#     http://sourceware.org/ml/libc-alpha/2013-08/msg00091.html
5de29b
#     
5de29b
#     More LE support, correcting word accesses to _dl_hwcap.
5de29b
#     
5de29b
#         * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Use
5de29b
#         HIWORD/LOWORD.
5de29b
#         * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Ditto.
5de29b
#         * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Ditto.
5de29b
# 
12745e
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
12745e
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S	2014-05-27 23:25:35.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S	2014-05-27 23:25:38.000000000 -0500
5de29b
@@ -151,15 +151,15 @@
5de29b
 #   ifdef SHARED
5de29b
 	lwz     r7,_rtld_global_ro@got(r7)
5de29b
 	mtlr    r8
5de29b
-	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
5de29b
+	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7)
5de29b
 #   else
5de29b
 	lwz     r7,_dl_hwcap@got(r7)
5de29b
 	mtlr    r8
5de29b
-	lwz     r7,4(r7)
5de29b
+	lwz     r7,LOWORD(r7)
5de29b
 #   endif
5de29b
 #  else
5de29b
-	lis	r7,(_dl_hwcap+4)@ha
5de29b
-	lwz     r7,(_dl_hwcap+4)@l(r7)
5de29b
+	lis	r7,(_dl_hwcap+LOWORD)@ha
5de29b
+	lwz     r7,(_dl_hwcap+LOWORD)@l(r7)
5de29b
 #  endif
5de29b
 	andis.	r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
5de29b
 
12745e
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
12745e
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S	2014-05-27 23:25:35.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S	2014-05-27 23:25:38.000000000 -0500
5de29b
@@ -79,15 +79,15 @@
5de29b
 # ifdef SHARED
5de29b
 	lwz     r7,_rtld_global_ro@got(r7)
5de29b
 	mtlr    r8
5de29b
-	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
5de29b
+	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7)
5de29b
 # else
5de29b
 	lwz     r7,_dl_hwcap@got(r7)
5de29b
 	mtlr    r8
5de29b
-	lwz     r7,4(r7)
5de29b
+	lwz     r7,LOWORD(r7)
5de29b
 # endif
5de29b
 #else
5de29b
-	lis	r7,(_dl_hwcap+4)@ha
5de29b
-	lwz     r7,(_dl_hwcap+4)@l(r7)
5de29b
+	lis	r7,(_dl_hwcap+LOWORD)@ha
5de29b
+	lwz     r7,(_dl_hwcap+LOWORD)@l(r7)
5de29b
 #endif
5de29b
 
5de29b
 #ifdef __CONTEXT_ENABLE_FPRS
12745e
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
12745e
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S	2014-05-27 23:25:35.000000000 -0500
12745e
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S	2014-05-27 23:25:38.000000000 -0500
5de29b
@@ -152,15 +152,15 @@
5de29b
 #  ifdef SHARED
5de29b
 	lwz     r7,_rtld_global_ro@got(r7)
5de29b
 	mtlr    r8
5de29b
-	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
5de29b
+	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7)
5de29b
 #  else
5de29b
 	lwz     r7,_dl_hwcap@got(r7)
5de29b
 	mtlr    r8
5de29b
-	lwz     r7,4(r7)
5de29b
+	lwz     r7,LOWORD(r7)
5de29b
 #  endif
5de29b
 # else
5de29b
-	lis	r7,(_dl_hwcap+4)@ha
5de29b
-	lwz     r7,(_dl_hwcap+4)@l(r7)
5de29b
+	lis	r7,(_dl_hwcap+LOWORD)@ha
5de29b
+	lwz     r7,(_dl_hwcap+LOWORD)@l(r7)
5de29b
 # endif
5de29b
 
5de29b
 # ifdef __CONTEXT_ENABLE_VRS
5de29b
@@ -308,14 +308,14 @@
5de29b
 	mtlr    r8
5de29b
 #   ifdef SHARED
5de29b
 	lwz     r7,_rtld_global_ro@got(r7)
5de29b
-	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
5de29b
+	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7)
5de29b
 #   else
5de29b
 	lwz     r7,_dl_hwcap@got(r7)
5de29b
-	lwz     r7,4(r7)
5de29b
+	lwz     r7,LOWORD(r7)
5de29b
 #   endif
5de29b
 #  else
5de29b
-	lis	r7,(_dl_hwcap+4)@ha
5de29b
-	lwz     r7,(_dl_hwcap+4)@l(r7)
5de29b
+	lis	r7,(_dl_hwcap+LOWORD)@ha
5de29b
+	lwz     r7,(_dl_hwcap+LOWORD)@l(r7)
5de29b
 #  endif
5de29b
 	andis.	r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
5de29b
 	la	r10,(_UC_VREGS)(r31)