// Check that the two lengths together don't exceed the threshold, then
// do a memcpy of the data.
ENTRY(__strcat_chk)
- .cfi_startproc
pld [r0, #0]
push {r0, lr}
.save {r0, lr}
mov r2, r4
add r0, r0, r3
pop {r4, r5}
-
- .cfi_endproc
END(__strcat_chk)
#define MEMCPY_BASE __strcat_chk_memcpy_base
#include "memcpy_base.S"
ENTRY_PRIVATE(__strcat_chk_failed)
- .cfi_startproc
.save {r0, lr}
.save {r4, r5}
.word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
-
- .cfi_endproc
END(__strcat_chk_failed)
.data
// Get the length of the source string first, then do a memcpy of the data
// instead of a strcpy.
ENTRY(__strcpy_chk)
- .cfi_startproc
pld [r0, #0]
push {r0, lr}
.save {r0, lr}
// Add 1 for copy length to get the string terminator.
add r2, r3, #1
-
- .cfi_endproc
END(__strcpy_chk)
#define MEMCPY_BASE __strcpy_chk_memcpy_base
#include "memcpy_base.S"
ENTRY_PRIVATE(__strcpy_chk_failed)
- .cfi_startproc
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
-
- .cfi_endproc
END(__strcpy_chk_failed)
.data
.fpu neon
ENTRY(__memcpy_chk)
- .cfi_startproc
cmp r2, r3
bhi __memcpy_chk_fail
// Fall through to memcpy...
- .cfi_endproc
END(__memcpy_chk)
ENTRY(memcpy)
- .cfi_startproc
pld [r1, #64]
push {r0, lr}
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
-
- .cfi_endproc
END(memcpy)
#define MEMCPY_BASE __memcpy_base
#include "memcpy_base.S"
ENTRY_PRIVATE(__memcpy_chk_fail)
- .cfi_startproc
// Preserve lr for backtrace.
push {lr}
.save {lr}
.word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+8)
- .cfi_endproc
END(__memcpy_chk_fail)
.data
*/
ENTRY_PRIVATE(MEMCPY_BASE)
- .cfi_startproc
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
eor r3, r0, r1
ands r3, r3, #0x3
bne .L_copy_unknown_alignment
-
- .cfi_endproc
END(MEMCPY_BASE)
ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)
- .cfi_startproc
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
// Src is guaranteed to be at least word aligned by this point.
b .L_word_aligned
-
- .cfi_endproc
END(MEMCPY_BASE_ALIGNED)
.syntax unified
ENTRY(__memset_chk)
- .cfi_startproc
cmp r2, r3
bls .L_done
.word BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+8)
-
- .cfi_endproc
END(__memset_chk)
ENTRY(bzero)
- .cfi_startproc
mov r2, r1
mov r1, #0
.L_done:
// Fall through to memset...
- .cfi_endproc
END(bzero)
ENTRY(memset)
- .cfi_startproc
.save {r0}
stmfd sp!, {r0}
.cfi_def_cfa_offset 4
strbcs r1, [r0], #1
ldmfd sp!, {r0}
bx lr
- .cfi_endproc
END(memset)
.data
#endif /* not __ARMEB__ */
.endm /* setup_return */
- .cfi_startproc
pld [r0, #0]
pld [r1, #0]
it ls
sbcls r0, r0, r0
bx lr
- .cfi_endproc
END(strcmp)
// Check that the two lengths together don't exceed the threshold, then
// do a memcpy of the data.
ENTRY(__strcat_chk)
- .cfi_startproc
pld [r0, #0]
push {r0, lr}
.save {r0, lr}
pop {r4, r5}
// Fall through into the memcpy_base function.
- .cfi_endproc
END(__strcat_chk)
#define MEMCPY_BASE __strcat_chk_memcpy_base
#include "memcpy_base.S"
ENTRY_PRIVATE(__strcat_chk_fail)
- .cfi_startproc
-
.save {r0, lr}
.save {r4, r5}
.cfi_def_cfa_offset 8
.word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
-
- .cfi_endproc
END(__strcat_chk_fail)
.data
// Get the length of the source string first, then do a memcpy of the data
// instead of a strcpy.
ENTRY(__strcpy_chk)
- .cfi_startproc
pld [r0, #0]
push {r0, lr}
.save {r0, lr}
// Add 1 for copy length to get the string terminator.
add r2, r3, #1
- .cfi_endproc
-
// Fall through into the memcpy_base function.
END(__strcpy_chk)
#include "memcpy_base.S"
ENTRY_PRIVATE(__strcpy_chk_fail)
- .cfi_startproc
-
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
-
- .cfi_endproc
END(__strcpy_chk_fail)
.data
.thumb_func
ENTRY(__memcpy_chk)
- .cfi_startproc
cmp r2, r3
bhi __memcpy_chk_fail
// Fall through to memcpy...
- .cfi_endproc
END(__memcpy_chk)
ENTRY(memcpy)
- .cfi_startproc
-
pld [r1, #0]
stmfd sp!, {r0, lr}
.save {r0, lr}
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
pld [r1, #64]
-
- .cfi_endproc
END(memcpy)
#define MEMCPY_BASE __memcpy_base
#include "memcpy_base.S"
ENTRY_PRIVATE(__memcpy_chk_fail)
- .cfi_startproc
// Preserve lr for backtrace.
push {lr}
.save {lr}
.word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
- .cfi_endproc
END(__memcpy_chk_fail)
.data
*/
ENTRY_PRIVATE(MEMCPY_BASE)
- .cfi_startproc
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
ldmfd sp!, {r0, lr}
bx lr
-
- .cfi_endproc
END(MEMCPY_BASE)
ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)
- .cfi_startproc
-
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
6:
ldmfd sp!, {r4-r8}
ldmfd sp!, {r0, pc}
-
- .cfi_endproc
END(MEMCPY_BASE_ALIGNED)
.fpu neon
ENTRY(__memset_chk)
- .cfi_startproc
cmp r2, r3
bls .L_done
.word BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+8)
-
- .cfi_endproc
END(__memset_chk)
ENTRY(bzero)
- .cfi_startproc
mov r2, r1
mov r1, #0
.L_done:
// Fall through to memset...
- .cfi_endproc
END(bzero)
/* memset() returns its first argument. */
ENTRY(memset)
- .cfi_startproc
-
- # The neon memset only wins for less than 132.
+ // The neon memset only wins for less than 132.
cmp r2, #132
bhi __memset_large_copy
strcsb r1, [r0], #1
ldmfd sp!, {r0}
bx lr
-
- .cfi_endproc
END(memset)
ENTRY_PRIVATE(__memset_large_copy)
- .cfi_startproc
-
/* compute the offset to align the destination
* offset = (4-(src&3))&3 = -src & 3
*/
strcsb r1, [r0]
ldmfd sp!, {r0, r4-r7, lr}
bx lr
- .cfi_endproc
END(__memset_large_copy)
.data
#endif /* not __ARMEB__ */
.endm /* setup_return */
- .cfi_startproc
pld [r0, #0]
pld [r1, #0]
adds sp, sp, #16
bx lr
- .cfi_endproc
END(strcmp)
#define _ASM_TYPE_FUNCTION #function
#define _ASM_TYPE_OBJECT #object
#define _ENTRY(x) \
- .text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x: .fnstart
+ .text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x: .fnstart; .cfi_startproc;
#define _ASM_SIZE(x) .size x, .-x;
#define _END(x) \
- .fnend; \
+ .fnend; .cfi_endproc; \
_ASM_SIZE(x)
#ifdef GPROF
// Check that the two lengths together don't exceed the threshold, then
// do a memcpy of the data.
ENTRY(__strcat_chk)
- .cfi_startproc
pld [r0, #0]
push {r0, lr}
.save {r0, lr}
mov r2, r4
add r0, r0, r3
pop {r4, r5}
-
- .cfi_endproc
END(__strcat_chk)
#define MEMCPY_BASE __strcat_chk_memcpy_base
#include "memcpy_base.S"
ENTRY_PRIVATE(__strcat_chk_failed)
- .cfi_startproc
.save {r0, lr}
.save {r4, r5}
.cfi_def_cfa_offset 8
.word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
-
- .cfi_endproc
END(__strcat_chk_failed)
.data
// Get the length of the source string first, then do a memcpy of the data
// instead of a strcpy.
ENTRY(__strcpy_chk)
- .cfi_startproc
pld [r0, #0]
push {r0, lr}
.save {r0, lr}
// Add 1 for copy length to get the string terminator.
add r2, r3, #1
-
- .cfi_endproc
END(__strcpy_chk)
#define MEMCPY_BASE __strcpy_chk_memcpy_base
#include "memcpy_base.S"
ENTRY_PRIVATE(__strcpy_chk_failed)
- .cfi_startproc
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
- .cfi_endproc
END(__strcpy_chk_failed)
.data
.thumb_func
ENTRY(__memcpy_chk)
- .cfi_startproc
cmp r2, r3
bhi __memcpy_chk_fail
// Fall through to memcpy...
- .cfi_endproc
END(__memcpy_chk)
ENTRY(memcpy)
- .cfi_startproc
pld [r1, #64]
stmfd sp!, {r0, lr}
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
- .cfi_endproc
END(memcpy)
#define MEMCPY_BASE __memcpy_base
#include "memcpy_base.S"
ENTRY_PRIVATE(__memcpy_chk_fail)
- .cfi_startproc
// Preserve lr for backtrace.
push {lr}
.save {lr}
.word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
- .cfi_endproc
END(__memcpy_chk_fail)
.data
// Assumes neon instructions and a cache line size of 32 bytes.
ENTRY_PRIVATE(MEMCPY_BASE)
- .cfi_startproc
.save {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
ldmfd sp!, {r0, lr}
bx lr
-
- .cfi_endproc
END(MEMCPY_BASE)
.fpu neon
ENTRY(__memset_chk)
- .cfi_startproc
cmp r2, r3
bls .L_done
.word BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+8)
-
- .cfi_endproc
END(__memset_chk)
ENTRY(bzero)
- .cfi_startproc
mov r2, r1
mov r1, #0
.L_done:
// Fall through to memset...
- .cfi_endproc
END(bzero)
/* memset() returns its first argument. */
ENTRY(memset)
- .cfi_startproc
.save {r0}
stmfd sp!, {r0}
.cfi_def_cfa_offset 4
strcsb r1, [r0], #1
ldmfd sp!, {r0}
bx lr
- .cfi_endproc
END(memset)
.data
#endif /* not __ARMEB__ */
.endm /* setup_return */
- .cfi_startproc
pld [r0, #0]
pld [r1, #0]
.cfi_restore r7
bx lr
- .cfi_endproc
END(strcmp)
#endif
#define _ENTRY(x) \
- .text; _ALIGN_TEXT; .globl x; .type x,@function; x:
+ .text; _ALIGN_TEXT; .globl x; .type x,@function; x: .cfi_startproc;
#define _LABEL(x) \
.globl x; x:
#define NENTRY(y) _ENTRY(_C_LABEL(y))
#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
#define LABEL(y) _LABEL(_C_LABEL(y))
-#define END(y) .size y, . - y
+#define END(y) .cfi_endproc; .size y, . - y
#define ASMSTR .asciz
* ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
*/
-#ifdef MEMCOPY
+#if defined(MEMCOPY)
ENTRY(memcpy)
-#else
-#ifdef MEMMOVE
+#elif defined(MEMMOVE)
ENTRY(memmove)
#else
ENTRY(bcopy)
#endif
-#endif
pushl %esi
pushl %edi
#if defined(MEMCOPY) || defined(MEMMOVE)
popl %esi
cld
ret
+#if defined(MEMCOPY)
+END(memcpy)
+#elif defined(MEMMOVE)
+END(memmove)
+#else
+END(bcopy)
+#endif
hlt
2:
ret
+END(__bionic_clone)
xorl %eax,%eax
ret
+END(_setjmp)
ENTRY(_longjmp)
movq (_JB_RBX * 8)(%rdi),%rbx
incl %eax
1: movq %r11,0(%rsp)
ret
+END(_longjmp)
mov $__NR_futex, %eax
syscall
ret
-
+END(__futex_wait)
/* int __futex_wake(volatile void *ftx, int count) */
mov $__NR_futex, %eax
syscall
ret
+END(__futex_wake)
/* int __futex_syscall3(volatile void *ftx, int op, int count) */
ENTRY(__futex_syscall3)
mov $__NR_futex, %eax
syscall
ret
+END(__futex_syscall3)
/* int __futex_syscall4(volatile void *ftx, int op, int val, const struct timespec *timeout) */
ENTRY(__futex_syscall4)
mov $__NR_futex, %eax
syscall
ret
+END(__futex_syscall4)
2: xorl %eax,%eax
ret
+END(setjmp)
ENTRY(longjmp)
movq %rdi,%r12
incl %eax
1: movq %r11,0(%rsp)
ret
+END(longjmp)
2: xorl %eax,%eax
ret
+END(sigsetjmp)
ENTRY(siglongjmp)
movq %rdi,%r12
incl %eax
1: movq %r11,0(%rsp)
ret
+END(siglongjmp)
#endif
#define _ENTRY(x) \
- .text; _ALIGN_TEXT; .globl x; .type x,@function; x:
+ .text; _ALIGN_TEXT; .globl x; .type x,@function; x: .cfi_startproc;
#define _LABEL(x) \
.globl x; x:
#define ALTENTRY(x) NENTRY(x)
#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
#define LABEL(y) _LABEL(_C_LABEL(y))
-#define END(y) .size y, . - y
+#define END(y) .cfi_endproc; .size y, . - y
#define ASMSTR .asciz