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] Add missing ALIGN directive in


A recent change to the avr linker script (ld/scripttempl/ moved
the ALIGN directive (along with trampolines) above *(.progmem*). This
can cause of misalignment of content after the *(.progmem*), (if (*.progmem*) 
has odd number of bytes).

I noticed the failure in one of the gcc regression tests
(addr-space-2-0.c), where the program never got past startup because
__ctors_start got assigned an odd address. 

The following patch just adds the ALIGN directive after *(.progmem*).
This fixed the regression failure.

If ok, could someone commit please? I don't have commit access.


2013-04-26  Senthil Kumar Selvaraj  <>

	* scripttempl/ Add ALIGN directive after *(.progmem*).

diff --git ld/scripttempl/ ld/scripttempl/
index fde65f6..7ae0f2a 100644
--- ld/scripttempl/
+++ ld/scripttempl/
@@ -93,7 +93,8 @@ SECTIONS
     ${CONSTRUCTING+ __trampolines_end = . ; }
+    ${RELOCATING+. = ALIGN(2);}
     /* For future tablejump instruction arrays for 3 byte pc devices.
        We don't relax jump/call instructions within these sections.  */

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