ldscripts: move .noinit section behind .bss section

If the .noinit section starts at the beginning of the RAM,
a bootloader that is unaware of it will clear it.
Instead, move it behind the .bss section, hoping that a bootloader
will always use less .bss memory than RIOT proper.
This commit is contained in:
Benjamin Valentin 2019-05-16 23:11:45 +02:00
parent 1a3e1590d3
commit 1c3f96495d
2 changed files with 23 additions and 24 deletions

View File

@ -127,17 +127,6 @@ SECTIONS
_erelocate = .;
} > ram AT> rom
/*
* collect all uninitialized sections that go into RAM
*/
.noinit (NOLOAD) :
{
__noinit_start = .;
*(.noinit)
. = ALIGN(4);
__noinit_end = .;
} > ram
/* .bss section which is used for uninitialized data */
.bss (NOLOAD) :
{
@ -151,6 +140,17 @@ SECTIONS
_ezero = .;
} > ram
/*
* collect all uninitialized sections that go into RAM
*/
.noinit (NOLOAD) :
{
__noinit_start = .;
*(.noinit)
. = ALIGN(4);
__noinit_end = .;
} > ram
/* heap section */
. = ALIGN(4);
_sheap = . ;

View File

@ -154,19 +154,6 @@ SECTIONS
end_dtors = .;
} >ram
/*
* collect all uninitialized sections that go into RAM
*/
.noinit (NOLOAD) :
{
__noinit_start = .;
PROVIDE(__fiq_handler = .);
*(.fiq)
*(.noinit)
} > ram
. = ALIGN(4);
__noinit_end = .;
/*
* collect all zero initialized sections that go into RAM
*/
@ -213,6 +200,18 @@ SECTIONS
. = ALIGN(4); /* ensure data is aligned so relocation can use 4-byte operations */
_edata = .; /* define a global symbol marking the end of the .data section */
/*
* collect all uninitialized sections that go into RAM
*/
.noinit (NOLOAD) :
{
__noinit_start = .;
PROVIDE(__fiq_handler = .);
*(.fiq)
*(.noinit)
} > ram
. = ALIGN(4);
__noinit_end = .;
/*
* Exception frames (newer linker versions generate these but they use of