From 7288b24f0cbe324caf66e6b9e85b0f17042e2e8b Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Tue, 12 Nov 2002 17:57:51 +0000 Subject: Fix algorithm to align source pointer correctly. --- sysdeps/x86_64/strcat.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 */ -- cgit 1.4.1