Prevent .noinit section from incorrect placement for AVR.
authorDenis Chertykov <chertykov@gmail.com>
Mon, 25 Jan 2016 19:33:25 +0000 (22:33 +0300)
committerDenis Chertykov <chertykov@gmail.com>
Mon, 25 Jan 2016 19:33:25 +0000 (22:33 +0300)
When .data and .bss sections are empty .noinit section is placed at data
region's start. This will be incorrect for devices that has different
data start address than data region start in linker script.
The patch updates .noinit section's VMA to end of .bss section. So, .noinit
section will be placed at .data section address (-Tdata=<address>) when .data
and .bss sections are empty.

ld/

* scripttempl/avr.sc (.noinit): Force .noinit VMA to end of .bss VMA.
* scripttempl/avrtiny.sc (.noinit): Likewise.

ld/ChangeLog
ld/scripttempl/avr.sc
ld/scripttempl/avrtiny.sc

index c13a202bc29aef0c4bb8d27ead65cddbf1cee837..2462b30bf100f3465c62412e1c1c97612d18f8ac 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-22  Pitchumani Sivanupandi  <pitchumani.s@atmel.com>
+
+       * scripttempl/avr.sc (.noinit): Force .noinit VMA to end of .bss VMA.
+       * scripttempl/avrtiny.sc (.noinit): Likewise.
+
 2016-01-21  Nick Clifton  <nickc@redhat.com>
 
        PR ld/19453
index de819875bdaa7166a772755533a07130a7ec059f..c26f4ead94d447cfe2e96d63796197b2ec5291f0 100644 (file)
@@ -210,7 +210,7 @@ SECTIONS
   ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
 
   /* Global data not cleared after reset.  */
-  .noinit ${RELOCATING-0}:
+  .noinit ${RELOCATING+ ADDR(.bss) + SIZEOF (.bss)} ${RELOCATING-0}: ${RELOCATING+ AT (ADDR (.noinit))}
   {
     ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
     *(.noinit*)
index 00daf11464995306a28f9b88a32783adc2156811..045bc4b26e0fe88fceb9ce2387595099050a3a9b 100644 (file)
@@ -210,7 +210,7 @@ SECTIONS
   ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
 
   /* Global data not cleared after reset.  */
-  .noinit ${RELOCATING-0}:
+  .noinit ${RELOCATING+ ADDR(.bss) + SIZEOF (.bss)} ${RELOCATING-0} : ${RELOCATING+ AT (ADDR (.noinit))}
   {
     ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
     *(.noinit*)
This page took 0.027247 seconds and 4 git commands to generate.