From fef632e18b6b6ff62fe93803650caba68fe9f33a Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 7 Jun 2012 16:53:10 +0000 Subject: [PATCH] PR 13697 * scripttempl/avr.sc (.data): Keep it. --- ld/ChangeLog | 5 +++++ ld/scripttempl/avr.sc | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 36e548b803..e292ea4590 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2012-06-07 Georg-Johann Lay + + PR 13697 + * scripttempl/avr.sc (.data): Keep it. + 2012-06-02 Andreas Schwab * Makefile.am (TEXINFO_TEX): Remove $(top_srcdir) prefix. 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. */