aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2011-08-06 00:39:58 +0200
committerNicolas Schodet2011-08-06 00:39:58 +0200
commitb85ec27ff755f28770fc6ae17d1d22f69f42d45b (patch)
treedeb6968df19f536afaa0d9bcb3a2fb352379c4bc
parent0cb650f1cf6f446bbb0186300a198b5936f49bb4 (diff)
gcc: add support for unwinder
The unwinder is not really wanted, but it can be included on some version of gcc. In this case, it needs some special sections and the abort function.
-rw-r--r--AT91SAM7S256/SAM7S256/gcc/Makefile2
-rw-r--r--AT91SAM7S256/SAM7S256/gcc/lib/abort.c32
-rw-r--r--AT91SAM7S256/SAM7S256/gcc/nxt.ld7
3 files changed, 40 insertions, 1 deletions
diff --git a/AT91SAM7S256/SAM7S256/gcc/Makefile b/AT91SAM7S256/SAM7S256/gcc/Makefile
index 7ad3156..65b6ecf 100644
--- a/AT91SAM7S256/SAM7S256/gcc/Makefile
+++ b/AT91SAM7S256/SAM7S256/gcc/Makefile
@@ -14,7 +14,7 @@ THUMB_SOURCES = c_button.c c_cmd.c c_comm.c c_display.c c_input.c c_ioctrl.c \
d_ioctrl.c d_loader.c d_lowspeed.c d_output.c d_sound.c \
d_timer.c d_usb.c \
m_sched.c \
- errno.c sbrk.c strtod.c sscanf.c \
+ abort.c errno.c sbrk.c strtod.c sscanf.c \
Cstartup_SAM7.c
ASM_ARM_SOURCE = Cstartup.S
diff --git a/AT91SAM7S256/SAM7S256/gcc/lib/abort.c b/AT91SAM7S256/SAM7S256/gcc/lib/abort.c
new file mode 100644
index 0000000..26d47e7
--- /dev/null
+++ b/AT91SAM7S256/SAM7S256/gcc/lib/abort.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011 Nicolas Schodet
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/* Provide an abort function, could be used by various library function. */
+
+void
+abort (void)
+{
+ /* Wait for ever, nothing better to do. */
+ while (1)
+ ;
+}
+
diff --git a/AT91SAM7S256/SAM7S256/gcc/nxt.ld b/AT91SAM7S256/SAM7S256/gcc/nxt.ld
index 8e5f0cb..d63944e 100644
--- a/AT91SAM7S256/SAM7S256/gcc/nxt.ld
+++ b/AT91SAM7S256/SAM7S256/gcc/nxt.ld
@@ -51,6 +51,13 @@ SECTIONS
PROVIDE(__dtors_end__ = .);
} >CODE
+ __exidx_start = . ;
+ .ARM.exidx :
+ {
+ *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+ } >CODE
+ __exidx_end = . ;
+
. = ALIGN(4);
_etext = . ;