Hi folks-
Another hobbyist playing with the new GCC 4.8 compiler noticed an oddity that is inconsistent at least with the older MSPGCC. The linker section *(COMMON), which seems to store global variables, is in the ".noinit" section in the linker scripts provided with the GCC 4.8 install.
This means uninitialized globals such as:
volatile unsigned short sleep_counter;
would end up in .noinit, where its value is not necessarily initialized (to 0) on powerup like it would if it were in the ".bss" segment. On the older MSPGCC, *(COMMON) was stored in .bss and initialized to 0 on reset every time.
It seems this compiler will put a global variable into .bss if you give it an initializer of 0:
volatile unsigned short sleep_counter = 0;
and into the .data section if you give it a non-zero initializer:
volatile unsigned short sleep_counter = 5;
which is as expected. Is this ".noinit" for globals w/o explicit value declaration a general policy that TI is sticking with for the GCC environment?