* scripttempl/armbpabi.sc: Replace DWARF sections with an
[deliverable/binutils-gdb.git] / ld / scripttempl / elf32msp430.sc
CommitLineData
f2f489ac
NC
1#!/bin/sh
2
3HEAP_SECTION_MSP430=" "
4HEAP_MEMORY_MSP430=" "
5
6if test ${GOT_HEAP_MSP-0} -ne 0
7then
ec2d9b29 8HEAP_SECTION_MSP430=".heap ${RELOCATING-0} :
f2f489ac
NC
9 {
10 ${RELOCATING+ PROVIDE (__heap_data_start = .) ; }
11 *(.heap*)
12 ${RELOCATING+ PROVIDE (_heap_data_end = .) ; }
13 ${RELOCATING+. = ALIGN(2);}
14 ${RELOCATING+ PROVIDE (__heap_bottom = .) ; }
15 ${RELOCATING+ PROVIDE (__heap_top = ${HEAP_START} + ${HEAP_LENGTH}) ; }
16 } ${RELOCATING+ > heap}"
17HEAP_MEMORY_MSP430="heap(rwx) : ORIGIN = $HEAP_START, LENGTH = $HEAP_LENGTH"
18fi
19
20
2469cfa2
NC
21cat <<EOF
22OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
23OUTPUT_ARCH(${ARCH})
24
25MEMORY
26{
27 text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE
28 data (rwx) : ORIGIN = $RAM_START, LENGTH = $RAM_SIZE
29 vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20
30 bootloader(rx) : ORIGIN = 0x0c00, LENGTH = 1K
31 infomem(rx) : ORIGIN = 0x1000, LENGTH = 256
32 infomemnobits(rx) : ORIGIN = 0x1000, LENGTH = 256
f2f489ac 33 ${HEAP_MEMORY_MSP430}
2469cfa2
NC
34}
35
36SECTIONS
37{
38 /* Read-only sections, merged into text segment. */
39 ${TEXT_DYNAMIC+${DYNAMIC}}
ec2d9b29
AM
40 .hash ${RELOCATING-0} : { *(.hash) }
41 .dynsym ${RELOCATING-0} : { *(.dynsym) }
42 .dynstr ${RELOCATING-0} : { *(.dynstr) }
43 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
44 .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
45 .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
46
47 .rel.init ${RELOCATING-0} : { *(.rel.init) }
48 .rela.init ${RELOCATING-0} : { *(.rela.init) }
49 .rel.text ${RELOCATING-0} :
2469cfa2
NC
50 {
51 *(.rel.text)
52 ${RELOCATING+*(.rel.text.*)}
53 ${RELOCATING+*(.rel.gnu.linkonce.t*)}
54 }
ec2d9b29 55 .rela.text ${RELOCATING-0} :
2469cfa2
NC
56 {
57 *(.rela.text)
58 ${RELOCATING+*(.rela.text.*)}
59 ${RELOCATING+*(.rela.gnu.linkonce.t*)}
60 }
ec2d9b29
AM
61 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
62 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
63 .rel.rodata ${RELOCATING-0} :
2469cfa2
NC
64 {
65 *(.rel.rodata)
66 ${RELOCATING+*(.rel.rodata.*)}
67 ${RELOCATING+*(.rel.gnu.linkonce.r*)}
68 }
ec2d9b29 69 .rela.rodata ${RELOCATING-0} :
2469cfa2
NC
70 {
71 *(.rela.rodata)
72 ${RELOCATING+*(.rela.rodata.*)}
73 ${RELOCATING+*(.rela.gnu.linkonce.r*)}
74 }
ec2d9b29 75 .rel.data ${RELOCATING-0} :
2469cfa2
NC
76 {
77 *(.rel.data)
78 ${RELOCATING+*(.rel.data.*)}
79 ${RELOCATING+*(.rel.gnu.linkonce.d*)}
80 }
ec2d9b29 81 .rela.data ${RELOCATING-0} :
2469cfa2
NC
82 {
83 *(.rela.data)
84 ${RELOCATING+*(.rela.data.*)}
85 ${RELOCATING+*(.rela.gnu.linkonce.d*)}
86 }
ec2d9b29
AM
87 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
88 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
89 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
90 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
91 .rel.got ${RELOCATING-0} : { *(.rel.got) }
92 .rela.got ${RELOCATING-0} : { *(.rela.got) }
93 .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
94 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
95 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
96 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
2469cfa2
NC
97
98 /* Internal text space. */
99 .text :
100 {
d4b6ee67 101 ${RELOCATING+. = ALIGN(2);}
b2e4da5a
L
102 *(SORT_NONE(.init))
103 *(SORT_NONE(.init0)) /* Start here after reset. */
104 *(SORT_NONE(.init1))
105 *(SORT_NONE(.init2)) /* Copy data loop */
106 *(SORT_NONE(.init3))
107 *(SORT_NONE(.init4)) /* Clear bss */
108 *(SORT_NONE(.init5))
109 *(SORT_NONE(.init6)) /* C++ constructors. */
110 *(SORT_NONE(.init7))
111 *(SORT_NONE(.init8))
112 *(SORT_NONE(.init9)) /* Call main(). */
d4b6ee67
NC
113
114 ${CONSTRUCTING+ __ctors_start = . ; }
115 ${CONSTRUCTING+ *(.ctors) }
116 ${CONSTRUCTING+ __ctors_end = . ; }
117 ${CONSTRUCTING+ __dtors_start = . ; }
118 ${CONSTRUCTING+ *(.dtors) }
119 ${CONSTRUCTING+ __dtors_end = . ; }
120
2469cfa2
NC
121 ${RELOCATING+. = ALIGN(2);}
122 *(.text)
123 ${RELOCATING+. = ALIGN(2);}
124 *(.text.*)
d4b6ee67 125
2469cfa2 126 ${RELOCATING+. = ALIGN(2);}
b2e4da5a
L
127 *(SORT_NONE(.fini9))
128 *(SORT_NONE(.fini8))
129 *(SORT_NONE(.fini7))
130 *(SORT_NONE(.fini6)) /* C++ destructors. */
131 *(SORT_NONE(.fini5))
132 *(SORT_NONE(.fini4))
133 *(SORT_NONE(.fini3))
134 *(SORT_NONE(.fini2))
135 *(SORT_NONE(.fini1))
136 *(SORT_NONE(.fini0)) /* Infinite loop after program termination. */
137 *(SORT_NONE(.fini))
d4b6ee67 138
f2f489ac 139 _etext = .;
2469cfa2
NC
140 } ${RELOCATING+ > text}
141
ec2d9b29 142 .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
2469cfa2
NC
143 {
144 ${RELOCATING+ PROVIDE (__data_start = .) ; }
145 ${RELOCATING+. = ALIGN(2);}
146 *(.data)
727f7031 147 *(.data.*)
2469cfa2
NC
148 *(.gnu.linkonce.d*)
149 ${RELOCATING+. = ALIGN(2);}
150 ${RELOCATING+ _edata = . ; }
151 } ${RELOCATING+ > data}
152
153 /* Bootloader. */
ec2d9b29 154 .bootloader ${RELOCATING-0} :
2469cfa2
NC
155 {
156 ${RELOCATING+ PROVIDE (__boot_start = .) ; }
157 *(.bootloader)
158 ${RELOCATING+. = ALIGN(2);}
159 *(.bootloader.*)
160 } ${RELOCATING+ > bootloader}
161
162 /* Information memory. */
ec2d9b29 163 .infomem ${RELOCATING-0} :
2469cfa2
NC
164 {
165 *(.infomem)
166 ${RELOCATING+. = ALIGN(2);}
167 *(.infomem.*)
168 } ${RELOCATING+ > infomem}
169
170 /* Information memory (not loaded into MPU). */
ec2d9b29 171 .infomemnobits ${RELOCATING-0} :
2469cfa2
NC
172 {
173 *(.infomemnobits)
174 ${RELOCATING+. = ALIGN(2);}
175 *(.infomemnobits.*)
176 } ${RELOCATING+ > infomemnobits}
177
178 .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
179 {
727f7031 180 ${RELOCATING+. = ALIGN(2);}
2469cfa2
NC
181 ${RELOCATING+ PROVIDE (__bss_start = .) ; }
182 *(.bss)
183 *(COMMON)
184 ${RELOCATING+ PROVIDE (__bss_end = .) ; }
185 ${RELOCATING+ _end = . ; }
186 } ${RELOCATING+ > data}
187
188 .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
189 {
190 ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
191 *(.noinit)
192 *(COMMON)
193 ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
194 ${RELOCATING+ _end = . ; }
195 } ${RELOCATING+ > data}
196
ec2d9b29 197 .vectors ${RELOCATING-0}:
2469cfa2
NC
198 {
199 ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
200 *(.vectors*)
201 ${RELOCATING+ _vectors_end = . ; }
202 } ${RELOCATING+ > vectors}
203
f2f489ac 204 ${HEAP_SECTION_MSP430}
2469cfa2 205
b18c562e
NC
206 /* Stabs for profiling information*/
207 .profiler 0 : { *(.profiler) }
208
2469cfa2
NC
209 /* Stabs debugging sections. */
210 .stab 0 : { *(.stab) }
211 .stabstr 0 : { *(.stabstr) }
212 .stab.excl 0 : { *(.stab.excl) }
213 .stab.exclstr 0 : { *(.stab.exclstr) }
214 .stab.index 0 : { *(.stab.index) }
215 .stab.indexstr 0 : { *(.stab.indexstr) }
216 .comment 0 : { *(.comment) }
217
ceb0a680 218EOF
2a995fc1 219
ceb0a680 220source $srcdir/scripttempl/DWARF.sc
2a995fc1 221
ceb0a680 222cat <<EOF
2469cfa2 223 PROVIDE (__stack = ${STACK}) ;
db6a5910
NC
224 PROVIDE (__data_start_rom = _etext) ;
225 PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ;
226 PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
227 PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;
f2f489ac 228 PROVIDE (__subdevice_has_heap = ${GOT_HEAP_MSP-0}) ;
2469cfa2
NC
229}
230EOF
This page took 0.492356 seconds and 4 git commands to generate.