Commit | Line | Data |
---|---|---|
b3adc24a | 1 | # Copyright (C) 2014-2020 Free Software Foundation, Inc. |
6c19b93b | 2 | # |
985743c7 NC |
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. | |
6 | ||
2469cfa2 | 7 | cat <<EOF |
b3adc24a | 8 | /* Copyright (C) 2014-2020 Free Software Foundation, Inc. |
985743c7 NC |
9 | |
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. */ | |
13 | ||
2469cfa2 NC |
14 | OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}") |
15 | OUTPUT_ARCH(${ARCH}) | |
16 | ||
2bf2bf23 AM |
17 | EOF |
18 | ||
19 | test -n "${RELOCATING}" && cat <<EOF | |
2469cfa2 NC |
20 | MEMORY |
21 | { | |
22 | text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE | |
6c19b93b | 23 | data (rwx) : ORIGIN = $RAM_START, LENGTH = $RAM_SIZE |
2469cfa2 NC |
24 | vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20 |
25 | } | |
26 | ||
2bf2bf23 AM |
27 | EOF |
28 | ||
29 | cat <<EOF | |
2469cfa2 NC |
30 | SECTIONS |
31 | { | |
32 | /* Read-only sections, merged into text segment. */ | |
33 | ${TEXT_DYNAMIC+${DYNAMIC}} | |
ec2d9b29 AM |
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) } | |
2469cfa2 | 40 | |
ec2d9b29 AM |
41 | .rel.init ${RELOCATING-0} : { *(.rel.init) } |
42 | .rela.init ${RELOCATING-0} : { *(.rela.init) } | |
43 | .rel.text ${RELOCATING-0} : | |
2469cfa2 NC |
44 | { |
45 | *(.rel.text) | |
46 | ${RELOCATING+*(.rel.text.*)} | |
47 | ${RELOCATING+*(.rel.gnu.linkonce.t*)} | |
48 | } | |
ec2d9b29 | 49 | .rela.text ${RELOCATING-0} : |
2469cfa2 NC |
50 | { |
51 | *(.rela.text) | |
52 | ${RELOCATING+*(.rela.text.*)} | |
53 | ${RELOCATING+*(.rela.gnu.linkonce.t*)} | |
54 | } | |
ec2d9b29 AM |
55 | .rel.fini ${RELOCATING-0} : { *(.rel.fini) } |
56 | .rela.fini ${RELOCATING-0} : { *(.rela.fini) } | |
57 | .rel.rodata ${RELOCATING-0} : | |
2469cfa2 NC |
58 | { |
59 | *(.rel.rodata) | |
60 | ${RELOCATING+*(.rel.rodata.*)} | |
61 | ${RELOCATING+*(.rel.gnu.linkonce.r*)} | |
62 | } | |
ec2d9b29 | 63 | .rela.rodata ${RELOCATING-0} : |
2469cfa2 NC |
64 | { |
65 | *(.rela.rodata) | |
66 | ${RELOCATING+*(.rela.rodata.*)} | |
67 | ${RELOCATING+*(.rela.gnu.linkonce.r*)} | |
68 | } | |
ec2d9b29 | 69 | .rel.data ${RELOCATING-0} : |
2469cfa2 NC |
70 | { |
71 | *(.rel.data) | |
72 | ${RELOCATING+*(.rel.data.*)} | |
73 | ${RELOCATING+*(.rel.gnu.linkonce.d*)} | |
74 | } | |
ec2d9b29 | 75 | .rela.data ${RELOCATING-0} : |
2469cfa2 NC |
76 | { |
77 | *(.rela.data) | |
78 | ${RELOCATING+*(.rela.data.*)} | |
79 | ${RELOCATING+*(.rela.gnu.linkonce.d*)} | |
80 | } | |
ec2d9b29 AM |
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) } | |
2469cfa2 NC |
91 | |
92 | /* Internal text space. */ | |
93 | .text : | |
94 | { | |
2bf2bf23 | 95 | ${RELOCATING+. = ALIGN(2); |
b2e4da5a L |
96 | *(SORT_NONE(.init)) |
97 | *(SORT_NONE(.init0)) /* Start here after reset. */ | |
98 | *(SORT_NONE(.init1)) | |
99 | *(SORT_NONE(.init2)) | |
100 | *(SORT_NONE(.init3)) | |
101 | *(SORT_NONE(.init4)) | |
102 | *(SORT_NONE(.init5)) | |
103 | *(SORT_NONE(.init6)) /* C++ constructors. */ | |
104 | *(SORT_NONE(.init7)) | |
105 | *(SORT_NONE(.init8)) | |
2bf2bf23 | 106 | *(SORT_NONE(.init9)) /* Call main(). */} |
d4b6ee67 NC |
107 | |
108 | ${CONSTRUCTING+ __ctors_start = . ; } | |
109 | ${CONSTRUCTING+ *(.ctors) } | |
110 | ${CONSTRUCTING+ __ctors_end = . ; } | |
111 | ${CONSTRUCTING+ __dtors_start = . ; } | |
112 | ${CONSTRUCTING+ *(.dtors) } | |
113 | ${CONSTRUCTING+ __dtors_end = . ; } | |
114 | ||
2469cfa2 NC |
115 | ${RELOCATING+. = ALIGN(2);} |
116 | *(.text) | |
2bf2bf23 | 117 | ${RELOCATING+. = ALIGN(2); |
2469cfa2 | 118 | *(.text.*) |
2bf2bf23 | 119 | . = ALIGN(2); |
13761a11 | 120 | *(.text:*) |
d4b6ee67 | 121 | |
2bf2bf23 | 122 | . = ALIGN(2); |
b2e4da5a L |
123 | *(SORT_NONE(.fini9)) |
124 | *(SORT_NONE(.fini8)) | |
125 | *(SORT_NONE(.fini7)) | |
126 | *(SORT_NONE(.fini6)) /* C++ destructors. */ | |
127 | *(SORT_NONE(.fini5)) | |
128 | *(SORT_NONE(.fini4)) | |
129 | *(SORT_NONE(.fini3)) | |
130 | *(SORT_NONE(.fini2)) | |
131 | *(SORT_NONE(.fini1)) | |
132 | *(SORT_NONE(.fini0)) /* Infinite loop after program termination. */ | |
133 | *(SORT_NONE(.fini)) | |
d4b6ee67 | 134 | |
2bf2bf23 | 135 | _etext = . ;} |
2469cfa2 NC |
136 | } ${RELOCATING+ > text} |
137 | ||
13761a11 NC |
138 | .rodata : |
139 | { | |
2bf2bf23 AM |
140 | *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) |
141 | ${RELOCATING+*(.const)} | |
142 | ${RELOCATING+*(.const:*)} | |
13761a11 NC |
143 | } ${RELOCATING+ > text} |
144 | ||
925bbbbb | 145 | .data ${RELOCATING-0} : |
6c19b93b | 146 | { |
2469cfa2 | 147 | ${RELOCATING+ PROVIDE (__data_start = .) ; } |
727f7031 | 148 | ${RELOCATING+. = ALIGN(2);} |
2469cfa2 | 149 | *(.data) |
2bf2bf23 AM |
150 | ${RELOCATING+*(.data.*)} |
151 | ${RELOCATING+*(.gnu.linkonce.d*)} | |
2469cfa2 NC |
152 | ${RELOCATING+. = ALIGN(2);} |
153 | ${RELOCATING+ _edata = . ; } | |
2bf2bf23 | 154 | } ${RELOCATING+ > data AT> text} |
6c19b93b | 155 | |
296ebfbb NC |
156 | __romdatastart = LOADADDR(.data); |
157 | __romdatacopysize = SIZEOF(.data); | |
6c19b93b | 158 | |
2469cfa2 NC |
159 | .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : |
160 | { | |
727f7031 | 161 | ${RELOCATING+. = ALIGN(2);} |
2469cfa2 | 162 | ${RELOCATING+ PROVIDE (__bss_start = .) ; } |
0d832c8e | 163 | ${RELOCATING+ PROVIDE (__bssstart = .); } |
2469cfa2 NC |
164 | *(.bss) |
165 | *(COMMON) | |
166 | ${RELOCATING+ PROVIDE (__bss_end = .) ; } | |
2469cfa2 | 167 | } ${RELOCATING+ > data} |
0d832c8e | 168 | ${RELOCATING+ PROVIDE (__bsssize = SIZEOF(.bss)); } |
2469cfa2 NC |
169 | |
170 | .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} : | |
171 | { | |
172 | ${RELOCATING+ PROVIDE (__noinit_start = .) ; } | |
173 | *(.noinit) | |
174 | *(COMMON) | |
175 | ${RELOCATING+ PROVIDE (__noinit_end = .) ; } | |
2469cfa2 NC |
176 | } ${RELOCATING+ > data} |
177 | ||
886a2506 NC |
178 | .persistent ${RELOCATING+ SIZEOF(.noinit) + ADDR(.noinit)} : |
179 | { | |
180 | ${RELOCATING+ PROVIDE (__persistent_start = .) ; } | |
181 | *(.persistent) | |
182 | ${RELOCATING+ PROVIDE (__persistent_end = .) ; } | |
183 | } ${RELOCATING+ > data} | |
184 | ||
185 | ${RELOCATING+ _end = . ;} | |
186 | ||
ec2d9b29 | 187 | .vectors ${RELOCATING-0}: |
2469cfa2 NC |
188 | { |
189 | ${RELOCATING+ PROVIDE (__vectors_start = .) ; } | |
2bf2bf23 | 190 | *(.vectors${RELOCATING+*}) |
2469cfa2 NC |
191 | ${RELOCATING+ _vectors_end = . ; } |
192 | } ${RELOCATING+ > vectors} | |
193 | ||
df154dc1 | 194 | .MSP430.attributes 0 : |
13761a11 NC |
195 | { |
196 | KEEP (*(.MSP430.attributes)) | |
197 | KEEP (*(.gnu.attributes)) | |
198 | KEEP (*(__TI_build_attributes)) | |
199 | } | |
200 | ||
2469cfa2 | 201 | /* Stabs debugging sections. */ |
6c19b93b | 202 | .stab 0 : { *(.stab) } |
2469cfa2 NC |
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) } | |
6c19b93b | 209 | |
ceb0a680 | 210 | EOF |
2a995fc1 | 211 | |
d061dfac | 212 | . $srcdir/scripttempl/DWARF.sc |
2a995fc1 | 213 | |
2bf2bf23 | 214 | test -n "${RELOCATING}" && cat <<EOF |
2469cfa2 | 215 | PROVIDE (__stack = ${STACK}) ; |
db6a5910 NC |
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)) ; | |
2bf2bf23 AM |
220 | EOF |
221 | ||
222 | cat <<EOF | |
2469cfa2 NC |
223 | } |
224 | EOF |