This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I have queries regarding .cinit section in EABI format with linker option -rom-mode on C6670.
---> .cinit is seems to be keep the value for global and statically explicitly initialized variable. This includes .bss,.const,.fardata
section of the EABI format. .cinit generally not a part of EABI executable format except if I have selected -rom-model option during
linking.
Because of the above behavior, I have seen that if I define a huge data globally and also initialized it at the time of definition than
in executable, it reserved space in .cinit and as well as one of the .bss,.const or .fardata(depends on the ways data declared) which results in
twice the size of the data space.
for e.g.
const int array[10000] = {0};
The above definition would result in increase of both .const and .cinit by (10000*4) bytes. Considering the scarcity of resources, I should see
if better utilization of resources possible. Please explain if there is a way to save this extra space except -ram-model.
Regards,
Parshant
Hi,
In my project, the .cinit section doesn't grow and the array is zero init or rle compressed (depending on it is initialized with all zero or with not).
Hi Alberto,
Yes, try again with following.Define an array
for e.g.
int test[20] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
I meant explicitly initialize the array and than compare the map.
Thanks,
Parshant
Hi,
With your test case the linker compression has no effect and also add an overhead of 6 bytes. It is correct. In this case, since the data are modifiable, it is not possible to do better (I suppose). If You make it const, the test array is removed from the .cinit section.
Hi Albreto,
Yes you are right but if the array cant be declared as constant than the overhead remains. Anyways thanks sharing valuable information.
Regards,
Parshant