From 74cd991e7e8972cf22933743c847b5ce2b165798 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Mon, 3 Sep 2012 19:49:47 +0200 Subject: Use a specific symbol for data source address in flash That way, data source address does not depend on any other unrelated change in linker script. This also fixes cases when .data input section is aligned on 8 bytes. The new version does not provide any address for the output section so that it is aligned to the strictest input section. The _data_loadaddr symbol will always take this alignment into account. --- lib/stm32/f1/libopencm3_stm32f1.ld | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/stm32/f1/libopencm3_stm32f1.ld') diff --git a/lib/stm32/f1/libopencm3_stm32f1.ld b/lib/stm32/f1/libopencm3_stm32f1.ld index f4f8e3b..c4a1bce 100644 --- a/lib/stm32/f1/libopencm3_stm32f1.ld +++ b/lib/stm32/f1/libopencm3_stm32f1.ld @@ -52,12 +52,13 @@ SECTIONS __exidx_end = .; } >rom - .data : AT (__exidx_end) { + .data : { _data = .; *(.data*) /* Read-write initialized data */ . = ALIGN(4); _edata = .; - } >ram + } >ram AT >rom + _data_loadaddr = LOADADDR(.data); .bss : { *(.bss*) /* Read-write zero initialized data */ -- cgit v1.2.3