This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Patch, avr] Add missing ALIGN directive in avr.sc
- From: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- To: <binutils at sourceware dot org>
- Date: Fri, 26 Apr 2013 19:07:27 +0530
- Subject: [Patch, avr] Add missing ALIGN directive in avr.sc
Hi,
A recent change to the avr linker script (ld/scripttempl/avr.sc) 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.
ld/ChangeLog
2013-04-26 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* scripttempl/avr.sc: Add ALIGN directive after *(.progmem*).
diff --git ld/scripttempl/avr.sc ld/scripttempl/avr.sc
index fde65f6..7ae0f2a 100644
--- ld/scripttempl/avr.sc
+++ ld/scripttempl/avr.sc
@@ -93,7 +93,8 @@ SECTIONS
${CONSTRUCTING+ __trampolines_end = . ; }
*(.progmem*)
-
+ ${RELOCATING+. = ALIGN(2);}
+
/* For future tablejump instruction arrays for 3 byte pc devices.
We don't relax jump/call instructions within these sections. */
*(.jumptables)