Is there a way for the gnu linker to combine memory blocks so the linker will use one sector name when assigning memory?
For example:
MEMORY
{
RAM1 (xrw) : ORIGIN = 0x20000480, LENGTH = 0x0BB80
RAM2 (xrw) : ORIGIN = 0x2001C000, LENGTH = 0x03C00
}
Can there be a memory block our sector that includes memory blocks RAM1 and RAM2? Something like this below:
.bss :
{
_bss_start = .;
*(.bss)
*(.bss.*)
*(COMMON)
_bss_end = .;
} >RAM >RAM1
Good question. There are multiple ways of to do this. One way would be to actually split the BSS section by selecting which file's BSS goes where.
Instead of doing this for each file (only useful if you have tiny RAM/ROM chips), I recommend to just place for example COMMON on RAM2, and .bss on RAM1.