Support __aeabi_memcpy, __aeabi_memcpy4 and __aeabi_memcpy8 routines in the arm backend.
Hale Wang
Hale.Wang@arm.com
Fri Aug 8 04:39:00 GMT 2014
Hi,
The newlib libraries should suppport the presence of the aliases for memcpy
routines. The __aeabi_memcpy, __aeabi_memcpy4 and __aeabi_memcpy8 should be
defined.
In this patch, __aeabi_memcpy, __aeabi_memcpy4 and __aeabi_memcpy8 are
defined in the new file newlib/libc/machine/arm/aeabi_memcpy.c. And they are
the aliases for memcpy routines.
Bootstrap and no make check regression on X86-64.
Patch also attached for convenience.
Thanks and Best Regards,
Hale Wang
newlib/ChangeLog:
2014-07-29 Hale Wang <hale.wang@arm.com>
* libc/machine/arm/aeabi_memcpy.c: New file.
* libc/machine/arm/Makefile.am: add dependencies.
* libc/machine/arm/Makefile.in: Likewise.
========================================================================
diff --git a/newlib/libc/machine/arm/Makefile.am
b/newlib/libc/machine/arm/Makefile.am
index fb33926..e052286 100644
--- a/newlib/libc/machine/arm/Makefile.am
+++ b/newlib/libc/machine/arm/Makefile.am
@@ -10,7 +10,7 @@ noinst_LIBRARIES = lib.a
lib_a_SOURCES = setjmp.S access.c strlen.c strcmp.S strcpy.c \
memcpy.S memcpy-stub.c memchr-stub.c memchr.S \
- strlen.c strlen-armv7.S
+ strlen.c strlen-armv7.S aeabi_memcpy.c
lib_a_CCASFLAGS=$(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS)
diff --git a/newlib/libc/machine/arm/Makefile.in
b/newlib/libc/machine/arm/Makefile.in
index 1ccfac5..8e20914 100644
--- a/newlib/libc/machine/arm/Makefile.in
+++ b/newlib/libc/machine/arm/Makefile.in
@@ -74,7 +74,7 @@ am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT)
lib_a-access.$(OBJEXT) \
lib_a-strcpy.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \
lib_a-memcpy-stub.$(OBJEXT) lib_a-memchr-stub.$(OBJEXT) \
lib_a-memchr.$(OBJEXT) lib_a-strlen.$(OBJEXT) \
- lib_a-strlen-armv7.$(OBJEXT)
+ lib_a-strlen-armv7.$(OBJEXT) lib_a-aeabi_memcpy.$(OBJEXT)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
@@ -202,7 +202,7 @@ AM_CCASFLAGS = $(INCLUDES)
noinst_LIBRARIES = lib.a
lib_a_SOURCES = setjmp.S access.c strlen.c strcmp.S strcpy.c \
memcpy.S memcpy-stub.c memchr-stub.c memchr.S \
- strlen.c strlen-armv7.S
+ strlen.c strlen-armv7.S aeabi_memcpy.c
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS)
@@ -336,6 +336,12 @@ lib_a-memchr-stub.o: memchr-stub.c
lib_a-memchr-stub.obj: memchr-stub.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)
$(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memchr-stub.obj `if test
-f 'memchr-stub.c'; then $(CYGPATH_W) 'memchr-stub.c'; else $(CYGPATH_W)
'$(srcdir)/memchr-stub.c'; fi`
+lib_a-aeabi_memcpy.o: aeabi_memcpy.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)
$(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-aeabi_memcpy.o `test -f
'aeabi_memcpy.c' || echo '$(srcdir)/'`aeabi_memcpy.c
+
+lib_a-aeabi_memcpy.obj: aeabi_memcpy.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)
$(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-aeabi_memcpy.obj `if test
-f 'aeabi_memcpy.c'; then $(CYGPATH_W) 'aeabi_memcpy.c'; else $(CYGPATH_W)
'$(srcdir)/aeabi_memcpy.c'; fi`
+
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
diff --git a/newlib/libc/machine/arm/aeabi_memcpy.c
b/newlib/libc/machine/arm/aeabi_memcpy.c
new file mode 100644
index 0000000..b3e18ea
--- /dev/null
+++ b/newlib/libc/machine/arm/aeabi_memcpy.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014 ARM Ltd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR
IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stddef.h>
+
+/* Support the alias for the __aeabi_memcpy which may
+ assume memory alignment. */
+void __aeabi_memcpy4 (void *dest, const void *source, size_t n)
+ __attribute__((alias ("__aeabi_memcpy")));
+
+void __aeabi_memcpy8 (void *dest, const void *source, size_t n)
+ __attribute__((alias ("__aeabi_memcpy")));
+
+/* Support the routine __aeabi_memcpy. Can't alias to memcpy
+ because it's not defined in the same translation unit. */
+void __aeabi_memcpy (void *dest, const void *source, size_t n)
+{
+ extern void memcpy (void *dest, const void *source, size_t n);
+ memcpy (dest, source, n);
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aeabi_memcpy_3.patch
Type: application/octet-stream
Size: 4773 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20140808/91e12fce/attachment.obj>
More information about the Newlib
mailing list