about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc/powerpc32
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-08-17 18:36:45 +0930
committerAlan Modra <amodra@gmail.com>2013-10-04 10:38:59 +0930
commit0b2c2ace3601d5d59cf89130b16840e7f132f7a6 (patch)
tree0a96e682a1ff8f61773d41e00ba55485ee7d4c86 /sysdeps/unix/sysv/linux/powerpc/powerpc32
parent02f04a6c7fea2b474b026bbce721d8c658d71fda (diff)
downloadglibc-0b2c2ace3601d5d59cf89130b16840e7f132f7a6.tar.gz
glibc-0b2c2ace3601d5d59cf89130b16840e7f132f7a6.tar.xz
glibc-0b2c2ace3601d5d59cf89130b16840e7f132f7a6.zip
PowerPC makecontext
http://sourceware.org/ml/libc-alpha/2013-08/msg00092.html

Use conditional form of branch and link to avoid destroying the cpu
link stack used to predict blr return addresses.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S: Use
	conditional form of branch and link when obtaining pc.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc32')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S8
1 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
index 95902b13f9..70e3c97626 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
@@ -47,7 +47,9 @@ ENTRY(__makecontext)
 #ifdef PIC
 	mflr	r0
 	cfi_register(lr,r0)
-	bl	1f
+	/* Use this conditional form of branch and link to avoid destroying
+	   the cpu link stack used to predict blr return addresses.  */
+	bcl	20,31,1f
 1:	mflr	r6
 	addi	r6,r6,L(exitcode)-1b
 	mtlr	r0
@@ -136,7 +138,9 @@ ENTRY(__novec_makecontext)
 #ifdef PIC
 	mflr	r0
 	cfi_register(lr,r0)
-	bl	1f
+	/* Use this conditional form of branch and link to avoid destroying
+	   the cpu link stack used to predict blr return addresses.  */
+	bcl	20,31,1f
 1:	mflr	r6
 	addi	r6,r6,L(novec_exitcode)-1b
 	mtlr	r0