aboutsummaryrefslogtreecommitdiff
path: root/lib/stm32/f4/libopencm3_stm32f4.ld
diff options
context:
space:
mode:
authorGareth McMullin2011-11-12 13:22:25 +1300
committerGareth McMullin2011-11-12 21:29:41 +1300
commit7546ad9736af3d7fa6d5ce1caa9008aecd97f651 (patch)
treeb363d0ba57115454202006a8450a9e3235a44b7a /lib/stm32/f4/libopencm3_stm32f4.ld
parent6ce8d610976e79f5c6649d16638b6c1daf45c887 (diff)
Fixed loading of .data in linker scripts.
This fixes a problem where the linker included some padding bytes between the end of the .text section (_etext) and the start of the .data section. The C runtime copies from _etext, so all static initialised data was corrupted. This change forces the .data section to be written at _etext to avoid this problem.
Diffstat (limited to 'lib/stm32/f4/libopencm3_stm32f4.ld')
-rw-r--r--lib/stm32/f4/libopencm3_stm32f4.ld4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/stm32/f4/libopencm3_stm32f4.ld b/lib/stm32/f4/libopencm3_stm32f4.ld
index 54cf07f..57ca309 100644
--- a/lib/stm32/f4/libopencm3_stm32f4.ld
+++ b/lib/stm32/f4/libopencm3_stm32f4.ld
@@ -40,12 +40,12 @@ SECTIONS
. = ORIGIN(ram);
- .data : {
+ .data : AT(_etext) {
_data = .;
*(.data*) /* Read-write initialized data */
. = ALIGN(4);
_edata = .;
- } >ram AT >rom
+ } >ram
.bss : {
*(.bss*) /* Read-write zero initialized data */