Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- Another problem with multiple segments is that (last time I looked at least) the linker script puts the their initialisation data immediately following the .code, and adds code to copy them to the required place. This is all hopeless when your code is a small tightly coupled memory block. --- Quote End --- That's not a problem - for reliability I need to keep the complete image including all initialised data in the code ITCM, and write protect it so that there is no chance that the image can be corrupted by a rogue pointer access. What I want is to locate some const structures to a specific TCM for use by a DMA engine. The BSP settings allow you to select whether the .rodata and .rwdata sections are copied into their runtime location. If I create a new section, how can I get the crt to also copy this into place? --- Quote Start --- It can also be worth assigning a 'global register variable' to base of a large struct that contains (up to 32k) of variables. The compiler will actually generate better code for this than the GP relative addressing used for 'small' data items. --- Quote End --- Thanks, that is very useful to know.