aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl/avr.sc
diff options
context:
space:
mode:
Diffstat (limited to 'ld/scripttempl/avr.sc')
-rw-r--r--ld/scripttempl/avr.sc36
1 files changed, 23 insertions, 13 deletions
diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc
index d297b4a..7368caf 100644
--- a/ld/scripttempl/avr.sc
+++ b/ld/scripttempl/avr.sc
@@ -71,12 +71,32 @@ SECTIONS
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
- /* Internal text space or external memory */
+ /* Internal text space or external memory. */
.text :
{
*(.vectors)
KEEP(*(.vectors))
+ /* For data that needs to reside in the lower 64k of progmem. */
+ *(.progmem.gcc*)
+ *(.progmem*)
+ ${RELOCATING+. = ALIGN(2);}
+
+ ${CONSTRUCTING+ __trampolines_start = . ; }
+ /* The jump trampolines for the 16-bit limited relocs will reside here. */
+ *(.trampolines)
+ *(.trampolines*)
+ ${CONSTRUCTING+ __trampolines_end = . ; }
+
+ /* For future tablejump instruction arrays for 3 byte pc devices.
+ We don't relax jump/call instructions within these sections. */
+ *(.jumptables)
+ *(.jumptables*)
+
+ /* For code that needs to reside in the lower 128k progmem. */
+ *(.lowtext)
+ *(.lowtext*)
+
${CONSTRUCTING+ __ctors_start = . ; }
${CONSTRUCTING+ *(.ctors) }
${CONSTRUCTING+ __ctors_end = . ; }
@@ -86,18 +106,8 @@ SECTIONS
KEEP(SORT(*)(.ctors))
KEEP(SORT(*)(.dtors))
- /* For data that needs to reside in the lower 64k of progmem */
- *(.progmem.gcc*)
- *(.progmem*)
- ${RELOCATING+. = ALIGN(2);}
-
- /* for future tablejump instruction arrays for 3 byte pc devices */
- *(.jumptables)
- *(.jumptables*)
- /* for code that needs to reside in the lower 128k progmem */
- *(.lowtext)
- *(.lowtext*)
-
+ /* From this point on, we don't bother about wether the insns are
+ below or above the 16 bits boundary. */
*(.init0) /* Start here after reset. */
KEEP (*(.init0))
*(.init1)