Skip to content

Commit 118b9a7

Browse files
authored
Merge pull request #578 from tlevora/fix/stack-end-placement
Fix stack end placement
2 parents 5bf528a + 7dfda86 commit 118b9a7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cortex-m-rt/link.x.in

+5-4
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,12 @@ SECTIONS
182182
__euninit = .;
183183
} > RAM
184184

185-
/* Place the heap right after `.uninit` in RAM */
186-
PROVIDE(__sheap = __euninit);
185+
/* Align `__sheap` and `_stack_end` pointers to 4 bytes */
186+
. = ALIGN(4);
187187

188-
/* Place stack end at the end of allocated RAM */
189-
PROVIDE(_stack_end = __euninit);
188+
/* Place the heap start and stack end at the end of allocated RAM */
189+
PROVIDE(__sheap = .);
190+
PROVIDE(_stack_end = .);
190191

191192
/* ## .got */
192193
/* Dynamic relocations are unsupported. This section is only used to detect relocatable code in

0 commit comments

Comments
 (0)