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.
This commit is contained in:
Nicolas Schodet
2012-09-03 19:49:47 +02:00
parent 2a35377980
commit 74cd991e7e
14 changed files with 30 additions and 19 deletions

View File

@@ -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 */