daily update
[external/binutils.git] / ld / scripttempl / avr.sc
index d297b4a..23b3046 100644 (file)
@@ -71,12 +71,32 @@ SECTIONS
   .rel.plt     ${RELOCATING-0} : { *(.rel.plt)         }
   .rela.plt    ${RELOCATING-0} : { *(.rela.plt)                }
 
-  /* Internal text space or external memory */
-  .text :
+  /* Internal text space or external memory */
+  .text ${RELOCATING-0} :
   {
     *(.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)
@@ -158,7 +168,7 @@ SECTIONS
     ${RELOCATING+ PROVIDE (__data_end = .) ; }
   } ${RELOCATING+ > data}
 
-  .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
+  .bss ${RELOCATING-0} :${RELOCATING+ AT (ADDR (.bss))}
   {
     ${RELOCATING+ PROVIDE (__bss_start = .) ; }
     *(.bss)
@@ -171,7 +181,7 @@ SECTIONS
   ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
 
   /* Global data not cleared after reset.  */
-  .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
+  .noinit ${RELOCATING-0}:
   {
     ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
     *(.noinit*)