1 # Copyright (C) 2014-2019 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-2019 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 test -n "${RELOCATING}" && cat <<EOF
22 text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE
23 data (rwx) : ORIGIN = $RAM_START, LENGTH = $RAM_SIZE
24 vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20
32 /* Read-only sections, merged into text segment. */
33 ${TEXT_DYNAMIC+${DYNAMIC}}
34 .hash ${RELOCATING-0} : { *(.hash) }
35 .dynsym ${RELOCATING-0} : { *(.dynsym) }
36 .dynstr ${RELOCATING-0} : { *(.dynstr) }
37 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
38 .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
39 .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
41 .rel.init ${RELOCATING-0} : { *(.rel.init) }
42 .rela.init ${RELOCATING-0} : { *(.rela.init) }
43 .rel.text ${RELOCATING-0} :
46 ${RELOCATING+*(.rel.text.*)}
47 ${RELOCATING+*(.rel.gnu.linkonce.t*)}
49 .rela.text ${RELOCATING-0} :
52 ${RELOCATING+*(.rela.text.*)}
53 ${RELOCATING+*(.rela.gnu.linkonce.t*)}
55 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
56 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
57 .rel.rodata ${RELOCATING-0} :
60 ${RELOCATING+*(.rel.rodata.*)}
61 ${RELOCATING+*(.rel.gnu.linkonce.r*)}
63 .rela.rodata ${RELOCATING-0} :
66 ${RELOCATING+*(.rela.rodata.*)}
67 ${RELOCATING+*(.rela.gnu.linkonce.r*)}
69 .rel.data ${RELOCATING-0} :
72 ${RELOCATING+*(.rel.data.*)}
73 ${RELOCATING+*(.rel.gnu.linkonce.d*)}
75 .rela.data ${RELOCATING-0} :
78 ${RELOCATING+*(.rela.data.*)}
79 ${RELOCATING+*(.rela.gnu.linkonce.d*)}
81 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
82 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
83 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
84 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
85 .rel.got ${RELOCATING-0} : { *(.rel.got) }
86 .rela.got ${RELOCATING-0} : { *(.rela.got) }
87 .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
88 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
89 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
90 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
92 /* Internal text space. */
95 ${RELOCATING+. = ALIGN(2);
97 *(SORT_NONE(.init0)) /* Start here after reset. */
103 *(SORT_NONE(.init6)) /* C++ constructors. */
106 *(SORT_NONE(.init9)) /* Call main(). */}
108 ${CONSTRUCTING+ __ctors_start = . ; }
109 ${CONSTRUCTING+ *(.ctors) }
110 ${CONSTRUCTING+ __ctors_end = . ; }
111 ${CONSTRUCTING+ __dtors_start = . ; }
112 ${CONSTRUCTING+ *(.dtors) }
113 ${CONSTRUCTING+ __dtors_end = . ; }
115 ${RELOCATING+. = ALIGN(2);}
117 ${RELOCATING+. = ALIGN(2);
126 *(SORT_NONE(.fini6)) /* C++ destructors. */
132 *(SORT_NONE(.fini0)) /* Infinite loop after program termination. */
136 } ${RELOCATING+ > text}
140 *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*})
141 ${RELOCATING+*(.const)}
142 ${RELOCATING+*(.const:*)}
143 } ${RELOCATING+ > text}
145 .data ${RELOCATING-0} :
147 ${RELOCATING+ PROVIDE (__data_start = .) ; }
148 ${RELOCATING+. = ALIGN(2);}
150 ${RELOCATING+*(.data.*)}
151 ${RELOCATING+*(.gnu.linkonce.d*)}
152 ${RELOCATING+. = ALIGN(2);}
153 ${RELOCATING+ _edata = . ; }
154 } ${RELOCATING+ > data AT> text}
156 __romdatastart = LOADADDR(.data);
157 __romdatacopysize = SIZEOF(.data);
159 .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
161 ${RELOCATING+. = ALIGN(2);}
162 ${RELOCATING+ PROVIDE (__bss_start = .) ; }
163 ${RELOCATING+ PROVIDE (__bssstart = .); }
166 ${RELOCATING+ PROVIDE (__bss_end = .) ; }
167 } ${RELOCATING+ > data}
168 ${RELOCATING+ PROVIDE (__bsssize = SIZEOF(.bss)); }
170 .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
172 ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
175 ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
176 } ${RELOCATING+ > data}
178 .persistent ${RELOCATING+ SIZEOF(.noinit) + ADDR(.noinit)} :
180 ${RELOCATING+ PROVIDE (__persistent_start = .) ; }
182 ${RELOCATING+ PROVIDE (__persistent_end = .) ; }
183 } ${RELOCATING+ > data}
185 ${RELOCATING+ _end = . ;}
187 .vectors ${RELOCATING-0}:
189 ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
190 *(.vectors${RELOCATING+*})
191 ${RELOCATING+ _vectors_end = . ; }
192 } ${RELOCATING+ > vectors}
194 .MSP430.attributes 0 :
196 KEEP (*(.MSP430.attributes))
197 KEEP (*(.gnu.attributes))
198 KEEP (*(__TI_build_attributes))
201 /* Stabs debugging sections. */
202 .stab 0 : { *(.stab) }
203 .stabstr 0 : { *(.stabstr) }
204 .stab.excl 0 : { *(.stab.excl) }
205 .stab.exclstr 0 : { *(.stab.exclstr) }
206 .stab.index 0 : { *(.stab.index) }
207 .stab.indexstr 0 : { *(.stab.indexstr) }
208 .comment 0 : { *(.comment) }
212 . $srcdir/scripttempl/DWARF.sc
214 test -n "${RELOCATING}" && cat <<EOF
215 PROVIDE (__stack = ${STACK}) ;
216 PROVIDE (__data_start_rom = _etext) ;
217 PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ;
218 PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
219 PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;