Based on an old PR that was closed automatically and kept as an idea, although I can't copy the whole conversation with @leptun
Instead of using TEXT_REGION_LENGTH define a custom script to
enforce the available space for the .text section. The script also
defines a custom .boot section at the appropriate location.
This section can be abused in debug builds to take advantage of the
extra space. To do so, the optional function "boot" is placed at the
beginning of the section and jumps back to zero, allowing code to
continue unaffected.
In turn, this allows to move the motion speed tables into the boot
section, freeing about 2k of space necessary for the debug builds to
work.
Perhaps not ideal as we manually need to tag functions/data, but
seems to be the only option for avr-ld.
Based on an old PR that was closed automatically and kept as an idea, although I can't copy the whole conversation with @leptun
Instead of using TEXT_REGION_LENGTH define a custom script to enforce the available space for the .text section. The script also defines a custom .boot section at the appropriate location.
This section can be abused in debug builds to take advantage of the extra space. To do so, the optional function "boot" is placed at the beginning of the section and jumps back to zero, allowing code to continue unaffected.
In turn, this allows to move the motion speed tables into the boot section, freeing about 2k of space necessary for the debug builds to work.
Perhaps not ideal as we manually need to tag functions/data, but seems to be the only option for avr-ld.