[liba] Add aeabi-memclr4

Change-Id: I9ce3282773e2d1ada2f731e5c5c7ee07e7706612
This commit is contained in:
Romain Goyet
2016-08-29 14:05:05 +02:00
parent 7d49decd03
commit 3c4b4a4d51
3 changed files with 13 additions and 1 deletions

View File

@@ -7,4 +7,7 @@ tests += $(addprefix liba/test/, stdint.c)
# The use of aeabi-rt could be made conditional to an AEABI target.
# In practice we're always using liba on such a target.
objs += $(addprefix liba/src/aeabi-rt/, memcpy.o)
objs += $(addprefix liba/src/aeabi-rt/, \
memclr.o \
memcpy.o \
)

View File

@@ -9,6 +9,7 @@ memory copying/clearing/setting, etc...
Since we're telling our compiler to build an AEABI binary, it may decide to use
those symbols, and so we have to provide an implementation for them. Refer to
the "Run-time ABI for the ARM Architecture" for a full list of functions.
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf
Note that this is not formally the job of a libc implementation. Similar code is
often shipped alongside a compiler (LLVM calls it compiler-rt, GCC libgcc). But

View File

@@ -0,0 +1,8 @@
#include <stddef.h>
#include <string.h>
/* See the "Run-time ABI for the ARM Architecture", Section 4.3.3 */
void __aeabi_memclr4(void * dest, size_t n) {
memset(dest, 0, n);
}