From 6719500dbd9330d7539d2db3dcf3e8ad1858c7aa Mon Sep 17 00:00:00 2001 From: Elliott Hughes <enh@google.com> Date: Wed, 13 Feb 2013 15:12:32 -0800 Subject: [PATCH] Add a bunch more missing ENDs to assembler routines. This isn't everything; I've missed out those x86 files that are Change-Id: Idb7bb1a68796d6c0b70ea2b5c3300e49da6c62d2 --- libc/arch-arm/bionic/memcmp.S | 16 +++++++--------- libc/arch-arm/bionic/memset.S | 1 + libc/arch-x86/bionic/_setjmp.S | 2 ++ libc/arch-x86/bionic/futex_x86.S | 1 - libc/arch-x86/bionic/setjmp.S | 6 ++++-- libc/arch-x86/bionic/sigsetjmp.S | 2 ++ libc/arch-x86/string/bcmp.S | 1 + libc/arch-x86/string/bzero.S | 1 + libc/arch-x86/string/fss.S | 1 + libc/arch-x86/string/memchr.S | 1 + libc/arch-x86/string/memcmp.S | 1 + libc/arch-x86/string/memset.S | 1 + libc/arch-x86/string/strcat.S | 1 + libc/arch-x86/string/strcmp.S | 1 + libc/arch-x86/string/strcpy.S | 1 + libc/arch-x86/string/strlen.S | 1 + libc/arch-x86/string/strncmp.S | 1 + libc/arch-x86/string/swab.S | 1 + 18 files changed, 28 insertions(+), 12 deletions(-) diff --git a/libc/arch-arm/bionic/memcmp.S b/libc/arch-arm/bionic/memcmp.S index d6d3ca132..7fb428391 100644 --- a/libc/arch-arm/bionic/memcmp.S +++ b/libc/arch-arm/bionic/memcmp.S @@ -115,7 +115,7 @@ ENTRY(memcmp) * pointer somewhere else */ mov r4, r0 - + /* align first pointer to word boundary * offset = -src & 3 */ @@ -151,7 +151,7 @@ ENTRY(memcmp) ldr ip, [r1] subs r2, r2, #(32 + 4) bmi 1f - + 0: pld [r4, #(CACHE_LINE_SIZE * 2)] pld [r1, #(CACHE_LINE_SIZE * 2)] ldr r0, [r4], #4 @@ -178,14 +178,14 @@ ENTRY(memcmp) ldreq r0, [r4], #4 ldreq ip, [r1, #4]! eoreqs r0, r0, lr - bne 2f + bne 2f subs r2, r2, #32 bhs 0b /* do we have at least 4 bytes left? */ 1: adds r2, r2, #(32 - 4 + 4) bmi 4f - + /* finish off 4 bytes at a time */ 3: ldr r0, [r4], #4 ldr ip, [r1], #4 @@ -233,17 +233,14 @@ ENTRY(memcmp) subs r2, r2, #1 bne 11b bx lr -END(memcmp) - - 5: /*************** non-congruent case ***************/ - and r0, r1, #3 + and r0, r1, #3 cmp r0, #2 bne 4f /* here, offset is 2 (16-bits aligned, special cased) */ - + /* make sure we have at least 16 bytes to process */ subs r2, r2, #16 addmi r2, r2, #16 @@ -341,3 +338,4 @@ END(memcmp) mov r2, #4 ldmfd sp!, {r5, r6, r7} b 8b +END(memcmp) diff --git a/libc/arch-arm/bionic/memset.S b/libc/arch-arm/bionic/memset.S index 54f74de6d..102d54128 100644 --- a/libc/arch-arm/bionic/memset.S +++ b/libc/arch-arm/bionic/memset.S @@ -42,6 +42,7 @@ ENTRY(bzero) mov r2, r1 mov r1, #0 + // Fall through to memset... END(bzero) ENTRY(memset) diff --git a/libc/arch-x86/bionic/_setjmp.S b/libc/arch-x86/bionic/_setjmp.S index ac62635fd..9221138b8 100644 --- a/libc/arch-x86/bionic/_setjmp.S +++ b/libc/arch-x86/bionic/_setjmp.S @@ -54,6 +54,7 @@ ENTRY(_setjmp) movl %edi,20(%eax) xorl %eax,%eax ret +END(_setjmp) ENTRY(_longjmp) movl 4(%esp),%edx @@ -69,3 +70,4 @@ ENTRY(_longjmp) incl %eax 1: movl %ecx,0(%esp) ret +END(_longjmp) diff --git a/libc/arch-x86/bionic/futex_x86.S b/libc/arch-x86/bionic/futex_x86.S index 096f72c7f..36a28e8f8 100644 --- a/libc/arch-x86/bionic/futex_x86.S +++ b/libc/arch-x86/bionic/futex_x86.S @@ -19,7 +19,6 @@ ENTRY(__futex_wait) ret END(__futex_wait) - // int __futex_wake(volatile void *ftx, int count) ENTRY(__futex_wake) pushl %ebx diff --git a/libc/arch-x86/bionic/setjmp.S b/libc/arch-x86/bionic/setjmp.S index bcb5f9d5e..c0df6473b 100644 --- a/libc/arch-x86/bionic/setjmp.S +++ b/libc/arch-x86/bionic/setjmp.S @@ -52,7 +52,7 @@ ENTRY(setjmp) call _C_LABEL(sigblock) #endif addl $4,%esp - PIC_EPILOGUE + PIC_EPILOGUE movl 4(%esp),%ecx movl 0(%esp),%edx @@ -65,6 +65,7 @@ ENTRY(setjmp) movl %eax,24(%ecx) xorl %eax,%eax ret +END(setjmp) ENTRY(longjmp) movl 4(%esp),%edx @@ -76,7 +77,7 @@ ENTRY(longjmp) call _C_LABEL(sigsetmask) #endif addl $4,%esp - PIC_EPILOGUE + PIC_EPILOGUE movl 4(%esp),%edx movl 8(%esp),%eax @@ -91,3 +92,4 @@ ENTRY(longjmp) incl %eax 1: movl %ecx,0(%esp) ret +END(longjmp) diff --git a/libc/arch-x86/bionic/sigsetjmp.S b/libc/arch-x86/bionic/sigsetjmp.S index c990a0582..70cc6db4c 100644 --- a/libc/arch-x86/bionic/sigsetjmp.S +++ b/libc/arch-x86/bionic/sigsetjmp.S @@ -61,6 +61,7 @@ ENTRY(sigsetjmp) movl %edi,20(%ecx) xorl %eax,%eax ret +END(sigsetjmp) ENTRY(siglongjmp) movl 4(%esp),%edx @@ -90,3 +91,4 @@ ENTRY(siglongjmp) incl %eax 2: movl %ecx,0(%esp) ret +END(siglongjmp) diff --git a/libc/arch-x86/string/bcmp.S b/libc/arch-x86/string/bcmp.S index a5b46ae74..4a88f66e9 100644 --- a/libc/arch-x86/string/bcmp.S +++ b/libc/arch-x86/string/bcmp.S @@ -30,3 +30,4 @@ L1: incl %eax L2: popl %esi popl %edi ret +END(bcmp) diff --git a/libc/arch-x86/string/bzero.S b/libc/arch-x86/string/bzero.S index 2ec9c7dd6..c73a3511a 100644 --- a/libc/arch-x86/string/bzero.S +++ b/libc/arch-x86/string/bzero.S @@ -41,3 +41,4 @@ L1: movl %edx,%ecx /* zero remainder by bytes */ popl %edi ret +END(bzero) diff --git a/libc/arch-x86/string/fss.S b/libc/arch-x86/string/fss.S index 96affabed..d819306f0 100644 --- a/libc/arch-x86/string/fss.S +++ b/libc/arch-x86/string/fss.S @@ -15,3 +15,4 @@ ENTRY(ffs) .align 2 L1: xorl %eax,%eax /* clear result */ ret +END(ffs) diff --git a/libc/arch-x86/string/memchr.S b/libc/arch-x86/string/memchr.S index d6bcbe688..367c7b481 100644 --- a/libc/arch-x86/string/memchr.S +++ b/libc/arch-x86/string/memchr.S @@ -24,3 +24,4 @@ ENTRY(memchr) L1: xorl %eax,%eax popl %edi ret +END(memchr) diff --git a/libc/arch-x86/string/memcmp.S b/libc/arch-x86/string/memcmp.S index 1be189aef..3b5053024 100644 --- a/libc/arch-x86/string/memcmp.S +++ b/libc/arch-x86/string/memcmp.S @@ -41,3 +41,4 @@ L6: movzbl -1(%edi),%eax /* Perform unsigned comparison */ popl %esi popl %edi ret +END(memcmp) diff --git a/libc/arch-x86/string/memset.S b/libc/arch-x86/string/memset.S index 1059ccc99..62e6a173c 100644 --- a/libc/arch-x86/string/memset.S +++ b/libc/arch-x86/string/memset.S @@ -53,3 +53,4 @@ L1: rep popl %ebx popl %edi ret +END(memset) diff --git a/libc/arch-x86/string/strcat.S b/libc/arch-x86/string/strcat.S index 60fdd554e..c75f38a54 100644 --- a/libc/arch-x86/string/strcat.S +++ b/libc/arch-x86/string/strcat.S @@ -71,3 +71,4 @@ L1: movb (%edx),%al /* unroll loop, but not too much */ L2: popl %eax /* pop destination address */ popl %edi /* restore edi */ ret +END(strcat) diff --git a/libc/arch-x86/string/strcmp.S b/libc/arch-x86/string/strcmp.S index 22ba5460e..5d3f4fc26 100644 --- a/libc/arch-x86/string/strcmp.S +++ b/libc/arch-x86/string/strcmp.S @@ -79,3 +79,4 @@ L3: movzbl (%eax),%eax /* unsigned comparison */ movzbl (%edx),%edx subl %edx,%eax ret +END(strcmp) diff --git a/libc/arch-x86/string/strcpy.S b/libc/arch-x86/string/strcpy.S index 341eb6c39..7d9b87e11 100644 --- a/libc/arch-x86/string/strcpy.S +++ b/libc/arch-x86/string/strcpy.S @@ -61,3 +61,4 @@ L1: movb (%edx),%al /* unroll loop, but not too much */ jnz L1 L2: popl %eax /* pop dst address */ ret +END(strcpy) diff --git a/libc/arch-x86/string/strlen.S b/libc/arch-x86/string/strlen.S index 4f04ffc99..527e36ac3 100644 --- a/libc/arch-x86/string/strlen.S +++ b/libc/arch-x86/string/strlen.S @@ -18,3 +18,4 @@ ENTRY(strlen) leal -1(%ecx),%eax /* and subtracting one */ popl %edi ret +END(strlen) diff --git a/libc/arch-x86/string/strncmp.S b/libc/arch-x86/string/strncmp.S index 5aa88d7e7..664947328 100644 --- a/libc/arch-x86/string/strncmp.S +++ b/libc/arch-x86/string/strncmp.S @@ -111,3 +111,4 @@ L3: movzbl (%eax),%eax /* unsigned comparision */ L4: xorl %eax,%eax popl %ebx ret +END(strncmp) diff --git a/libc/arch-x86/string/swab.S b/libc/arch-x86/string/swab.S index 305586023..2f6cfb2a2 100644 --- a/libc/arch-x86/string/swab.S +++ b/libc/arch-x86/string/swab.S @@ -65,3 +65,4 @@ L3: lodsw L4: popl %edi popl %esi ret +END(swab)