aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2002-11-12 17:57:51 +0000
committerAndreas Jaeger <aj@suse.de>2002-11-12 17:57:51 +0000
commit7288b24f0cbe324caf66e6b9e85b0f17042e2e8b (patch)
tree0b8be24ed9971cdaecb55df8358cc2962c9b18d0 /sysdeps
parent7ceef50ec9075b546eb84654bd0d1f42d0fe26d1 (diff)
downloadglibc-7288b24f0cbe324caf66e6b9e85b0f17042e2e8b.zip
glibc-7288b24f0cbe324caf66e6b9e85b0f17042e2e8b.tar.gz
glibc-7288b24f0cbe324caf66e6b9e85b0f17042e2e8b.tar.bz2
Fix algorithm to align source pointer correctly.
Diffstat (limited to 'sysdeps')
-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 549fd21..e406e34 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 */