diff options
Diffstat (limited to 'ld/scripttempl/avr.sc')
-rw-r--r-- | ld/scripttempl/avr.sc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc index c11de86..478da38 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. */ |