From 87e06756a59bf51fa7dc7ac2aab14d3137ca155c Mon Sep 17 00:00:00 2001
From: Ian Martin <ian@locicontrols.com>
Date: Thu, 19 May 2016 15:54:02 -0400
Subject: [PATCH] cortexm_common: move the stack to the bottom of RAM

---
 cpu/cortexm_common/ldscripts/cortexm_base.ld | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/cpu/cortexm_common/ldscripts/cortexm_base.ld b/cpu/cortexm_common/ldscripts/cortexm_base.ld
index 6865e913bc..5165aa088f 100644
--- a/cpu/cortexm_common/ldscripts/cortexm_base.ld
+++ b/cpu/cortexm_common/ldscripts/cortexm_base.ld
@@ -101,6 +101,16 @@ SECTIONS
     . = ALIGN(4);
     _etext = .;
 
+    /* stack section */
+    .stack (NOLOAD):
+    {
+        . = ALIGN(8);
+        _sstack = .;
+        KEEP (*(.isr_stack))
+        . = ALIGN(8);
+        _estack = .;
+    } > ram
+
     .relocate : AT (_etext)
     {
         . = ALIGN(4);
@@ -124,16 +134,6 @@ SECTIONS
         _ezero = .;
     } > ram
 
-    /* stack section */
-    .stack (NOLOAD):
-    {
-        . = ALIGN(8);
-        _sstack = .;
-        KEEP (*(.isr_stack))
-        . = ALIGN(8);
-        _estack = .;
-    } > ram
-
     /* heap section */
     . = ALIGN(4);
     _sheap = . ;
-- 
GitLab