This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26.9000-633-g174935a


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  174935af03f19e3fb5d5d3bcdafb25d0d8d6e0d4 (commit)
       via  750a0e4967375d0b2bedb77af515b8bc6966e6f6 (commit)
      from  5313581cb52fd5d3d2cf222ddb6f8f86f090974f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=174935af03f19e3fb5d5d3bcdafb25d0d8d6e0d4

commit 174935af03f19e3fb5d5d3bcdafb25d0d8d6e0d4
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Oct 23 07:44:50 2017 +1030

    PowerPC64 power8 strncpy cfi fixes
    
    cfi info for stack adjust needs to be on the insn doing the adjust.
    cfi describing register saves can be anywhere after the save insn but
    before the reg is altered.  Fewer locations with cfi result in smaller
    cfi programs and possibly slightly faster exception handling.  Thus
    the LR cfi_offset move.
    
    The idea behind ajusting sp after restoring regs is to break a
    register dependency chain, in this case not be using r1 immediately
    after it is modified.
    
    The missing LR cfi_restore meant that code after the blr,
    unaligned_lt_16 and other labels, would have cfi that said LR was at
    cfa+16, but that code is reached without LR being saved.
    
    	* sysdeps/powerpc/powerpc64/power8/strncpy.S: Move LR cfi.
    	Adjust stack after restoring regs.  Add missing LR cfi_restore.
    
    Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>

diff --git a/ChangeLog b/ChangeLog
index 444b639..677f46d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2017-10-23  Alan Modra  <amodra@gmail.com>
 
+	* sysdeps/powerpc/powerpc64/power8/strncpy.S: Move LR cfi.
+	Adjust stack after restoring regs.  Add missing LR cfi_restore.
+
+2017-10-23  Alan Modra  <amodra@gmail.com>
+
 	* sysdeps/powerpc/powerpc64/power7/strncpy.S: Decrease FRAMESIZE.
 	Move LR save and frame setup/teardown and LR restore to
 	immediately around memset call.  Provide cfi.
diff --git a/sysdeps/powerpc/powerpc64/power8/strncpy.S b/sysdeps/powerpc/powerpc64/power8/strncpy.S
index 150290a..c55e62d 100644
--- a/sysdeps/powerpc/powerpc64/power8/strncpy.S
+++ b/sysdeps/powerpc/powerpc64/power8/strncpy.S
@@ -241,23 +241,18 @@ L(zero_pad_start_1):
 	/* Save the link register.  */
 	mflr	r0
 	std	r0,16(r1)
-	cfi_offset(lr, 16)
 
 	/* Create the stack frame.  */
 	stdu	r1,-FRAMESIZE(r1)
 	cfi_adjust_cfa_offset(FRAMESIZE)
+	cfi_offset(lr, 16)
 
 	bl	MEMSET
 #ifndef MEMSET_is_local
 	nop
 #endif
 
-	/* Restore the stack frame.  */
-	addi	r1,r1,FRAMESIZE
-	cfi_adjust_cfa_offset(-FRAMESIZE)
-	/* Restore the link register.  */
-	ld	r0,16(r1)
-	mtlr	r0
+	ld	r0,FRAMESIZE+16(r1)
 
 #ifndef USE_AS_STPNCPY
 	mr	r3,r30       /* Restore the return value of strncpy, i.e.:
@@ -266,12 +261,18 @@ L(zero_pad_start_1):
 #endif
 
 	/* Restore non-volatile registers and return.  */
-	ld	r26,-48(r1)
-	ld	r27,-40(r1)
-	ld	r28,-32(r1)
-	ld	r29,-24(r1)
-	ld	r30,-16(r1)
-	ld	r31,-8(r1)
+	ld	r26,FRAMESIZE-48(r1)
+	ld	r27,FRAMESIZE-40(r1)
+	ld	r28,FRAMESIZE-32(r1)
+	ld	r29,FRAMESIZE-24(r1)
+	ld	r30,FRAMESIZE-16(r1)
+	ld	r31,FRAMESIZE-8(r1)
+	/* Restore the stack frame.  */
+	addi	r1,r1,FRAMESIZE
+	cfi_adjust_cfa_offset(-FRAMESIZE)
+	/* Restore the link register.  */
+	mtlr	r0
+	cfi_restore(lr)
 	blr
 
 	/* The common case where [src]+16 will not cross a 4K page boundary.

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=750a0e4967375d0b2bedb77af515b8bc6966e6f6

commit 750a0e4967375d0b2bedb77af515b8bc6966e6f6
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Oct 23 07:43:32 2017 +1030

    PowerPC64 power7 strncpy stack handling and cfi
    
    This patch moves the frame setup and teardown to immediately around
    the single memset call, as has been done for power8.  I've also
    decreased FRAMESIZE to that needed to save the two callee-saved
    registers used.  Plus added cfi.
    
    	* sysdeps/powerpc/powerpc64/power7/strncpy.S: Decrease FRAMESIZE.
    	Move LR save and frame setup/teardown and LR restore to
    	immediately around memset call.  Provide cfi.
    
    Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>

diff --git a/ChangeLog b/ChangeLog
index 5d45da1..444b639 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-23  Alan Modra  <amodra@gmail.com>
+
+	* sysdeps/powerpc/powerpc64/power7/strncpy.S: Decrease FRAMESIZE.
+	Move LR save and frame setup/teardown and LR restore to
+	immediately around memset call.  Provide cfi.
+
 2017-10-22  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* sysdeps/i386/fpu/e_powf.S: Removed.
diff --git a/sysdeps/powerpc/powerpc64/power7/strncpy.S b/sysdeps/powerpc/powerpc64/power7/strncpy.S
index b2833b8..0ae65a0 100644
--- a/sysdeps/powerpc/powerpc64/power7/strncpy.S
+++ b/sysdeps/powerpc/powerpc64/power7/strncpy.S
@@ -53,7 +53,7 @@
 # endif
 #endif  /* !USE_AS_STPNCPY  */
 
