  
 -  movq    rdi, r8                 /* Align on quad word boundary */
 -  andq    $7, r8
-+  movl    edi, r8d                /* Align on quad word boundary */
-+  andl    $7, r8d
++  movl    edi, %r8d               /* Align on quad word boundary */
++  andl    $7, %r8d
    jz      quadword_aligned
 -  movq    $8, rcx
 -  subq    r8, rcx
 -  subq    rcx, rdx
 +  movl    $8, ecx
-+  subl    r8d, ecx
++  subl    %r8d, ecx
 +  subl    ecx, edx
 +  mov     edi, edi
 +  add     r15, rdi

+  nacljmp ecx
diff -uNr newlib-1.17.0.orig/newlib/libc/machine/x86_64/memcpy.S newlib-1.17.0/newlib/libc/machine/x86_64/memcpy.S
--- newlib-1.17.0.orig/newlib/libc/machine/x86_64/memcpy.S	2007-08-28 23:56:49.000000000 +0200
+++ newlib-1.17.0/newlib/libc/machine/x86_64/memcpy.S	2009-12-17 14:20:45.000000000 +0100
@@ -14,20 +14,25 @@
   SOTYPE_FUNCTION(memcpy)
 

 
-  movq    rdi, r8                 /* Align destination on quad word boundary */
-  andq    $7, r8
+  movl    edi, %r8d                /* Align destination on quad word boundary */
+  andl    $7, %r8d
   jz      quadword_aligned
-  movq    $8, rcx
-  subq    r8, rcx
-  subq    rcx, rdx
+  movl    $8, ecx
+  subl    %r8d, ecx
+  subl    ecx, edx
+  
+  movl    edi, edi
