diff options
author | Georg-Johann Lay <gjl@gcc.gnu.org> | 2017-02-27 17:05:53 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-02-27 17:05:53 +0000 |
commit | fbf25dfdfdba2c057e7ccdae4e0d6a2139c66dd5 (patch) | |
tree | 47129b16ca9d33296429b487e55c047b829367e2 /ld/scripttempl | |
parent | 47612ae91c5f2de8960df1d96adf225d2455123f (diff) | |
download | gdb-fbf25dfdfdba2c057e7ccdae4e0d6a2139c66dd5.zip gdb-fbf25dfdfdba2c057e7ccdae4e0d6a2139c66dd5.tar.gz gdb-fbf25dfdfdba2c057e7ccdae4e0d6a2139c66dd5.tar.bz2 |
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*.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r-- | ld/scripttempl/avrtiny.sc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ld/scripttempl/avrtiny.sc b/ld/scripttempl/avrtiny.sc index 6fd2246..5a6d4ae 100644 --- a/ld/scripttempl/avrtiny.sc +++ b/ld/scripttempl/avrtiny.sc @@ -19,6 +19,7 @@ __DATA_REGION_LENGTH__ = DEFINED(__DATA_REGION_LENGTH__) ? __DATA_REGION_LENGTH_ __FUSE_REGION_LENGTH__ = DEFINED(__FUSE_REGION_LENGTH__) ? __FUSE_REGION_LENGTH__ : 2; __LOCK_REGION_LENGTH__ = DEFINED(__LOCK_REGION_LENGTH__) ? __LOCK_REGION_LENGTH__ : 2; __SIGNATURE_REGION_LENGTH__ = DEFINED(__SIGNATURE_REGION_LENGTH__) ? __SIGNATURE_REGION_LENGTH__ : 4; +__RODATA_PM_OFFSET__ = DEFINED(__RODATA_PM_OFFSET__) ? __RODATA_PM_OFFSET__ : 0x4000; MEMORY { @@ -188,13 +189,18 @@ SECTIONS ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > text} + .rodata ${RELOCATING+ ADDR(.text) + SIZEOF (.text) + __RODATA_PM_OFFSET__ } ${RELOCATING-0} : + { + *(.rodata) + ${RELOCATING+ *(.rodata*)} + *(.gnu.linkonce.r*) + } ${RELOCATING+AT> text} + .data ${RELOCATING-0} : { ${RELOCATING+ PROVIDE (__data_start = .) ; } *(.data) ${RELOCATING+ *(.data*)} - *(.rodata) /* We need to include .rodata here if gcc is used */ - ${RELOCATING+ *(.rodata*)} /* with -fdata-sections. */ *(.gnu.linkonce.d*) ${RELOCATING+. = ALIGN(2);} ${RELOCATING+ _edata = . ; } |