This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: [patch] add AVR __stack to RTEMS crt0 stub.
- From: Ralf Corsepius <ralf_corsepius at rtems dot org>
- To: Newlib List <newlib at sources dot redhat dot com>
- Cc: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- Date: Mon, 25 Oct 2004 15:57:52 +0200
- Subject: Re: [patch] add AVR __stack to RTEMS crt0 stub.
- References: <1095929849.31310.24.camel@mccallum.corsepiu.local>
Ping!
Below is an update of the patch.
On Thu, 2004-09-23 at 10:57, Ralf Corsepius wrote:
> Hi,
>
> Could somebody please apply the patch below to newlib.
>
> It adds a dummy char *__stack (Referenced by GCC) to RTEMS crt0.o stub.
>
> TIA,
> Ralf
Index: libc/include/machine/setjmp.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/machine/setjmp.h,v
retrieving revision 1.21
diff -u -r1.21 setjmp.h
--- libc/include/machine/setjmp.h 5 Oct 2004 19:44:24 -0000 1.21
+++ libc/include/machine/setjmp.h 17 Oct 2004 20:48:21 -0000
@@ -9,6 +9,10 @@
#define _JBLEN 23
#endif
+#if defined(__AVR__)
+#define _JBLEN 24
+#endif
+
#ifdef __sparc__
/*
* onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext).
Index: libc/sys/rtems/crt0.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/rtems/crt0.c,v
retrieving revision 1.7
diff -u -r1.7 crt0.c
--- libc/sys/rtems/crt0.c 8 Jan 2004 19:25:21 -0000 1.7
+++ libc/sys/rtems/crt0.c 17 Oct 2004 20:48:23 -0000
@@ -122,3 +122,11 @@
asm (".equ V_BSD_OS, 66" );
asm (".equ V_EPI_OS, 69" );
#endif
+
+#if defined(__AVR__)
+/*
+ * Initial stack pointer address "__stack"
+ * hard coded into GCC instead of providing it through ldscripts
+ */
+const char* __stack ;
+#endif