I have defined sets of constants in a structure table that I want to place in memory at linker time (so statically, not dynamically) using the following pattern:
Assuming I have a table of 3 structs of type
. The StructType has a size of 20 bytes.
Address : Content
0xA000 : MyVar
0xA100 : MyVar
0xA200 : MyVar
Each struct is followed by 236 (=0x100 - 20d) empty bytes in the examples.
I know this relies a lot on the specific instructions of the used linker/compiler, but is there a way to achieve that ?
The following would end up with the same result, but with different variables instead of a table:
const StructType MyVar1 __attrib(0xA000) = bla foo;
const StructType MyVar2 __attrib(0xA100) = bla foo;
const StructType MyVar3 __attrib(0xA200) = bla foo;
Thanks for your advice !