1 # Copyright (C) 2014-2016 Free Software Foundation, Inc.
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.
8 /* Copyright (C) 2014-2016 Free Software Foundation, Inc.
10 Copying and distribution of this script, with or without modification,
11 are permitted in any medium without royalty provided the copyright
12 notice and this notice are preserved. */
14 OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
19 text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE
20 data (rwx) : ORIGIN = $RAM_START, LENGTH = $RAM_SIZE
21 vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20
26 /* Read-only sections, merged into text segment. */
27 ${TEXT_DYNAMIC+${DYNAMIC}}
28 .hash ${RELOCATING-0} : { *(.hash) }
29 .dynsym ${RELOCATING-0} : { *(.dynsym) }
30 .dynstr ${RELOCATING-0} : { *(.dynstr) }
31 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
32 .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
33 .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
35 .rel.init ${RELOCATING-0} : { *(.rel.init) }
36 .rela.init ${RELOCATING-0} : { *(.rela.init) }
37 .rel.text ${RELOCATING-0} :
40 ${RELOCATING+*(.rel.text.*)}
41 ${RELOCATING+*(.rel.gnu.linkonce.t*)}
43 .rela.text ${RELOCATING-0} :
46 ${RELOCATING+*(.rela.text.*)}
47 ${RELOCATING+*(.rela.gnu.linkonce.t*)}
49 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
50 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
51 .rel.rodata ${RELOCATING-0} :
54 ${RELOCATING+*(.rel.rodata.*)}
55 ${RELOCATING+*(.rel.gnu.linkonce.r*)}
57 .rela.rodata ${RELOCATING-0} :
60 ${RELOCATING+*(.rela.rodata.*)}
61 ${RELOCATING+*(.rela.gnu.linkonce.r*)}
63 .rel.data ${RELOCATING-0} :
66 ${RELOCATING+*(.rel.data.*)}
67 ${RELOCATING+*(.rel.gnu.linkonce.d*)}
69 .rela.data ${RELOCATING-0} :
72 ${RELOCATING+*(.rela.data.*)}
73 ${RELOCATING+*(.rela.gnu.linkonce.d*)}
75 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
76 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
77 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
78 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
79 .rel.got ${RELOCATING-0} : { *(.rel.got) }
80 .rela.got ${RELOCATING-0} : { *(.rela.got) }
81 .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
82 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
83 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
84 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
86 /* Internal text space. */
89 ${RELOCATING+. = ALIGN(2);}
91 *(SORT_NONE(.init0)) /* Start here after reset. */
97 *(SORT_NONE(.init6)) /* C++ constructors. */
100 *(SORT_NONE(.init9)) /* Call main(). */
102 ${CONSTRUCTING+ __ctors_start = . ; }
103 ${CONSTRUCTING+ *(.ctors) }
104 ${CONSTRUCTING+ __ctors_end = . ; }
105 ${CONSTRUCTING+ __dtors_start = . ; }
106 ${CONSTRUCTING+ *(.dtors) }
107 ${CONSTRUCTING+ __dtors_end = . ; }
109 ${RELOCATING+. = ALIGN(2);}
111 ${RELOCATING+. = ALIGN(2);}
113 ${RELOCATING+. = ALIGN(2);}
116 ${RELOCATING+. = ALIGN(2);}
120 *(SORT_NONE(.fini6)) /* C++ destructors. */
126 *(SORT_NONE(.fini0)) /* Infinite loop after program termination. */
129 ${RELOCATING+ _etext = . ; }
130 } ${RELOCATING+ > text}
134 *(.rodata .rodata.* .gnu.linkonce.r.*)
137 } ${RELOCATING+ > text}
139 .data ${RELOCATING-0} :
141 ${RELOCATING+ PROVIDE (__data_start = .) ; }
142 ${RELOCATING+. = ALIGN(2);}
146 ${RELOCATING+. = ALIGN(2);}
147 ${RELOCATING+ _edata = . ; }
148 } ${RELOCATING+ > data ${RELOCATING+AT> text}}
150 __romdatastart = LOADADDR(.data);
151 __romdatacopysize = SIZEOF(.data);
153 .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
155 ${RELOCATING+. = ALIGN(2);}
156 ${RELOCATING+ PROVIDE (__bss_start = .) ; }
159 ${RELOCATING+ PROVIDE (__bss_end = .) ; }
160 } ${RELOCATING+ > data}
162 .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
164 ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
167 ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
168 } ${RELOCATING+ > data}
170 .persistent ${RELOCATING+ SIZEOF(.noinit) + ADDR(.noinit)} :
172 ${RELOCATING+ PROVIDE (__persistent_start = .) ; }
174 ${RELOCATING+ PROVIDE (__persistent_end = .) ; }
175 } ${RELOCATING+ > data}
177 ${RELOCATING+ _end = . ;}
179 .vectors ${RELOCATING-0}:
181 ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
183 ${RELOCATING+ _vectors_end = . ; }
184 } ${RELOCATING+ > vectors}
186 .MP430.attributes 0 :
188 KEEP (*(.MSP430.attributes))
189 KEEP (*(.gnu.attributes))
190 KEEP (*(__TI_build_attributes))
193 /* Stabs debugging sections. */
194 .stab 0 : { *(.stab) }
195 .stabstr 0 : { *(.stabstr) }
196 .stab.excl 0 : { *(.stab.excl) }
197 .stab.exclstr 0 : { *(.stab.exclstr) }
198 .stab.index 0 : { *(.stab.index) }
199 .stab.indexstr 0 : { *(.stab.indexstr) }
200 .comment 0 : { *(.comment) }
204 . $srcdir/scripttempl/DWARF.sc
207 PROVIDE (__stack = ${STACK}) ;
208 PROVIDE (__data_start_rom = _etext) ;
209 PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ;
210 PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
211 PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;