Given your example linker script, these two questions are related.
From what I understand the execution address is used by the linker to do the symbol resolution of all elements which are not PC relative, but what about the load address?
In the same way, how can the linker have any influence on the SDRAM being (rx) or (rw) at run-time? Does it actually change anything when I modify those options in the memory regions?
The LOAD
address is useful as everything must be programmed to FLASH. This is why .ram_data
should have AT>ROM
. It is telling the linker that the data will LOAD
from the ROM/Flash. You have to make some assembler boot code that will copy it from flash to SDRAM in this case.
The 2nd question can be answered by putting >ROM
for the .ram_data
section. If you do this, the linker will complain that a write-able section is being placed in read-only memory. It is good to mark the MEMORY
sections with read/write information as it can help to make sure you have the sections in the correct places. Ie, it is a cross check on the information you give the linker.
A mistake where >RAM AT>ROM
is instead just >ROM
makes the concepts/questions similar.