This is the mail archive of the binutils@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]

[Patch, avr] Set data section's LMA to AT> text instead of end of .text


Hi,

  This patch sets the LMA for the .data section to the next available
  address in the text region (AT> text), rather than ADDR(.text) + SIZE(.text).
  This prevents address overlap errors from the linker if there are
  other sections (unknown to the default linker script) that go into the text region.

  However, I see that the MSP430 port also sets the LMA for .data by adding
  naming sections and adding section sizes. Am I missing something?

Regards
Senthil

2013-11-18  Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>

ld/ChangeLog

	* scripttempl/avr.sc: Set .data section's LMA to next available
	address in text region.


diff --git ld/scripttempl/avr.sc ld/scripttempl/avr.sc
index bfce5fe..5143755 100644
--- ld/scripttempl/avr.sc
+++ ld/scripttempl/avr.sc
@@ -163,7 +163,7 @@ SECTIONS
     ${RELOCATING+ _etext = . ; }
   } ${RELOCATING+ > text}
 
-  .data	${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
+  .data	${RELOCATING-0} : 
   {
     ${RELOCATING+ PROVIDE (__data_start = .) ; }
     /* --gc-sections will delete empty .data. This leads to wrong start
@@ -177,7 +177,7 @@ SECTIONS
     ${RELOCATING+. = ALIGN(2);}
     ${RELOCATING+ _edata = . ; }
     ${RELOCATING+ PROVIDE (__data_end = .) ; }
-  } ${RELOCATING+ > data}
+  } ${RELOCATING+ > data ${RELOCATING+AT> text}}
 
   .bss ${RELOCATING-0} :${RELOCATING+ AT (ADDR (.bss))}
   {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]