From e6def544358afd5648a428d2e02c147a1f901048 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 21 Feb 2017 00:07:34 +0000 Subject: fix arm run-time abi string functions in arm rtabi these __aeabi_* functions have special abi (they are only allowed to clobber r0,r1,r2,r3,ip,lr,cpsr), so they cannot be simple wrappers around normal string functions (which may clobber other registers), the safest solution is to write them in asm, a minimalistic implementation works because these are not supposed to be emitted by compilers or used in general. --- src/string/arm/__aeabi_memset.s | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/string/arm/__aeabi_memset.s (limited to 'src/string/arm/__aeabi_memset.s') diff --git a/src/string/arm/__aeabi_memset.s b/src/string/arm/__aeabi_memset.s new file mode 100644 index 00000000..f9f60583 --- /dev/null +++ b/src/string/arm/__aeabi_memset.s @@ -0,0 +1,31 @@ +.syntax unified + +.global __aeabi_memclr8 +.global __aeabi_memclr4 +.global __aeabi_memclr +.global __aeabi_memset8 +.global __aeabi_memset4 +.global __aeabi_memset + +.type __aeabi_memclr8,%function +.type __aeabi_memclr4,%function +.type __aeabi_memclr,%function +.type __aeabi_memset8,%function +.type __aeabi_memset4,%function +.type __aeabi_memset,%function + +__aeabi_memclr8: +__aeabi_memclr4: +__aeabi_memclr: + movs r2, #0 +__aeabi_memset8: +__aeabi_memset4: +__aeabi_memset: + cmp r1, #0 + beq 2f + adds r1, r0, r1 +1: strb r2, [r0] + adds r0, r0, #1 + cmp r1, r0 + bne 1b +2: bx lr -- cgit v1.2.1