* scripttempl/avr.sc: Remove KEEP for .data and
[binutils-gdb.git] / ld / scripttempl / avr.sc
index 10714e1d73ff1a54de0f0cad86abd02f5e68e19c..d356b71b1b5994e9f4e256f39df70189c167d036 100644 (file)
@@ -166,10 +166,7 @@ SECTIONS
   .data        ${RELOCATING-0} :
   {
     ${RELOCATING+ PROVIDE (__data_start = .) ; }
-    /* --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)
     ${RELOCATING+ *(.data*)}
     *(.rodata)  /* We need to include .rodata here if gcc is used */
     ${RELOCATING+ *(.rodata*)} /* with -fdata-sections.  */
@@ -179,7 +176,7 @@ SECTIONS
     ${RELOCATING+ PROVIDE (__data_end = .) ; }
   } ${RELOCATING+ > data ${RELOCATING+AT> text}}
 
-  .bss ${RELOCATING-0} :${RELOCATING+ AT (ADDR (.bss))}
+  .bss ${RELOCATING+ ADDR(.data) + SIZEOF (.data)} ${RELOCATING-0} :${RELOCATING+ AT (ADDR (.bss))}
   {
     ${RELOCATING+ PROVIDE (__bss_start = .) ; }
     *(.bss)