1 |
198 |
zero_gravi |
/* ################################################################################################# */
|
2 |
|
|
/* # < NEO430 MSP430GCC linker script > # */
|
3 |
|
|
/* # ********************************************************************************************* # */
|
4 |
|
|
/* # BSD 3-Clause License # */
|
5 |
|
|
/* # # */
|
6 |
|
|
/* # Copyright (c) 2020, Stephan Nolting. All rights reserved. # */
|
7 |
|
|
/* # # */
|
8 |
|
|
/* # Redistribution and use in source and binary forms, with or without modification, are # */
|
9 |
|
|
/* # permitted provided that the following conditions are met: # */
|
10 |
|
|
/* # # */
|
11 |
|
|
/* # 1. Redistributions of source code must retain the above copyright notice, this list of # */
|
12 |
|
|
/* # conditions and the following disclaimer. # */
|
13 |
|
|
/* # # */
|
14 |
|
|
/* # 2. Redistributions in binary form must reproduce the above copyright notice, this list of # */
|
15 |
|
|
/* # conditions and the following disclaimer in the documentation and/or other materials # */
|
16 |
|
|
/* # provided with the distribution. # */
|
17 |
|
|
/* # # */
|
18 |
|
|
/* # 3. Neither the name of the copyright holder nor the names of its contributors may be used to # */
|
19 |
|
|
/* # endorse or promote products derived from this software without specific prior written # */
|
20 |
|
|
/* # permission. # */
|
21 |
|
|
/* # # */
|
22 |
|
|
/* # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS # */
|
23 |
|
|
/* # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # */
|
24 |
|
|
/* # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # */
|
25 |
|
|
/* # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # */
|
26 |
|
|
/* # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # */
|
27 |
|
|
/* # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED # */
|
28 |
|
|
/* # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # */
|
29 |
|
|
/* # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED # */
|
30 |
|
|
/* # OF THE POSSIBILITY OF SUCH DAMAGE. # */
|
31 |
|
|
/* # ********************************************************************************************* # */
|
32 |
|
|
/* # The NEO430 Processor - https://github.com/stnolting/neo430 # */
|
33 |
|
|
/* ################################################################################################# */
|
34 |
|
|
|
35 |
|
|
OUTPUT_ARCH(msp430)
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
/* Relevant address space layout */
|
39 |
|
|
MEMORY
|
40 |
|
|
{
|
41 |
|
|
rom (rx) : ORIGIN = 0x0000, LENGTH = 0x1000
|
42 |
|
|
ram (rwx) : ORIGIN = 0xC008, LENGTH = 0x0800 - 8
|
43 |
|
|
}
|
44 |
|
|
|
45 |
|
|
/* Final executable layout */
|
46 |
|
|
SECTIONS
|
47 |
|
|
{
|
48 |
|
|
.text :
|
49 |
|
|
{
|
50 |
|
|
. = ALIGN(2);
|
51 |
|
|
PROVIDE(__text_start = .);
|
52 |
|
|
PROVIDE(__textstart = .);
|
53 |
|
|
|
54 |
|
|
KEEP(crt0.elf(.text)); /* start-up/termination code */
|
55 |
|
|
|
56 |
|
|
*(.init .init.*);
|
57 |
|
|
*(.init0); /* Start here after reset. */
|
58 |
|
|
*(.init1); /* User definable */
|
59 |
|
|
*(.init2); /* Initialize stack */
|
60 |
|
|
*(.init3); /* Initialize hardware */
|
61 |
|
|
*(.init4); /* Copy data to .data, clear bss */
|
62 |
|
|
*(.init5); /* User definable. */
|
63 |
|
|
*(.init6); /* C++ constructors. */
|
64 |
|
|
*(.init7); /* User definable. */
|
65 |
|
|
*(.init8); /* User definable. */
|
66 |
|
|
*(.init9); /* Call main(). */
|
67 |
|
|
|
68 |
|
|
*(.fini9); /* Falls into here after main(). User definable. */
|
69 |
|
|
*(.fini8); /* User definable. */
|
70 |
|
|
*(.fini7); /* User definable. */
|
71 |
|
|
*(.fini6); /* C++ destructors. */
|
72 |
|
|
*(.fini5); /* User definable. */
|
73 |
|
|
*(.fini4); /* User definable. */
|
74 |
|
|
*(.fini3); /* User definable. */
|
75 |
|
|
*(.fini2); /* User definable. */
|
76 |
|
|
*(.fini1); /* User definable. */
|
77 |
|
|
*(.fini0); /* Infinite loop after program termination. */
|
78 |
|
|
*(.fini .fini.*);
|
79 |
|
|
|
80 |
|
|
. = ALIGN(2);
|
81 |
|
|
__ctors_start = .;
|
82 |
|
|
KEEP(*(.ctors));
|
83 |
|
|
__ctors_end = .;
|
84 |
|
|
__dtors_start = .;
|
85 |
|
|
KEEP(*(.dtors));
|
86 |
|
|
__dtors_end = .;
|
87 |
|
|
|
88 |
|
|
. = ALIGN(2);
|
89 |
|
|
*(.text .text.*);
|
90 |
|
|
*(.near.text .near.text.*);
|
91 |
|
|
|
92 |
|
|
. = ALIGN(2);
|
93 |
|
|
PROVIDE(__text_end = .);
|
94 |
|
|
PROVIDE(__textend = .);
|
95 |
|
|
} > rom
|
96 |
|
|
|
97 |
|
|
.rodata :
|
98 |
|
|
{
|
99 |
|
|
. = ALIGN(2);
|
100 |
|
|
PROVIDE(__rodata_start = .);
|
101 |
|
|
PROVIDE(__rodatastart = .);
|
102 |
|
|
|
103 |
|
|
*(.plt);
|
104 |
|
|
. = ALIGN(2);
|
105 |
|
|
*(.lower.rodata.* .lower.rodata)
|
106 |
|
|
. = ALIGN(2);
|
107 |
|
|
*(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*)
|
108 |
|
|
. = ALIGN(2);
|
109 |
|
|
*(.either.rodata.* .either.rodata)
|
110 |
|
|
. = ALIGN(2);
|
111 |
|
|
*(.rodata1)
|
112 |
|
|
. = ALIGN(2);
|
113 |
|
|
|
114 |
|
|
KEEP (*(.gcc_except_table)) *(.gcc_except_table.*)
|
115 |
|
|
PROVIDE (__preinit_array_start = .);
|
116 |
|
|
KEEP (*(.preinit_array))
|
117 |
|
|
PROVIDE (__preinit_array_end = .);
|
118 |
|
|
PROVIDE (__init_array_start = .);
|
119 |
|
|
KEEP (*(SORT(.init_array.*)))
|
120 |
|
|
KEEP (*(.init_array))
|
121 |
|
|
PROVIDE (__init_array_end = .);
|
122 |
|
|
PROVIDE (__fini_array_start = .);
|
123 |
|
|
KEEP (*(.fini_array))
|
124 |
|
|
KEEP (*(SORT(.fini_array.*)))
|
125 |
|
|
PROVIDE (__fini_array_end = .);
|
126 |
|
|
|
127 |
|
|
PROVIDE(__rodata_end = .);
|
128 |
|
|
PROVIDE(__rodataend = .);
|
129 |
|
|
} > rom
|
130 |
|
|
_etext = .; /* Past last read-only (loadable) segment */
|
131 |
|
|
|
132 |
|
|
/* ----------------------------------- */
|
133 |
|
|
|
134 |
|
|
.data :
|
135 |
|
|
{
|
136 |
|
|
. = ALIGN(2);
|
137 |
|
|
PROVIDE(__data_start = .);
|
138 |
|
|
PROVIDE(__datastart = .);
|
139 |
|
|
|
140 |
|
|
*(.lower.data.* .lower.data)
|
141 |
|
|
*(.data .data.* .gnu.linkonce.d.*)
|
142 |
|
|
*(.either.data.* .either.data)
|
143 |
|
|
|
144 |
|
|
KEEP (*(.jcr))
|
145 |
|
|
*(.data.rel.ro.local) *(.data.rel.ro*)
|
146 |
|
|
*(.dynamic)
|
147 |
|
|
|
148 |
|
|
KEEP (*(.gnu.linkonce.d.*personality*))
|
149 |
|
|
SORT(CONSTRUCTORS)
|
150 |
|
|
*(.data1)
|
151 |
|
|
*(.got.plt) *(.got)
|
152 |
|
|
|
153 |
|
|
. = ALIGN(2);
|
154 |
|
|
*(.sdata .sdata.* .gnu.linkonce.s.* D_2 D_1)
|
155 |
|
|
|
156 |
|
|
. = ALIGN(2);
|
157 |
|
|
_edata = .;
|
158 |
|
|
PROVIDE(edata = .);
|
159 |
|
|
PROVIDE(__data_end = .);
|
160 |
|
|
PROVIDE(__dataend = .);
|
161 |
|
|
} > ram AT > rom
|
162 |
|
|
|
163 |
|
|
/* ----------------------------------- */
|
164 |
|
|
|
165 |
|
|
.bss :
|
166 |
|
|
{
|
167 |
|
|
. = ALIGN(2);
|
168 |
|
|
PROVIDE(__bss_start = .);
|
169 |
|
|
PROVIDE(__bssstart = .);
|
170 |
|
|
|
171 |
|
|
*(.lower.bss.* .lower.bss)
|
172 |
|
|
*(.dynbss);
|
173 |
|
|
*(.sbss .sbss.*);
|
174 |
|
|
*(.bss .bss.* .gnu.linkonce.b.*);
|
175 |
|
|
*(.either.bss.* .either.bss)
|
176 |
|
|
. = ALIGN(2);
|
177 |
|
|
*(COMMON);
|
178 |
|
|
. = ALIGN(2);
|
179 |
|
|
|
180 |
|
|
PROVIDE(__bss_end = .);
|
181 |
|
|
PROVIDE(__bssend = .);
|
182 |
|
|
} > ram
|
183 |
|
|
|
184 |
|
|
.noinit (NOLOAD):
|
185 |
|
|
{
|
186 |
|
|
. = ALIGN(2);
|
187 |
|
|
*(.noinit)
|
188 |
|
|
. = ALIGN(2);
|
189 |
|
|
PROVIDE(__noinit_end = .);
|
190 |
|
|
end = .;
|
191 |
|
|
} > ram
|
192 |
|
|
|
193 |
|
|
.MP430.attributes 0 :
|
194 |
|
|
{
|
195 |
|
|
KEEP (*(.MSP430.attributes))
|
196 |
|
|
KEEP (*(.gnu.attributes))
|
197 |
|
|
KEEP (*(__TI_build_attributes))
|
198 |
|
|
}
|
199 |
|
|
|
200 |
|
|
/* The rest are all not normally part of the runtime image. */
|
201 |
|
|
|
202 |
|
|
/* Stabs debugging sections. */
|
203 |
|
|
.stab 0 : { *(.stab) }
|
204 |
|
|
.stabstr 0 : { *(.stabstr) }
|
205 |
|
|
.stab.excl 0 : { *(.stab.excl) }
|
206 |
|
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
207 |
|
|
.stab.index 0 : { *(.stab.index) }
|
208 |
|
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
209 |
|
|
.comment 0 : { *(.comment) }
|
210 |
|
|
/* DWARF debug sections.
|
211 |
|
|
Symbols in the DWARF debugging sections are relative to the beginning
|
212 |
|
|
of the section so we begin them at 0. */
|
213 |
|
|
/* DWARF 1 */
|
214 |
|
|
.debug 0 : { *(.debug) }
|
215 |
|
|
.line 0 : { *(.line) }
|
216 |
|
|
/* GNU DWARF 1 extensions */
|
217 |
|
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
218 |
|
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
219 |
|
|
/* DWARF 1.1 and DWARF 2 */
|
220 |
|
|
.debug_aranges 0 : { *(.debug_aranges) }
|
221 |
|
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
222 |
|
|
/* DWARF 2 */
|
223 |
|
|
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
224 |
|
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
225 |
|
|
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
|
226 |
|
|
.debug_frame 0 : { *(.debug_frame) }
|
227 |
|
|
.debug_str 0 : { *(.debug_str) }
|
228 |
|
|
.debug_loc 0 : { *(.debug_loc) }
|
229 |
|
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
230 |
|
|
/* SGI/MIPS DWARF 2 extensions */
|
231 |
|
|
.debug_weaknames 0 : { *(.debug_weaknames) }
|
232 |
|
|
.debug_funcnames 0 : { *(.debug_funcnames) }
|
233 |
|
|
.debug_typenames 0 : { *(.debug_typenames) }
|
234 |
|
|
.debug_varnames 0 : { *(.debug_varnames) }
|
235 |
|
|
/DISCARD/ : { *(.note.GNU-stack) }
|
236 |
|
|
|
237 |
|
|
PROVIDE(__data_start_rom = _etext);
|
238 |
|
|
PROVIDE(__data_end_rom = _etext + SIZEOF(.data));
|
239 |
|
|
PROVIDE(__romdatastart = __data_start_rom);
|
240 |
|
|
PROVIDE(__romdatacopysize = SIZEOF(.data));
|
241 |
|
|
PROVIDE(__bsssize = SIZEOF(.bss));
|
242 |
|
|
|
243 |
|
|
}
|