I am experimenting with GNU LD linker scripts and I have defined two memory blocks, using the MEMORY
command, like this:
MEMORY
{
code [(rx)] : ORIGIN = 0x00010000, LENGTH = 0x00020000 /* 128 kB */
heap [(rwx)] : ORIGIN = 0x40000000, LENGTH = 0x00020000 /* 128 kB */
}
This will check that the sections I insert in each memory block will fit in the specified size, but I also want to check that the output file size doesn't exceed 256kB. Is there a way to do this from a linker script?