-#define		FRAMESIZE	(FRAME_MIN_SIZE+32)
+#define		FRAMESIZE	(FRAME_MIN_SIZE+16)
 
 #ifndef MEMSET
 /* For builds with no IFUNC support, local calls should be made to internal
@@ -74,14 +74,13 @@ ENTRY (FUNC_NAME, 4)
 #endif
 	CALL_MCOUNT 3
 
-	mflr r0			/* load link register LR to r0  */
 	or r10, r3, r4		/* to verify source and destination  */
 	rldicl. r8, r10, 0, 61	/* is double word aligned .. ?  */
 
 	std r19, -8(r1)		/* save callers register , r19  */
 	std r18, -16(r1)	/* save callers register , r18  */
-	std r0, 16(r1)		/* store the link register  */
-	stdu r1, -FRAMESIZE(r1)	/* create the stack frame  */
+	cfi_offset(r19, -8)
+	cfi_offset(r18, -16)
 
 	mr r9, r3		/* save r3 into r9 for use  */
 	mr r18, r3		/* save r3 for retCode of strncpy  */
@@ -224,6 +223,11 @@ L(zeroFill):
 	cmpdi cr7, r8, 0	/* compare if length is zero  */
 	beq cr7, L(update3return)
 
+	mflr r0			/* load link register LR to r0  */
+	std r0, 16(r1)		/* store the link register  */
+	stdu r1, -FRAMESIZE(r1)	/* create the stack frame  */
+	cfi_adjust_cfa_offset(FRAMESIZE)
+	cfi_offset(lr, 16)
 	mr r3, r19		/* fill buffer with  */
 	li r4, 0		/* zero fill buffer  */
 	mr r5, r8		/* how many bytes to fill buffer with  */
@@ -231,6 +235,11 @@ L(zeroFill):
 #ifndef MEMSET_is_local
 	nop
 #endif
+	ld r0, FRAMESIZE+16(r1) /* read the saved link register  */
+	addi r1, r1, FRAMESIZE	/* restore stack pointer  */
+	cfi_adjust_cfa_offset(-FRAMESIZE)
+	mtlr r0
+	cfi_restore(lr)
 
 L(update3return):
 #ifdef USE_AS_STPNCPY
@@ -241,11 +250,8 @@ L(hop2return):
 #ifndef USE_AS_STPNCPY
 	mr r3, r18		/* set return value  */
 #endif
-	addi r1, r1, FRAMESIZE	/* restore stack pointer  */
-	ld r0, 16(r1)		/* read the saved link register  */
 	ld r18, -16(r1)		/* restore callers save register, r18  */
 	ld r19, -8(r1)		/* restore callers save register, r19  */
-	mtlr r0			/* branch to link register  */
 	blr			/* return  */
 
 	.p2align 4
@@ -279,16 +285,13 @@ L(oneBYone):
 
 	.p2align 4
 L(done):
-	addi r1, r1, FRAMESIZE	/* restore stack pointer  */
 #ifdef USE_AS_STPNCPY
 	mr r3, r19		/* set the return value  */
 #else
 	mr r3, r18		/* set the return value  */
 #endif
-	ld r0, 16(r1)		/* read the saved link register  */
 	ld r18, -16(r1)		/* restore callers save register, r18  */
 	ld r19, -8(r1)		/* restore callers save register, r19  */
-	mtlr r0			/* branch to link register  */
 	blr			/* return  */
 
 L(update1):

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                  |   11 +++++++++++
 sysdeps/powerpc/powerpc64/power7/strncpy.S |   23 +++++++++++++----------
 sysdeps/powerpc/powerpc64/power8/strncpy.S |   27 ++++++++++++++-------------
 3 files changed, 38 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]