This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Prevent .noinit section from incorrect placement for AVR.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7585b2b8b643f4f20c25374f433081aee848e71f

commit 7585b2b8b643f4f20c25374f433081aee848e71f
Author: Denis Chertykov <chertykov@gmail.com>
Date:   Mon Jan 25 22:33:25 2016 +0300

    Prevent .noinit section from incorrect placement for AVR.
    
    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.

Diff:
---
 ld/ChangeLog              | 5 +++++
 ld/scripttempl/avr.sc     | 2 +-
 ld/scripttempl/avrtiny.sc | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index c13a202..2462b30 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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
diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc
index de81987..c26f4ea 100644
--- a/ld/scripttempl/avr.sc
+++ b/ld/scripttempl/avr.sc
@@ -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*)
diff --git a/ld/scripttempl/avrtiny.sc b/ld/scripttempl/avrtiny.sc
index 00daf11..045bc4b 100644
--- a/ld/scripttempl/avrtiny.sc
+++ b/ld/scripttempl/avrtiny.sc
@@ -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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]