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:
parent
6ce8d61097
commit
7546ad9736
@ -40,12 +40,12 @@ SECTIONS
|
|||||||
|
|
||||||
. = ORIGIN(ram);
|
. = ORIGIN(ram);
|
||||||
|
|
||||||
.data : {
|
.data : AT(_etext) {
|
||||||
_data = .;
|
_data = .;
|
||||||
*(.data*) /* Read-write initialized data */
|
*(.data*) /* Read-write initialized data */
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_edata = .;
|
_edata = .;
|
||||||
} >ram AT >rom
|
} >ram
|
||||||
|
|
||||||
.bss : {
|
.bss : {
|
||||||
*(.bss*) /* Read-write zero initialized data */
|
*(.bss*) /* Read-write zero initialized data */
|
||||||
|
@ -40,12 +40,12 @@ SECTIONS
|
|||||||
|
|
||||||
. = ORIGIN(ram);
|
. = ORIGIN(ram);
|
||||||
|
|
||||||
.data : {
|
.data : AT(_etext) {
|
||||||
_data = .;
|
_data = .;
|
||||||
*(.data*) /* Read-write initialized data */
|
*(.data*) /* Read-write initialized data */
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_edata = .;
|
_edata = .;
|
||||||
} >ram AT >rom
|
} >ram
|
||||||
|
|
||||||
.bss : {
|
.bss : {
|
||||||
*(.bss*) /* Read-write zero initialized data */
|
*(.bss*) /* Read-write zero initialized data */
|
||||||
|
@ -40,12 +40,12 @@ SECTIONS
|
|||||||
|
|
||||||
. = ORIGIN(ram);
|
. = ORIGIN(ram);
|
||||||
|
|
||||||
.data : {
|
.data : AT(_etext) {
|
||||||
_data = .;
|
_data = .;
|
||||||
*(.data*) /* Read-write initialized data */
|
*(.data*) /* Read-write initialized data */
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_edata = .;
|
_edata = .;
|
||||||
} >ram AT >rom
|
} >ram
|
||||||
|
|
||||||
.bss : {
|
.bss : {
|
||||||
*(.bss*) /* Read-write zero initialized data */
|
*(.bss*) /* Read-write zero initialized data */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user