mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-29 21:30:39 +00:00
Fix bss section placement in db mode
If bss contained anything a linker error was emitted about overlapping sections. Moving the .bss section to after the .rwtext, and adding a dummy section to pad data bus access to the bss section fixes this.
This commit is contained in:
parent
91ea205446
commit
99ae152f55
@ -86,14 +86,6 @@ SECTIONS
|
||||
} > REGION_DATA
|
||||
|
||||
_data_size = _edata - _sdata + 8;
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
_sbss = .;
|
||||
*(.sbss .sbss.* .bss .bss.*);
|
||||
. = ALIGN(4);
|
||||
_ebss = .;
|
||||
} > REGION_BSS
|
||||
|
||||
.rwtext ORIGIN(REGION_RWTEXT) + _data_size : AT(_text_size + _rodata_size + _data_size){
|
||||
_srwtext = .;
|
||||
*(.rwtext);
|
||||
@ -102,6 +94,22 @@ SECTIONS
|
||||
} > REGION_RWTEXT
|
||||
_rwtext_size = _erwtext - _srwtext + 8;
|
||||
|
||||
.rwtext.dummy (NOLOAD):
|
||||
{
|
||||
/* This section is required to skip .rwtext area because REGION_RWTEXT
|
||||
* and REGION_BSS reflect the same address space on different buses.
|
||||
*/
|
||||
. = ORIGIN(REGION_BSS) + _rwtext_size;
|
||||
} > REGION_BSS
|
||||
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
_sbss = .;
|
||||
*(.sbss .sbss.* .bss .bss.*);
|
||||
. = ALIGN(4);
|
||||
_ebss = .;
|
||||
} > REGION_BSS
|
||||
|
||||
/* fictitious region that represents the memory available for the heap */
|
||||
.heap (NOLOAD) :
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user