Skip to content

Commit fbf25df

Browse files
sprintersbnickclifton
authored andcommitted
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*.
1 parent 47612ae commit fbf25df

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

ld/ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2017-02-27 Georg-Johann Lay <gjl@gcc.gnu.org>
2+
3+
PR target/20849
4+
* scripttempl/avrtiny.sc (__RODATA_PM_OFFSET__): New define.
5+
(.rodata): New section.
6+
(.data): Remove .rodata*.
7+
18
2017-02-25 Alan Modra <amodra@gmail.com>
29

310
* testsuite/ld-elf/elf.exp: Xfail pr20995 tests on hppa64-hpux.

ld/scripttempl/avrtiny.sc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ __DATA_REGION_LENGTH__ = DEFINED(__DATA_REGION_LENGTH__) ? __DATA_REGION_LENGTH_
1919
__FUSE_REGION_LENGTH__ = DEFINED(__FUSE_REGION_LENGTH__) ? __FUSE_REGION_LENGTH__ : 2;
2020
__LOCK_REGION_LENGTH__ = DEFINED(__LOCK_REGION_LENGTH__) ? __LOCK_REGION_LENGTH__ : 2;
2121
__SIGNATURE_REGION_LENGTH__ = DEFINED(__SIGNATURE_REGION_LENGTH__) ? __SIGNATURE_REGION_LENGTH__ : 4;
22+
__RODATA_PM_OFFSET__ = DEFINED(__RODATA_PM_OFFSET__) ? __RODATA_PM_OFFSET__ : 0x4000;
2223

2324
MEMORY
2425
{
@@ -188,13 +189,18 @@ SECTIONS
188189
${RELOCATING+ _etext = . ; }
189190
} ${RELOCATING+ > text}
190191

192+
.rodata ${RELOCATING+ ADDR(.text) + SIZEOF (.text) + __RODATA_PM_OFFSET__ } ${RELOCATING-0} :
193+
{
194+
*(.rodata)
195+
${RELOCATING+ *(.rodata*)}
196+
*(.gnu.linkonce.r*)
197+
} ${RELOCATING+AT> text}
198+
191199
.data ${RELOCATING-0} :
192200
{
193201
${RELOCATING+ PROVIDE (__data_start = .) ; }
194202
*(.data)
195203
${RELOCATING+ *(.data*)}
196-
*(.rodata) /* We need to include .rodata here if gcc is used */
197-
${RELOCATING+ *(.rodata*)} /* with -fdata-sections. */
198204
*(.gnu.linkonce.d*)
199205
${RELOCATING+. = ALIGN(2);}
200206
${RELOCATING+ _edata = . ; }

0 commit comments

Comments
 (0)