From 925bbbbb989a9bef73a13d6085b2674fe8b90048 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 20 Nov 2013 16:51:21 +0000 Subject: * scripttempl/elf32msp430.sc (.data): Set the based on the next free location in the text memory region, not a computation based upon the size of the text section. Orphaned sections or other linker scripts might insert new sections between the .text section and the .data section. * scripttempl/elf32msp430_3.sc (.data): Likewise. --- ld/ChangeLog | 9 +++++++++ ld/scripttempl/elf32msp430.sc | 6 +++--- ld/scripttempl/elf32msp430_3.sc | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index 2ea3b61..681a08b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2013-11-20 Nick Clifton + + * scripttempl/elf32msp430.sc (.data): Set the based on the next + free location in the text memory region, not a computation based + upon the size of the text section. Orphaned sections or other + linker scripts might insert new sections between the .text section + and the .data section. + * scripttempl/elf32msp430_3.sc (.data): Likewise. + 2013-11-19 Roland McGrath Alan Modra diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc index c699a91..38df7a4 100644 --- a/ld/scripttempl/elf32msp430.sc +++ b/ld/scripttempl/elf32msp430.sc @@ -222,8 +222,8 @@ SECTIONS ${RELOCATING+ _vectors_end = . ; } } ${RELOCATING+ > vectors} - .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text) + SIZEOF (.rodata))} - { + .data ${RELOCATING-0} : + { ${RELOCATING+ PROVIDE (__data_start = .) ; } ${RELOCATING+ PROVIDE (__datastart = .) ; } ${RELOCATING+. = ALIGN(2);} @@ -242,7 +242,7 @@ SECTIONS *(.sdata .sdata.* .gnu.linkonce.s.*) ${RELOCATING+. = ALIGN(2);} ${RELOCATING+ _edata = . ; } - } ${RELOCATING+ > data} + } ${RELOCATING+ > data ${RELOCATING+AT> text}} .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : { diff --git a/ld/scripttempl/elf32msp430_3.sc b/ld/scripttempl/elf32msp430_3.sc index ade5fcb..7209f47 100644 --- a/ld/scripttempl/elf32msp430_3.sc +++ b/ld/scripttempl/elf32msp430_3.sc @@ -124,7 +124,7 @@ SECTIONS *(.const:*) } ${RELOCATING+ > text} - .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))} + .data ${RELOCATING-0} : { ${RELOCATING+ PROVIDE (__data_start = .) ; } ${RELOCATING+. = ALIGN(2);} @@ -133,7 +133,7 @@ SECTIONS *(.gnu.linkonce.d*) ${RELOCATING+. = ALIGN(2);} ${RELOCATING+ _edata = . ; } - } ${RELOCATING+ > data} + } ${RELOCATING+ > data ${RELOCATING+AT> text}} .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : { -- cgit v1.1