TI's "Uninitialized Static Objects Not Set to Zero in COFF" page, at
http://processors.wiki.ti.com/index.php/Uninitialized_Static_Objects_Not_Set_to_Zero_in_COFF ,
says,
Uninitialized static storage duration objects are not initialized to zero by the compiler when using COFF. The user must take extra steps to ensure these variables are initialized to zero.
The remedies there include using EABI, explicitly initializing variables in the source code, adding fill values to the linker command file & zeroing the .bss section before loading. The first 3 aren't sufficient choices right now, for various reasons.
Our DSP/BIOS application is loaded from the ARM with DSP/Link, so I suppose the loader is somewhere in DSP/Link.
I added a linker command file to define the start & end of .far, to make those address available when initializing:
SECTIONS {
.far: {
_far_start = .;
*(.far)
_far_end = .;
} > DDR
}
One option: create a User Init Function and use it to zero the .bss section & .far section. It runs after the initialized variables in those sections are initted, but I can re-initialize them afterwards, using the cinit table. But the DSP/BIOS User Manual & API Manual aren't clear on when the User Init Fxn runs during startup, so BIOS_init() may set values in one of those sections before UserInitFxn runs. That makes this method questionable.
How do I modify the loader to init the .bss section and .far section?
What if I just modify the autoinit.c that came with my DSP/BIOS and add lines to zero those sections, then compile it as part of my project? That seems to work, and it's simple, but no one's suggested it. What's the downside?
This is for:
- DSP/BIOS 5.41.13.42
- OMAP L138 [TMS320C67XX]
- TI v7.3.4 compiler
- Output format: legacy COFF
- Code Composer Studio v5.2.1
Thanks,
John