summaryrefslogtreecommitdiff
path: root/ld/scripttempl
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-06-07 16:53:09 +0000
committerNick Clifton <nickc@redhat.com>2012-06-07 16:53:09 +0000
commit080c93892b8871552c3ee1b71708d46b87650b35 (patch)
treec0cd5d6d2a37fed030ca7a889486dd13306718db /ld/scripttempl
parent43e2153bfb05d35004a18f9303d4e056b210686e (diff)
downloadbinutils-redhat-080c93892b8871552c3ee1b71708d46b87650b35.tar.gz
PR 13697
* scripttempl/avr.sc (.data): Keep it.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r--ld/scripttempl/avr.sc5
1 files changed, 4 insertions, 1 deletions
diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc
index c11de86273..478da38541 100644
--- a/ld/scripttempl/avr.sc
+++ b/ld/scripttempl/avr.sc
@@ -161,7 +161,10 @@ SECTIONS
.data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
{
${RELOCATING+ PROVIDE (__data_start = .) ; }
- *(.data)
+ /* --gc-sections will delete empty .data. This leads to wrong start
+ addresses for subsequent sections because -Tdata= from the command
+ line will have no effect, see PR13697. Thus, keep .data */
+ KEEP (*(.data))
*(.data*)
*(.rodata) /* We need to include .rodata here if gcc is used */
*(.rodata*) /* with -fdata-sections. */