Tool/software: TI C/C++ Compiler
Hi,
I am encountering problems around variable initialization:
1) i would like to have a global variable that will not be initialized and/or set to zero. if i am assigning the variable to a specific section (pragma DATA_SECTION) it still gets initialized to zero.
the NOINIT option could/should be a solution but it forces the variable to a dedicated TI.NoInit section and i could not find a way to set a different section if using the #pragma NOINIT.
How can i do this?
2) when i have an initialized global variable (even set to a dedicated section - #pragma DATA_SECTION) the linker/compiler always set a .cinit entry for it and compresses the data.
how can i prevent this from happening - i don't want this variable to be compressed as i want the initialized data to be loaded with the image (part of the binary) so it will be available BEFORE and C decompression functions?
3) on the TI linker when will i need to use the -u flag (for example i noticed that the generated linker file from sysBios sets a -u _c_int00 --> why was this needed isnt it enough to have a .global / extern in the asm/C file ? when/how/why this -u is used?
4) If possible, can you emphasize of the difference between NOINIT and NOLOAD?
will - NOLOAD section will not occupy space on the binary but variables will get initialized by C startup routine ?
will - NOINIT section means variable never initialized - was this made only to avoid the variable being initialized to zero by C ? (what happens if a global INITIALIZED variable is set to a NOINIT section? (no warning/error there) ? if variable is never initialized doesn't it means it will behave the same as NOLOAD (no reason for it to take binary space)?
It appear (from test i made) that when setting a section with NOINIT type (on linker) - if variable is initialized, it will be loaded with the initialization and if not initialized will not be touched and both will NOT get compressed (when not using NOINIT section type, the variables, unfortunately, always get compressed /zero initialized).
5) is there a way, when assigning a section to a memory to tell the linker to allocate this section to the memory start / memory end (i could not find a "high" / "low" keywords and also i could not use symbols - the only way so far i could accomplish this is by writing the start address of the memory as a constant number but i would like to use the origin address of the memory)?
Thanks
Guy
Thanks
Guy
Thanks
Guy