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.

controlling linker size/placement of .bss section

I want to place my .bss section in L1DSRAM to speed up access to global variables, but I don't want to use up 32k of precious fast memory.  Is there a way to set size limits on compiler sections?  I would like to limit the .bss section size to something smaller and have the compiler/linker give me a warning/error if I exceed this new smaller limit with near global data.  I basically want to put the (smaller) .bss section and my own reserved section into internal RAM.  The sum of the 2 is > 32K, so I can't just lump my own section in with .bss.

  • If you create a memory segment in the L1D space of a size that you want the .bss to be smaller than and assign the .bss section to that memory segment, than you will get a linker error if the .bss section ends up being too large to fit in the memory segment. For example make a L1DSRAM_BSS and L1DSRAM_MYOWNRESERVEDSECTION instead of a single L1DSRAM, assuming you are using BIOS you can do this through the memory management section of the BIOS configuration GUI.