Hello,
I am trying to order the placement of variables within a section without having to define a new section for each variable. So, in two source files there are variables placed in the .sysmem section. During the build process, the variable Variable01 is placed before Variable02, but I really want Variable02to be placed at the beginning of the section no matter what.
#pragma DATA_SECTION (Variable02, ".sysmem"); #pragma DATA_SECTION (Variable01, ".sysmem");
In the SECTIONS area of the Linker Directives I can use the following:
SECTIONS { ... .sysmem : { Variable02_Src_File.obj Variable01_Src_File.obj } > RAM /* DYNAMIC MEMORY ALLOCATION AREA */ ... }
But since there is executable code in this files the executable code goes into those sections too which is not what I want, only these two variables. I have tried something like:
SECTIONS { ... .sysmem : { *(.sysmem); Variable02= .; Variable01= .; } > RAM ... }
Which is declaring two variables within the section, so during the build it fails since there are now two instantiations of each variable. So, that does not work. I supposed I could try moving each of these variables into one common file and declare one variable before another until the ordering is correct, but I am afraid that would break down the road. Does anyone know how to accomplish this?
Regards,
Mark