aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2012-09-03 19:51:40 +0200
committerNicolas Schodet2012-09-03 20:41:15 +0200
commit82ef2936a673f0c6cba86e02d80104f56e1de5a2 (patch)
tree171c6ef7f1c56d29e0983df6b8b7871d49b4e6fc
parent74cd991e7e8972cf22933743c847b5ce2b165798 (diff)
Support exceptions on all targets
-rw-r--r--lib/lm3s/libopencm3_lm3s.ld23
-rw-r--r--lib/lpc13xx/libopencm3_lpc13xx.ld23
-rw-r--r--lib/lpc17xx/libopencm3_lpc17xx.ld23
-rw-r--r--lib/lpc43xx/libopencm3_lpc43xx.ld25
-rw-r--r--lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld26
-rw-r--r--lib/stm32/f1/libopencm3_stm32f1.ld4
-rw-r--r--lib/stm32/f2/libopencm3_stm32f2.ld4
-rw-r--r--lib/stm32/f4/libopencm3_stm32f4.ld26
8 files changed, 90 insertions, 64 deletions
diff --git a/lib/lm3s/libopencm3_lm3s.ld b/lib/lm3s/libopencm3_lm3s.ld
index d6de32b..ceb391a 100644
--- a/lib/lm3s/libopencm3_lm3s.ld
+++ b/lib/lm3s/libopencm3_lm3s.ld
@@ -36,9 +36,24 @@ SECTIONS
. = ALIGN(4);
*(.rodata*) /* Read-only data */
. = ALIGN(4);
- _etext = .;
} >rom
+ /*
+ * Another section used by C++ stuff, appears when using newlib with
+ * 64bit (long long) printf support
+ */
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >rom
+ .ARM.exidx : {
+ __exidx_start = .;
+ *(.ARM.exidx*)
+ __exidx_end = .;
+ } >rom
+
+ . = ALIGN(4);
+ _etext = .;
+
.data : {
_data = .;
*(.data*) /* Read-write initialized data */
@@ -60,12 +75,6 @@ SECTIONS
*/
/DISCARD/ : { *(.eh_frame) }
- /*
- * Another section used by C++ stuff, appears when using newlib with
- * 64bit (long long) printf support - discard it for now.
- */
- /DISCARD/ : { *(.ARM.exidx) }
-
. = ALIGN(4);
end = .;
}
diff --git a/lib/lpc13xx/libopencm3_lpc13xx.ld b/lib/lpc13xx/libopencm3_lpc13xx.ld
index 3d683de..4e0f1df 100644
--- a/lib/lpc13xx/libopencm3_lpc13xx.ld
+++ b/lib/lpc13xx/libopencm3_lpc13xx.ld
@@ -36,9 +36,24 @@ SECTIONS
. = ALIGN(4);
*(.rodata*) /* Read-only data */
. = ALIGN(4);
- _etext = .;
} >rom
+ /*
+ * Another section used by C++ stuff, appears when using newlib with
+ * 64bit (long long) printf support
+ */
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >rom
+ .ARM.exidx : {
+ __exidx_start = .;
+ *(.ARM.exidx*)
+ __exidx_end = .;
+ } >rom
+
+ . = ALIGN(4);
+ _etext = .;
+
.data : {
_data = .;
*(.data*) /* Read-write initialized data */
@@ -60,12 +75,6 @@ SECTIONS
*/
/DISCARD/ : { *(.eh_frame) }
- /*
- * Another section used by C++ stuff, appears when using newlib with
- * 64bit (long long) printf support - discard it for now.
- */
- /DISCARD/ : { *(.ARM.exidx) }
-
. = ALIGN(4);
end = .;
}
diff --git a/lib/lpc17xx/libopencm3_lpc17xx.ld b/lib/lpc17xx/libopencm3_lpc17xx.ld
index 3d683de..4e0f1df 100644
--- a/lib/lpc17xx/libopencm3_lpc17xx.ld
+++ b/lib/lpc17xx/libopencm3_lpc17xx.ld
@@ -36,9 +36,24 @@ SECTIONS
. = ALIGN(4);
*(.rodata*) /* Read-only data */
. = ALIGN(4);
- _etext = .;
} >rom
+ /*
+ * Another section used by C++ stuff, appears when using newlib with
+ * 64bit (long long) printf support
+ */
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >rom
+ .ARM.exidx : {
+ __exidx_start = .;
+ *(.ARM.exidx*)
+ __exidx_end = .;
+ } >rom
+
+ . = ALIGN(4);
+ _etext = .;
+
.data : {
_data = .;
*(.data*) /* Read-write initialized data */
@@ -60,12 +75,6 @@ SECTIONS
*/
/DISCARD/ : { *(.eh_frame) }
- /*
- * Another section used by C++ stuff, appears when using newlib with
- * 64bit (long long) printf support - discard it for now.
- */
- /DISCARD/ : { *(.ARM.exidx) }
-
. = ALIGN(4);
end = .;
}
diff --git a/lib/lpc43xx/libopencm3_lpc43xx.ld b/lib/lpc43xx/libopencm3_lpc43xx.ld
index b7f1d14..9402a54 100644
--- a/lib/lpc43xx/libopencm3_lpc43xx.ld
+++ b/lib/lpc43xx/libopencm3_lpc43xx.ld
@@ -42,12 +42,18 @@ SECTIONS
. = ALIGN(4);
} >rom
- /* exception index - required due to libgcc.a issuing /0 exceptions */
- __exidx_start = .;
+ /*
+ * Another section used by C++ stuff, appears when using newlib with
+ * 64bit (long long) printf support
+ */
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >rom
.ARM.exidx : {
+ __exidx_start = .;
*(.ARM.exidx*)
- } > rom
- __exidx_end = .;
+ __exidx_end = .;
+ } >rom
. = ALIGN(4);
_etext = .;
@@ -69,23 +75,12 @@ SECTIONS
_ebss = .;
} >ram
- /* exception unwind data - required due to libgcc.a issuing /0 exceptions */
- .ARM.extab : {
- *(.ARM.extab*)
- } >ram
-
/*
* The .eh_frame section appears to be used for C++ exception handling.
* You may need to fix this if you're using C++.
*/
/DISCARD/ : { *(.eh_frame) }
- /*
- * Another section used by C++ stuff, appears when using newlib with
- * 64bit (long long) printf support - discard it for now.
- */
- /DISCARD/ : { *(.ARM.exidx) }
-
. = ALIGN(4);
end = .;
diff --git a/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld b/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld
index 4037ddc..06f7708 100644
--- a/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld
+++ b/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld
@@ -43,12 +43,18 @@ SECTIONS
. = ALIGN(4);
} >rom
- /* exception index - required due to libgcc.a issuing /0 exceptions */
- __exidx_start = .;
+ /*
+ * Another section used by C++ stuff, appears when using newlib with
+ * 64bit (long long) printf support
+ */
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >rom
.ARM.exidx : {
+ __exidx_start = .;
*(.ARM.exidx*)
- } > rom
- __exidx_end = .;
+ __exidx_end = .;
+ } >rom
. = ALIGN(4);
_etext = .;
@@ -70,24 +76,12 @@ SECTIONS
_ebss = .;
} >ram_data
- /* exception unwind data - required due to libgcc.a issuing /0 exceptions */
- .ARM.extab : {
- . = _ebss;
- *(.ARM.extab*)
- } >ram_data
-
/*
* The .eh_frame section appears to be used for C++ exception handling.
* You may need to fix this if you're using C++.
*/
/DISCARD/ : { *(.eh_frame) }
- /*
- * Another section used by C++ stuff, appears when using newlib with
- * 64bit (long long) printf support - discard it for now.
- */
- /DISCARD/ : { *(.ARM.exidx) }
-
. = ALIGN(4);
end = .;
diff --git a/lib/stm32/f1/libopencm3_stm32f1.ld b/lib/stm32/f1/libopencm3_stm32f1.ld
index c4a1bce..9d165f6 100644
--- a/lib/stm32/f1/libopencm3_stm32f1.ld
+++ b/lib/stm32/f1/libopencm3_stm32f1.ld
@@ -36,7 +36,6 @@ SECTIONS
. = ALIGN(4);
*(.rodata*) /* Read-only data */
. = ALIGN(4);
- _etext = .;
} >rom
/*
@@ -52,6 +51,9 @@ SECTIONS
__exidx_end = .;
} >rom
+ . = ALIGN(4);
+ _etext = .;
+
.data : {
_data = .;
*(.data*) /* Read-write initialized data */
diff --git a/lib/stm32/f2/libopencm3_stm32f2.ld b/lib/stm32/f2/libopencm3_stm32f2.ld
index c4a1bce..9d165f6 100644
--- a/lib/stm32/f2/libopencm3_stm32f2.ld
+++ b/lib/stm32/f2/libopencm3_stm32f2.ld
@@ -36,7 +36,6 @@ SECTIONS
. = ALIGN(4);
*(.rodata*) /* Read-only data */
. = ALIGN(4);
- _etext = .;
} >rom
/*
@@ -52,6 +51,9 @@ SECTIONS
__exidx_end = .;
} >rom
+ . = ALIGN(4);
+ _etext = .;
+
.data : {
_data = .;
*(.data*) /* Read-write initialized data */
diff --git a/lib/stm32/f4/libopencm3_stm32f4.ld b/lib/stm32/f4/libopencm3_stm32f4.ld
index 25b0ace..9d165f6 100644
--- a/lib/stm32/f4/libopencm3_stm32f4.ld
+++ b/lib/stm32/f4/libopencm3_stm32f4.ld
@@ -38,13 +38,18 @@ SECTIONS
. = ALIGN(4);
} >rom
- /* exception index - required due to libgcc.a issuing /0 exceptions */
- __exidx_start = .;
+ /*
+ * Another section used by C++ stuff, appears when using newlib with
+ * 64bit (long long) printf support
+ */
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >rom
.ARM.exidx : {
- *(.ARM.exidx*)
- } > rom
- __exidx_end = .;
-
+ __exidx_start = .;
+ *(.ARM.exidx*)
+ __exidx_end = .;
+ } >rom
. = ALIGN(4);
_etext = .;
@@ -64,10 +69,11 @@ SECTIONS
_ebss = .;
} >ram
- /* exception unwind data - required due to libgcc.a issuing /0 exceptions */
- .ARM.extab : {
- *(.ARM.extab*)
- } >ram
+ /*
+ * The .eh_frame section appears to be used for C++ exception handling.
+ * You may need to fix this if you're using C++.
+ */
+ /DISCARD/ : { *(.eh_frame) }
. = ALIGN(4);
end = .;