I'm using GCC for and specific MCU target (to be accurate for AVR) I have a special external memory that I try to define a custom Section by using following command in linker options
-Wl,--section-start=.customsection=0x821000
and then using attribute inside the code just like this:
unsigned char X __attribute__((section (".customsection")));
everything is correct and works fine. But how can I define some limitation to this custom section that force the GCC linker to raise an error in case of overrun? By limitation I mean a way to define length of the section or end-address.