aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-04-17 14:41:19 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-04-17 14:41:19 +0000
commitd43e444377e2f1e0db7ed93116e79c58c1520db7 (patch)
tree1f35f2dc7c55b1b1c0e36b50d0e0ea7ec45a96a3
parent6a57dd25e08f1a7164542751024429be814df5e3 (diff)
downloadChibiOS-d43e444377e2f1e0db7ed93116e79c58c1520db7.tar.gz
ChibiOS-d43e444377e2f1e0db7ed93116e79c58c1520db7.tar.bz2
ChibiOS-d43e444377e2f1e0db7ed93116e79c58c1520db7.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2884 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--demos/ARMCM3-STM32F103-G++/Makefile4
-rw-r--r--demos/ARMCM3-STM32F103-G++/ch.ld68
-rw-r--r--demos/ARMCM3-STM32F103-G++/main.cpp4
-rw-r--r--os/ports/GCC/ARMCMx/crt0.c4
4 files changed, 47 insertions, 33 deletions
diff --git a/demos/ARMCM3-STM32F103-G++/Makefile b/demos/ARMCM3-STM32F103-G++/Makefile
index 96ba1f7cd..9dba58699 100644
--- a/demos/ARMCM3-STM32F103-G++/Makefile
+++ b/demos/ARMCM3-STM32F103-G++/Makefile
@@ -123,8 +123,8 @@ CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.
# NOTE: You can use C++ even without C++ support if you are careful. C++
# runtime support makes code size explode.
-LD = $(TRGT)gcc
-#LD = $(TRGT)g++
+#LD = $(TRGT)gcc
+LD = $(TRGT)g++
CP = $(TRGT)objcopy
AS = $(TRGT)gcc -x assembler-with-cpp
OD = $(TRGT)objdump
diff --git a/demos/ARMCM3-STM32F103-G++/ch.ld b/demos/ARMCM3-STM32F103-G++/ch.ld
index e378d8868..4d97e7682 100644
--- a/demos/ARMCM3-STM32F103-G++/ch.ld
+++ b/demos/ARMCM3-STM32F103-G++/ch.ld
@@ -38,11 +38,32 @@ __ram_end__ = __ram_start__ + __ram_size__;
SECTIONS
{
. = 0;
+ _text = .;
- .text : ALIGN(16) SUBALIGN(16)
+ startup : ALIGN(16) SUBALIGN(16)
{
- _text = .;
KEEP(*(vectors))
+ } > flash
+
+ constructors : ALIGN(4) SUBALIGN(4)
+ {
+ PROVIDE(__init_array_start = .);
+ KEEP(*(SORT(.init_array.*)))
+ KEEP(*(.init_array))
+ PROVIDE(__init_array_end = .);
+ } > flash
+
+ destructors : ALIGN(4) SUBALIGN(4)
+ {
+ PROVIDE(__fini_array_start = .);
+ KEEP(*(.fini_array))
+ KEEP(*(SORT(.fini_array.*)))
+ PROVIDE(__fini_array_end = .);
+ } > flash
+
+ .text : ALIGN(16) SUBALIGN(16)
+ {
+ *(.text.startup.*)
*(.text)
*(.text.*)
*(.rodata)
@@ -50,35 +71,28 @@ SECTIONS
*(.glue_7t)
*(.glue_7)
*(.gcc*)
- *(.ARM.extab)
- *(.ARM.extab.*)
} > flash
- .ctors :
+ .ARM.extab :
{
- PROVIDE(_ctors_start_ = .);
- KEEP(*(SORT(.ctors.*)))
- KEEP(*(.ctors))
- PROVIDE(_ctors_end_ = .);
+ *(.ARM.extab* .gnu.linkonce.armextab.*)
} > flash
- .dtors :
+ .ARM.exidx : {
+ PROVIDE(__exidx_start = .);
+ *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+ PROVIDE(__exidx_end = .);
+ } > flash
+
+ .eh_frame_hdr :
{
- PROVIDE(_dtors_start_ = .);
- KEEP(*(SORT(.dtors.*)))
- KEEP(*(.dtors))
- PROVIDE(_dtors_end_ = .);
+ *(.eh_frame_hdr)
} > flash
- .ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)}
-
- __exidx_start = .;
- .ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash
- __exidx_end = .;
-
- .eh_frame_hdr : {*(.eh_frame_hdr)}
-
- .eh_frame : ONLY_IF_RO {*(.eh_frame)}
+ .eh_frame : ONLY_IF_RO
+ {
+ *(.eh_frame)
+ } > flash
. = ALIGN(4);
_etext = .;
@@ -86,26 +100,26 @@ SECTIONS
.data :
{
- _data = .;
+ PROVIDE(_data = .);
*(.data)
. = ALIGN(4);
*(.data.*)
. = ALIGN(4);
*(.ramtext)
. = ALIGN(4);
- _edata = .;
+ PROVIDE(_edata = .);
} > ram AT > flash
.bss :
{
- _bss_start = .;
+ PROVIDE(_bss_start = .);
*(.bss)
. = ALIGN(4);
*(.bss.*)
. = ALIGN(4);
*(COMMON)
. = ALIGN(4);
- _bss_end = .;
+ PROVIDE(_bss_end = .);
} > ram
}
diff --git a/demos/ARMCM3-STM32F103-G++/main.cpp b/demos/ARMCM3-STM32F103-G++/main.cpp
index ce626ee9c..aab7331fc 100644
--- a/demos/ARMCM3-STM32F103-G++/main.cpp
+++ b/demos/ARMCM3-STM32F103-G++/main.cpp
@@ -106,7 +106,7 @@ public:
/*
* Tester thread class. This thread executes the test suite.
*/
-class TesterThread : public EnhancedThread<128> {
+class TesterThread : public EnhancedThread<256> {
protected:
virtual msg_t Main(void) {
@@ -115,7 +115,7 @@ protected:
}
public:
- TesterThread(void) : EnhancedThread<128>("tester") {
+ TesterThread(void) : EnhancedThread<256>("tester") {
}
};
diff --git a/os/ports/GCC/ARMCMx/crt0.c b/os/ports/GCC/ARMCMx/crt0.c
index 90f632271..685231ed1 100644
--- a/os/ports/GCC/ARMCMx/crt0.c
+++ b/os/ports/GCC/ARMCMx/crt0.c
@@ -186,7 +186,7 @@ void __late_init(void) {}
* @note This function is a weak symbol.
*/
#if !defined(__DOXYGEN__)
-__attribute__((weak, noreturn))
+__attribute__((weak, naked))
#endif
void _default_exit(void) {
while (1)
@@ -197,7 +197,7 @@ void _default_exit(void) {
* @brief Reset vector.
*/
#if !defined(__DOXYGEN__)
-__attribute__((noreturn))
+__attribute__((naked))
#endif
void ResetHandler(void) {
uint32_t psp, ctl;