pico-sdk
pico-sdk copied to clipboard
Make spacer sections allocatable
As raised in #2513, the current way of specifying stack and heap space means that on GCC the space is not included in --print-memory-usage, because they are not marked as allocatable in order to maintain compatibility with linker scripts prior to 1.5.1 which don't KEEP the .stack and .heap sections.
This changes that default to mark them as allocatable, and adds a new CMake function to parse the linker script and check for compatibility, and enables a workaround if not compatible.
This means if you:
KEEPthe sections - they show up in--print-memory-usage, and the binary runs fine- Don't
KEEPthe sections - they don't show up in--print-memory-usage, and CMake raises warnings at the configure stage explaining the incompatibility, but the binary still runs fine