From: Andreas Jaeger Date: Tue, 12 Nov 2002 17:57:51 +0000 (+0000) Subject: Fix algorithm to align source pointer correctly. X-Git-Tag: cvs/initial~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7288b24f0cbe324caf66e6b9e85b0f17042e2e8b;p=thirdparty%2Fglibc.git Fix algorithm to align source pointer correctly. --- diff --git a/sysdeps/x86_64/strcat.S b/sysdeps/x86_64/strcat.S index 549fd21b4aa..e406e34b362 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 */