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.
This commit is contained in:
Gareth McMullin 2011-11-12 13:22:25 +13:00
parent 6ce8d61097
commit 7546ad9736
3 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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