Forum Discussion
Altera_Forum
Honored Contributor
21 years agoNetJohn,
> For one part of it, we need to fix a constant structure at a known > location in Flash. There are several ways you can do this. One way is to place the data in it's own section. E.g.: C Language:struct foo bar __attribute__ ((section (".fixed.struct"))) = { 0 }; Then locate it at a fixed address with an output section in your linker command file. E.g., put the struct at 0xffff0000: .fixed.struct 0xffff0000 :
{
*(.fixed.struct)
} Another way (which I prefer) is to put the struct definition in it's _own_ C module. E.g.: in module foo.c: struct foo bar = {some initialized data }; Then locate module's .data section at a fixed address with an output section in your linker command file. E.g.: .fixed.struct 0xffff0000 :
{
foo.o (.data)
} If the data isn't initialized use .bss. > Can anyone point me in the right direction? A little dated, but most of the good stuff hasn't changed much: http://www.gnu.org/software/binutils/manua...d-2.9.1/ld.html (http://www.gnu.org/software/binutils/manual/ld-2.9.1/ld.html) Or try use info ld on a linux system. > The linker is GNU-based, correct? Yes. > So GNU's LD docs should be applicable? Yes. Regards, --Scott