about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-03-29 09:30:47 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-03-29 09:30:47 -0500
commit4a39ed05f9036246a32a2faddbb42b28c303bc91 (patch)
treedd7e0920487fdd30e1459e29131c66fe944b374b
parent254d12ecfcaff6f3240447269c5c4da7a7798a0a (diff)
downloadglibc-4a39ed05f9036246a32a2faddbb42b28c303bc91.tar.gz
glibc-4a39ed05f9036246a32a2faddbb42b28c303bc91.tar.xz
glibc-4a39ed05f9036246a32a2faddbb42b28c303bc91.zip
PowerPC32: Check _rtld_global_ro access value
-rw-r--r--sysdeps/powerpc/powerpc32/multiarch/memcpy.S7
1 files changed, 3 insertions, 4 deletions
diff --git a/sysdeps/powerpc/powerpc32/multiarch/memcpy.S b/sysdeps/powerpc/powerpc32/multiarch/memcpy.S
index 7547520299..794d2fbb81 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/memcpy.S
+++ b/sysdeps/powerpc/powerpc32/multiarch/memcpy.S
@@ -34,6 +34,8 @@ ENTRY(memcpy)
 	lwz	r6,_rtld_global_ro@got(r5)
 	mtlr	r11
 	cfi_same_value (lr)
+	cmpdi	r6,0
+	beq	L(ppc32)
 	lwz	r6,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r6)
 # else
 	lis	r6,(_dl_hwcap+4)@ha
@@ -48,6 +50,7 @@ ENTRY(memcpy)
 	bne-	L(power6)
 	andis.	r7,r6,(PPC_FEATURE_CELL_BE >> 16)
 	bne-	L(powerCELL)
+L(ppc32):
 # ifdef PIC
 	lwz	r3,__memcpy_ppc32@got(r5)
 # else
@@ -103,10 +106,6 @@ END(memcpy)
   cfi_endproc;                                                 \
   ASM_SIZE_DIRECTIVE(__memcpy_ppc32)
 
-# undef libc_hidden_builtin_def
-# define libc_hidden_builtin_def(name)                         \
-  .globl __GI_memcpy; __GI_memcpy = __memcpy_ppc32
-
 #endif
 
 #include "../memcpy.S"