From 02f04a6c7fea2b474b026bbce721d8c658d71fda Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 17 Aug 2013 18:36:11 +0930 Subject: [PATCH] PowerPC LE _dl_hwcap access http://sourceware.org/ml/libc-alpha/2013-08/msg00091.html More LE support, correcting word accesses to _dl_hwcap. * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Use HIWORD/LOWORD. * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Ditto. * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Ditto. --- ChangeLog | 7 +++++++ .../sysv/linux/powerpc/powerpc32/getcontext-common.S | 8 ++++---- .../sysv/linux/powerpc/powerpc32/setcontext-common.S | 8 ++++---- .../sysv/linux/powerpc/powerpc32/swapcontext-common.S | 16 ++++++++-------- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd5d1a1..ec81a6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2013-10-04 Alan Modra + * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Use + HIWORD/LOWORD. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Ditto. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Ditto. + +2013-10-04 Alan Modra + * sysdeps/powerpc/longjmp.c: Use proper symbol versioning macros. * sysdeps/powerpc/novmx-longjmp.c: Likewise. * sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise. diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S index 6330780..14f39d6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S @@ -151,15 +151,15 @@ ENTRY(__CONTEXT_FUNC_NAME) # ifdef SHARED lwz r7,_rtld_global_ro@got(r7) mtlr r8 - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) # else lwz r7,_dl_hwcap@got(r7) mtlr r8 - lwz r7,4(r7) + lwz r7,LOWORD(r7) # endif # else - lis r7,(_dl_hwcap+4)@ha - lwz r7,(_dl_hwcap+4)@l(r7) + lis r7,(_dl_hwcap+LOWORD)@ha + lwz r7,(_dl_hwcap+LOWORD)@l(r7) # endif andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16) diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S index bedebf0..f980d28 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S @@ -79,15 +79,15 @@ ENTRY(__CONTEXT_FUNC_NAME) # ifdef SHARED lwz r7,_rtld_global_ro@got(r7) mtlr r8 - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) # else lwz r7,_dl_hwcap@got(r7) mtlr r8 - lwz r7,4(r7) + lwz r7,LOWORD(r7) # endif #else - lis r7,(_dl_hwcap+4)@ha - lwz r7,(_dl_hwcap+4)@l(r7) + lis r7,(_dl_hwcap+LOWORD)@ha + lwz r7,(_dl_hwcap+LOWORD)@l(r7) #endif #ifdef __CONTEXT_ENABLE_FPRS diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S index 21c2e1f..90d7d72 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S @@ -152,15 +152,15 @@ ENTRY(__CONTEXT_FUNC_NAME) # ifdef SHARED lwz r7,_rtld_global_ro@got(r7) mtlr r8 - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) # else lwz r7,_dl_hwcap@got(r7) mtlr r8 - lwz r7,4(r7) + lwz r7,LOWORD(r7) # endif # else - lis r7,(_dl_hwcap+4)@ha - lwz r7,(_dl_hwcap+4)@l(r7) + lis r7,(_dl_hwcap+LOWORD)@ha + lwz r7,(_dl_hwcap+LOWORD)@l(r7) # endif # ifdef __CONTEXT_ENABLE_VRS @@ -308,14 +308,14 @@ ENTRY(__CONTEXT_FUNC_NAME) mtlr r8 # ifdef SHARED lwz r7,_rtld_global_ro@got(r7) - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) # else lwz r7,_dl_hwcap@got(r7) - lwz r7,4(r7) + lwz r7,LOWORD(r7) # endif # else - lis r7,(_dl_hwcap+4)@ha - lwz r7,(_dl_hwcap+4)@l(r7) + lis r7,(_dl_hwcap+LOWORD)@ha + lwz r7,(_dl_hwcap+LOWORD)@l(r7) # endif andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16) la r10,(_UC_VREGS)(r31) -- 2.7.4