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


  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?


2013-11-18  Senthil Kumar Selvaraj <>


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

diff --git ld/scripttempl/ ld/scripttempl/
index bfce5fe..5143755 100644
--- ld/scripttempl/
+++ ld/scripttempl/
@@ -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]