Forum Discussion
Altera_Forum
Honored Contributor
12 years agoI believe you are looking for the "section" attribute via GCC.
char foo __attribute__ ((section("FOO_SECTION"))); You then need to modify your linker script (via nios2-bsp-editor) to create a named section (e.g. "FOO_SECTION") which is located in the memory hardware of your choice. The GCC manual is here: http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc.pdf Functions are discussed on page 238. Variables are discussed on page 249. You can also do it via the linker script if needed (e.g. if you want to manipulate binary objects instead of source code).