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.

.bss not being cleared in EABI

I'm using this command to compile my code:

-mv7A8 -g --gcc --include_path="C:/Documents and Settings/mgessner/Desktop/workspace/am35xxlib/include" --include_path="C:/Documents and Settings/mgessner/Desktop/workspace/tasngbl" --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/TMS470 Code Generation Tools 4.6.4/include" --diag_warning=225 -me --enum_type=packed --abi=eabi --code_state=32 -k --asm_listing

If I don't explicitly clear out .bss before _c_int00 is invoked, my code doesn't run properly because there may be garbage where 0 is expected.

I've found a few places (the EABI migration pdf file, and http://processors.wiki.ti.com/index.php/TI_Compilers_and_Industry_Standards#Variations_from_the_C_standard which explicitly state the ARM EABI compiler WILL do this.

Why am I not seeing this?

  • As you pointed out, in EABI the compiler should preinitialize uninitialized variables to zero, and I haven't found any known issues or bug reports on this issue. Could you provide a small example we could use to reproduce this issue?

  • I will try to do that this afternoon.

    I'll then zip up the entire project and put it here.

     

  • I set up a very simple program, just copying a buffer declared outside main to a location in SRAM.  Nothing bizarre.

    With --rom_model, it turns out that __TI_zero_init is invoked.  With --ram_model, it's not.

    I've been using --ram_model, because I've been running out of the SRAM, but as it turns out, --rom_model appears to be what I should be using.

    Oh, well.

    Thanks for offering to look.

    Issue appears to be solved.

    If there are related issues, I'll post them here.