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.

How to fill the .stack section with a known value in linker command file



Hi


I want to know the amout of stack required in my program.Just as the page http://processors.wiki.ti.com/index.php/Stack_and_Heap_size_requirements said:

The general recommendation to determine amout of stack required is to fill the stack with a known value (can be done in linker command file by filling the .stack section), let the program run and see how much of the stack was altered by viewing it in a memory window. This should tell how much stack was used and accordingly, the stack size can be reduced or increased as needed.


But I dont know how to fill the .stack section。Can anyone help me?

 An example or a guide picture will be much better.

Thanks.

Chunhai


  • I presume your linker command file allocates the .stack section to memory with a line similar to ...

    .stack > RAM

    You can fill this section by changing it to something like ...

    .stack > RAM, fill = 0xc0ffee00

    However, there are some things to think about.  Please read about it in the section titled Explicit Initialization of Uninitialized Sections in the Assembly Language Tools User's Guide for your processor family.  Just for convenience, here is that manual for C6000.

    Thanks and regards,

    -George