This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] ARM EABI support routine


The attached patch adds an implementation of __aeabi_atexit.
This routine is required by the Arm EABI. Its purpose issimilar to 
__cxa_atexit.

Currently there are implementations of this function in both glibc and 
libstdc++. I think it makes most sense to put the implementation in libc, and 
remove the libstdc++ version.

Tested with cross to arm-none-eabi.
Ok?

Paul

2005-08-24  Paul Brook  <paul@codesourcery.com>

	* libc/sys/arm/Makefile.am (lib_a_SOURCES): Add aeabi_atexit.c.
	* libc/sys/arm/Makefile.in: Regenerate.
	* libc/sys/arm/aeabi_atexit.c: New file.
Index: newlib/libc/sys/arm/Makefile.am
===================================================================
RCS file: /var/cvsroot/src-cvs/src/newlib/libc/sys/arm/Makefile.am,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile.am
--- newlib/libc/sys/arm/Makefile.am	9 Jun 2004 19:05:09 -0000	1.4
+++ newlib/libc/sys/arm/Makefile.am	24 Aug 2005 13:21:37 -0000
@@ -12,7 +12,7 @@ else
 extra_objs =
 endif
 
-lib_a_SOURCES = libcfunc.c trap.S
+lib_a_SOURCES = libcfunc.c trap.S aeabi_atexit.c
 lib_a_LIBADD = $(extra_objs)
 lib_a_DEPENDENCIES = $(extra_objs)
 
Index: newlib/libc/sys/arm/aeabi_atexit.c
===================================================================
RCS file: newlib/libc/sys/arm/aeabi_atexit.c
diff -N newlib/libc/sys/arm/aeabi_atexit.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ newlib/libc/sys/arm/aeabi_atexit.c	24 Aug 2005 14:21:57 -0000
@@ -0,0 +1,10 @@
+#include <stdlib.h>
+
+/* Register a function to be called by exit or when a shared library
+   is unloaded.  This routine is like __cxa_atexit, but uses the
+   calling sequence required by the ARM EABI.  */
+int
+__aeabi_atexit (void *arg, void (*func) (void *), void *d)
+{
+  return __cxa_atexit (func, arg, d);
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]