The current linker description files for AVR_TINY like avrtiny.x et al are locating .rodata into SRAM which is quite a waste for devices with up to 128 Bytes of SRAM. As flash is accessible by LD instructions which read from RAM (provided an offset of 0x4000 is added), a better approach is just to add 0x4000 to the VMA of .rodata objects.
Created attachment 9658 [details] Untested patch ld/ PR target/20849 * scripttempl/avrtiny.sc (__RODATA_PM_OFFSET__): New define. (.rodata): New section. (.data): Remove .rodata*.
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fbf25dfdfdba2c057e7ccdae4e0d6a2139c66dd5 commit fbf25dfdfdba2c057e7ccdae4e0d6a2139c66dd5 Author: Georg-Johann Lay <gjl@gcc.gnu.org> Date: Mon Feb 27 17:05:53 2017 +0000 Place read-only data in the text section on AVR Tiny targets. PR target/20849 * scripttempl/avrtiny.sc (__RODATA_PM_OFFSET__): New define. (.rodata): New section. (.data): Remove .rodata*.
HI Georg-Johann, Patch approved and applied. I am really sorry about taking so long to review this patch. Cheers Nick
Mnay thanks for taking care of this!