Forum Discussion
Altera_Forum
Honored Contributor
14 years agoThe .bss section is easy to deal with - just add code early in the startup sequence to zero it (the linker will have placed symbols at its ends).
The .data section is more difficult. You might manage to get the linker to place the initialisation data at a different physical address to its expected virtual address (eg at the end of the memory block instead of following the code) - in which case your startup code can copy the initialised data to its correct virtual addres. Alternatively you can detect the first load and save the .data for restoration later. You may find there are some things in .data that you'll need to move to .rodata or .bss in order to avoid the second copy. Data private to the jtag debugger is probably much more difficult to sort our.