about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--sysdeps/x86_64/strcat.S4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/x86_64/strcat.S b/sysdeps/x86_64/strcat.S
index 549fd21b4a..e406e34b36 100644
--- a/sysdeps/x86_64/strcat.S
+++ b/sysdeps/x86_64/strcat.S
@@ -141,11 +141,13 @@ ENTRY (BP_SYM (strcat))
 2:
 	/* Second step: Copy source to destination.  */
 
-	movq	%rax, %rcx	/* duplicate  */
+	movq	%rsi, %rcx	/* duplicate  */
 	andl	$7,%ecx		/* mask alignment bits */
 	movq	%rax, %rdx	/* move around */
 	jz	22f		/* aligned => start loop */
 
+	neg	%ecx		/* align to 8 bytes.  */
+	addl	$8, %ecx
 	/* Align the source pointer.  */
 21:
 	movb	(%rsi), %al	/* Fetch a byte */