1 # Copyright (C) 2014-2015 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.
7 HEAP_SECTION_MSP430=" "
10 if test ${GOT_HEAP_MSP-0} -ne 0
12 HEAP_SECTION_MSP430=".heap ${RELOCATING-0} :
14 ${RELOCATING+ PROVIDE (__heap_data_start = .) ; }
16 ${RELOCATING+ PROVIDE (_heap_data_end = .) ; }
17 ${RELOCATING+. = ALIGN(2);}
18 ${RELOCATING+ PROVIDE (__heap_bottom = .) ; }
19 ${RELOCATING+ PROVIDE (__heap_top = ${HEAP_START} + ${HEAP_LENGTH}) ; }
20 } ${RELOCATING+ > heap}"
21 HEAP_MEMORY_MSP430="heap(rwx) : ORIGIN = $HEAP_START, LENGTH = $HEAP_LENGTH"
26 /* Copyright (C) 2014-2015 Free Software Foundation, Inc.
28 Copying and distribution of this script, with or without modification,
29 are permitted in any medium without royalty provided the copyright
30 notice and this notice are preserved. */
32 OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
37 text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE
38 data (rwx) : ORIGIN = $RAM_START, LENGTH = $RAM_SIZE
39 vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20
40 bootloader(rx) : ORIGIN = 0x0c00, LENGTH = 1K
41 infomem(rx) : ORIGIN = 0x1000, LENGTH = 256
42 infomemnobits(rx) : ORIGIN = 0x1000, LENGTH = 256
49 .bootloader ${RELOCATING-0} :
51 ${RELOCATING+ PROVIDE (__boot_start = .) ; }
53 ${RELOCATING+. = ALIGN(2);}
55 } ${RELOCATING+ > bootloader}
57 /* Information memory. */
58 .infomem ${RELOCATING-0} :
61 ${RELOCATING+. = ALIGN(2);}
63 } ${RELOCATING+ > infomem}
65 /* Information memory (not loaded into MPU). */
66 .infomemnobits ${RELOCATING-0} :
69 ${RELOCATING+. = ALIGN(2);}
71 } ${RELOCATING+ > infomemnobits}
73 /* Read-only sections, merged into text segment. */
74 ${TEXT_DYNAMIC+${DYNAMIC}}
75 .hash ${RELOCATING-0} : { *(.hash) }
76 .dynsym ${RELOCATING-0} : { *(.dynsym) }
77 .dynstr ${RELOCATING-0} : { *(.dynstr) }
78 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
79 .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
80 .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
82 .rel.init ${RELOCATING-0} : { *(.rel.init) }
83 .rela.init ${RELOCATING-0} : { *(.rela.init) }
84 .rel.text ${RELOCATING-0} :
87 ${RELOCATING+*(.rel.text.*)}
88 ${RELOCATING+*(.rel.gnu.linkonce.t*)}
90 .rela.text ${RELOCATING-0} :
93 ${RELOCATING+*(.rela.text.*)}
94 ${RELOCATING+*(.rela.gnu.linkonce.t*)}
96 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
97 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
98 .rel.rodata ${RELOCATING-0} :
101 ${RELOCATING+*(.rel.rodata.*)}
102 ${RELOCATING+*(.rel.gnu.linkonce.r*)}
104 .rela.rodata ${RELOCATING-0} :
107 ${RELOCATING+*(.rela.rodata.*)}
108 ${RELOCATING+*(.rela.gnu.linkonce.r*)}
110 .rel.data ${RELOCATING-0} :
113 ${RELOCATING+*(.rel.data.*)}
114 ${RELOCATING+*(.rel.gnu.linkonce.d*)}
116 .rela.data ${RELOCATING-0} :
119 ${RELOCATING+*(.rela.data.*)}
120 ${RELOCATING+*(.rela.gnu.linkonce.d*)}
122 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
123 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
124 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
125 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
126 .rel.got ${RELOCATING-0} : { *(.rel.got) }
127 .rela.got ${RELOCATING-0} : { *(.rela.got) }
128 .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
129 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
130 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
131 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
133 /* Internal text space. */
136 ${RELOCATING+. = ALIGN(2);}
138 *(SORT_NONE(.init0)) /* Start here after reset. */
140 *(SORT_NONE(.init2)) /* Copy data loop */
142 *(SORT_NONE(.init4)) /* Clear bss */
144 *(SORT_NONE(.init6)) /* C++ constructors. */
147 *(SORT_NONE(.init9)) /* Call main(). */
149 ${CONSTRUCTING+ __ctors_start = . ; }
150 ${CONSTRUCTING+ *(.ctors) }
151 ${CONSTRUCTING+ __ctors_end = . ; }
152 ${CONSTRUCTING+ __dtors_start = . ; }
153 ${CONSTRUCTING+ *(.dtors) }
154 ${CONSTRUCTING+ __dtors_end = . ; }
156 ${RELOCATING+. = ALIGN(2);}
157 *(.lower.text.* .lower.text)
159 ${RELOCATING+. = ALIGN(2);}
161 ${RELOCATING+. = ALIGN(2);}
163 ${RELOCATING+. = ALIGN(2);}
166 *(.either.text.* .either.text)
168 ${RELOCATING+. = ALIGN(2);}
172 *(SORT_NONE(.fini6)) /* C++ destructors. */
178 *(SORT_NONE(.fini0)) /* Infinite loop after program termination. */
182 } ${RELOCATING+ > text}
186 ${RELOCATING+. = ALIGN(2);}
187 *(.lower.rodata.* .lower.rodata)
191 *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*)
194 *(.either.rodata.*) *(.either.rodata)
198 KEEP (*(.gcc_except_table)) *(.gcc_except_table.*)
200 PROVIDE (__preinit_array_start = .);
201 KEEP (*(.preinit_array))
202 PROVIDE (__preinit_array_end = .);
204 PROVIDE (__init_array_start = .);
205 KEEP (*(SORT(.init_array.*)))
206 KEEP (*(.init_array))
207 PROVIDE (__init_array_end = .);
209 PROVIDE (__fini_array_start = .);
210 KEEP (*(.fini_array))
211 KEEP (*(SORT(.fini_array.*)))
212 PROVIDE (__fini_array_end = .);
213 LONG(0); /* Sentinel. */
215 /* gcc uses crtbegin.o to find the start of the constructors, so
216 we make sure it is first. Because this is a wildcard, it
217 doesn't matter if the user does not actually link against
218 crtbegin.o; the linker won't look for a file to match a
219 wildcard. The wildcard also means that it doesn't matter which
220 directory crtbegin.o is in. */
221 KEEP (*crtbegin*.o(.ctors))
223 /* We don't want to include the .ctor section from from the
224 crtend.o file until after the sorted ctors. The .ctor section
225 from the crtend file contains the end of ctors marker and it
227 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
228 KEEP (*(SORT(.ctors.*)))
231 KEEP (*crtbegin*.o(.dtors))
232 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
233 KEEP (*(SORT(.dtors.*)))
235 } ${RELOCATING+ > text}
237 .vectors ${RELOCATING-0}:
239 ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
241 ${RELOCATING+ _vectors_end = . ; }
242 } ${RELOCATING+ > vectors}
244 .data ${RELOCATING-0} :
246 ${RELOCATING+ PROVIDE (__data_start = .) ; }
247 ${RELOCATING+ PROVIDE (__datastart = .) ; }
248 ${RELOCATING+. = ALIGN(2);}
251 *(.data.rel.ro.local) *(.data.rel.ro*)
254 ${RELOCATING+. = ALIGN(2);}
255 *(.lower.data.* .lower.data)
260 KEEP (*(.gnu.linkonce.d.*personality*))
263 *(.either.data.* .either.data)
266 ${RELOCATING+. = ALIGN(2);}
267 *(.sdata .sdata.* .gnu.linkonce.s.*)
268 ${RELOCATING+. = ALIGN(2);}
269 ${RELOCATING+ _edata = . ; }
270 } ${RELOCATING+ > data ${RELOCATING+AT> text}}
272 .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
274 ${RELOCATING+. = ALIGN(2);}
275 ${RELOCATING+ PROVIDE (__bss_start = .) ; }
276 *(.lower.bss.* .lower.bss)
277 ${RELOCATING+. = ALIGN(2);}
279 *(.either.bss.* .either.bss)
281 ${RELOCATING+ PROVIDE (__bss_end = .) ; }
282 ${RELOCATING+ _end = . ; }
283 } ${RELOCATING+ > data}
285 .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
287 ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
290 ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
291 ${RELOCATING+ _end = . ; }
292 } ${RELOCATING+ > data}
294 ${HEAP_SECTION_MSP430}
296 /* Stabs for profiling information*/
297 .profiler 0 : { *(.profiler) }
299 /* Stabs debugging sections. */
300 .stab 0 : { *(.stab) }
301 .stabstr 0 : { *(.stabstr) }
302 .stab.excl 0 : { *(.stab.excl) }
303 .stab.exclstr 0 : { *(.stab.exclstr) }
304 .stab.index 0 : { *(.stab.index) }
305 .stab.indexstr 0 : { *(.stab.indexstr) }
306 .comment 0 : { *(.comment) }
309 source $srcdir/scripttempl/DWARF.sc
312 .MP430.attributes 0 :
314 KEEP (*(.MSP430.attributes))
315 KEEP (*(.gnu.attributes))
316 KEEP (*(__TI_build_attributes))
319 PROVIDE (__stack = ${STACK}) ;
320 PROVIDE (__data_start_rom = _etext) ;
321 PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ;
322 PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
323 PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;
324 PROVIDE (__subdevice_has_heap = ${GOT_HEAP_MSP-0}) ;