2 /* Linker script for Magpie RAM-based applications */
5 Currently, ROM code reserves the first 8KB of RAM for its data/bss.
6 The next 12KB or RAM is used for RAM software's literals and read-only data.
7 After that comes 64KB reserved for RAM software's data and bss.
8 Then 92KB of RAM is reserved for text (code).
9 The last 8KB of RAM is reserved for ROM patches, customer DataSets,
10 and RAM software expansion. (There is also some additional RAM between
11 segments that can be used, if needed.)
12 ROM reserved: 0x00500000..0x00501fff
13 Literals: 0x00502000..0x00504fff
14 Data: 0x00505000..0x00514fff
15 Text: 0x00915000..0x0092bfff
16 TBD: May want to use a 2-pass link approach in order to
17 eliminate fixed boundaries. Support for physical addressing
18 in Tensilica tools would be helpful, but it's not coming
22 /* dram_seg: 0x504000, see target.rom.ld */
27 lit_seg : org = 0x004E5200, len = 0x1DE00
28 iram_seg : org = 0x00903000, len = 0x9B40
29 dram_seg : org = 0x0050CB40, len = 0x1800
40 /* Default entry point: */
46 * This empty section is used to convince RAM linkage
47 * to share litbase with ROM code.
51 _rom_literal_start = ABSOLUTE(.);
52 . += 0x1BE00; /* Reserved virtual space for physical mem gap and ROM */
53 _lit4_start = ABSOLUTE(.);
54 _lit4_end = ABSOLUTE(.);
55 _rom_literal_end = ABSOLUTE(.);
60 _dport0_rodata_start = ABSOLUTE(.); /* 0x505000 */
63 _dport0_rodata_end = ABSOLUTE(.);
68 _dport0_literal_start = ABSOLUTE(.);
71 _dport0_literal_end = ABSOLUTE(.);
76 _dram0_rodata_start = ABSOLUTE(.);
79 _dram0_rodata_end = ABSOLUTE(.);
84 _rodata_start = ABSOLUTE(.);
89 __XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
94 . = ALIGN(4); /* this table MUST be 4-byte aligned */
95 _bss_table_start = ABSOLUTE(.);
96 LONG(_dport0_bss_start)
100 _bss_table_end = ABSOLUTE(.);
101 _rodata_end = ABSOLUTE(.);
106 _literals_start = ABSOLUTE(.);
108 *(.gnu.linkonce.lit4.*)
109 _literals_end = ABSOLUTE(.);
114 _dram0_literal_start = ABSOLUTE(.);
117 _dram0_literal_end = ABSOLUTE(.);
122 _dport0_data_start = ABSOLUTE(.);
125 _dport0_data_end = ABSOLUTE(.);
126 } >dram_seg :dram_phdr
131 _dport0_bss_start = ABSOLUTE(.);
134 _dport0_bss_end = ABSOLUTE(.);
135 } >dram_seg :dram_phdr
139 _dram0_data_start = ABSOLUTE(.);
142 _dram0_data_end = ABSOLUTE(.);
143 } >dram_seg :dram_phdr
147 _data_start = ABSOLUTE(.);
157 *(.gnu.linkonce.s2.*)
160 /* C++ constructor and destructor tables, properly ordered: */
161 KEEP (*crtbegin.o(.ctors))
162 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
163 KEEP (*(SORT(.ctors.*)))
165 KEEP (*crtbegin.o(.dtors))
166 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
167 KEEP (*(SORT(.dtors.*)))
169 /* C++ exception handlers table: */
170 __XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
173 __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
174 *(.xt_except_desc_end)
177 _data_end = ABSOLUTE(.);
178 } >dram_seg :dram_phdr
183 _bss_start = ABSOLUTE(.);
187 *(.gnu.linkonce.sb.*)
191 *(.gnu.linkonce.sb2.*)
199 _bss_end = ABSOLUTE(.);
201 PROVIDE(end = ALIGN(0x8));
202 _fw_image_end = ABSOLUTE(.);
203 /*_stack_sentry = ALIGN(0x8);*/
204 } >dram_seg :dram_phdr
209 _text_start = ABSOLUTE(.);
213 *(.literal .text .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
217 _text_end = ABSOLUTE(.);
219 } >iram_seg :iram_phdr
223 _iram0_text_start = ABSOLUTE(.);
224 *(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text)
225 _iram0_text_end = ABSOLUTE(.);
226 } >iram_seg :iram_phdr
228 .debug 0 : { *(.debug) }
229 .line 0 : { *(.line) }
230 .debug_srcinfo 0 : { *(.debug_srcinfo) }
231 .debug_sfnames 0 : { *(.debug_sfnames) }
232 .debug_aranges 0 : { *(.debug_aranges) }
233 .debug_pubnames 0 : { *(.debug_pubnames) }
234 .debug_info 0 : { *(.debug_info) }
235 .debug_abbrev 0 : { *(.debug_abbrev) }
236 .debug_line 0 : { *(.debug_line) }
237 .debug_frame 0 : { *(.debug_frame) }
238 .debug_str 0 : { *(.debug_str) }
239 .debug_loc 0 : { *(.debug_loc) }
240 .debug_macinfo 0 : { *(.debug_macinfo) }
241 .debug_weaknames 0 : { *(.debug_weaknames) }
242 .debug_funcnames 0 : { *(.debug_funcnames) }
243 .debug_typenames 0 : { *(.debug_typenames) }
244 .debug_varnames 0 : { *(.debug_varnames) }
249 KEEP (*(.gnu.linkonce.x.*))
254 KEEP (*(.gnu.linkonce.prop.*))
259 KEEP (*(.gnu.linkonce.p.*))
263 INCLUDE "rom.addrs.ld"