2 * Copyright (c) 2013 Qualcomm Atheros, Inc.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted (subject to the limitations in the
8 * disclaimer below) provided that the following conditions are met:
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
18 * * Neither the name of Qualcomm Atheros nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
23 * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
24 * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
25 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 /* Linker script for Magpie RAM-based applications */
40 Currently, ROM code reserves the first 8KB of RAM for its data/bss.
41 The next 12KB or RAM is used for RAM software's literals and read-only data.
42 After that comes 64KB reserved for RAM software's data and bss.
43 Then 92KB of RAM is reserved for text (code).
44 The last 8KB of RAM is reserved for ROM patches, customer DataSets,
45 and RAM software expansion. (There is also some additional RAM between
46 segments that can be used, if needed.)
47 ROM reserved: 0x00500000..0x00501fff
48 Literals: 0x00502000..0x00504fff
49 Data: 0x00505000..0x00514fff
50 Text: 0x00915000..0x0092bfff
51 TBD: May want to use a 2-pass link approach in order to
52 eliminate fixed boundaries. Support for physical addressing
53 in Tensilica tools would be helpful, but it's not coming
57 /* dram_seg: 0x504000, see target.rom.ld */
62 lit_seg : org = 0x004E8000, len = 0x1f600
63 iram_seg : org = 0x00906000, len = 0xad00
64 dram_seg : org = 0x00510d00, len = 0x6000
75 /* Default entry point: */
81 * This empty section is used to convince RAM linkage
82 * to share litbase with ROM code.
86 _rom_literal_start = ABSOLUTE(.);
87 . += 0x19000; /* Reserved virtual space for physical mem gap and ROM */
88 _lit4_start = ABSOLUTE(.);
89 _lit4_end = ABSOLUTE(.);
90 _rom_literal_end = ABSOLUTE(.);
95 _dport0_rodata_start = ABSOLUTE(.); /* 0x505000 */
98 _dport0_rodata_end = ABSOLUTE(.);
103 _dport0_literal_start = ABSOLUTE(.);
106 _dport0_literal_end = ABSOLUTE(.);
111 _dram0_rodata_start = ABSOLUTE(.);
114 _dram0_rodata_end = ABSOLUTE(.);
119 _rodata_start = ABSOLUTE(.);
124 __XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
129 . = ALIGN(4); /* this table MUST be 4-byte aligned */
130 _bss_table_start = ABSOLUTE(.);
131 LONG(_dport0_bss_start)
132 LONG(_dport0_bss_end)
135 _bss_table_end = ABSOLUTE(.);
136 _rodata_end = ABSOLUTE(.);
141 _literals_start = ABSOLUTE(.);
143 *(.gnu.linkonce.lit4.*)
144 _literals_end = ABSOLUTE(.);
149 _dram0_literal_start = ABSOLUTE(.);
152 _dram0_literal_end = ABSOLUTE(.);
157 _dport0_data_start = ABSOLUTE(.);
160 _dport0_data_end = ABSOLUTE(.);
161 } >dram_seg :dram_phdr
166 _dport0_bss_start = ABSOLUTE(.);
169 _dport0_bss_end = ABSOLUTE(.);
170 } >dram_seg :dram_phdr
174 _dram0_data_start = ABSOLUTE(.);
177 _dram0_data_end = ABSOLUTE(.);
178 } >dram_seg :dram_phdr
182 _data_start = ABSOLUTE(.);
192 *(.gnu.linkonce.s2.*)
195 /* C++ constructor and destructor tables, properly ordered: */
196 KEEP (*crtbegin.o(.ctors))
197 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
198 KEEP (*(SORT(.ctors.*)))
200 KEEP (*crtbegin.o(.dtors))
201 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
202 KEEP (*(SORT(.dtors.*)))
204 /* C++ exception handlers table: */
205 __XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
208 __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
209 *(.xt_except_desc_end)
212 _data_end = ABSOLUTE(.);
213 } >dram_seg :dram_phdr
218 _bss_start = ABSOLUTE(.);
222 *(.gnu.linkonce.sb.*)
226 *(.gnu.linkonce.sb2.*)
234 _bss_end = ABSOLUTE(.);
236 PROVIDE(end = ALIGN(0x8));
237 _fw_image_end = ABSOLUTE(.);
238 /*_stack_sentry = ALIGN(0x8);*/
239 } >dram_seg :dram_phdr
242 { *(.boot) } > iram_seg :iram_phdr
247 _text_start = ABSOLUTE(.);
251 *(.literal .text .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
255 _text_end = ABSOLUTE(.);
257 } >iram_seg :iram_phdr
261 _iram0_text_start = ABSOLUTE(.);
262 *(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text)
263 _iram0_text_end = ABSOLUTE(.);
264 } >iram_seg :iram_phdr
266 .debug 0 : { *(.debug) }
267 .line 0 : { *(.line) }
268 .debug_srcinfo 0 : { *(.debug_srcinfo) }
269 .debug_sfnames 0 : { *(.debug_sfnames) }
270 .debug_aranges 0 : { *(.debug_aranges) }
271 .debug_pubnames 0 : { *(.debug_pubnames) }
272 .debug_info 0 : { *(.debug_info) }
273 .debug_abbrev 0 : { *(.debug_abbrev) }
274 .debug_line 0 : { *(.debug_line) }
275 .debug_frame 0 : { *(.debug_frame) }
276 .debug_str 0 : { *(.debug_str) }
277 .debug_loc 0 : { *(.debug_loc) }
278 .debug_macinfo 0 : { *(.debug_macinfo) }
279 .debug_weaknames 0 : { *(.debug_weaknames) }
280 .debug_funcnames 0 : { *(.debug_funcnames) }
281 .debug_typenames 0 : { *(.debug_typenames) }
282 .debug_varnames 0 : { *(.debug_varnames) }
287 KEEP (*(.gnu.linkonce.x.*))
292 KEEP (*(.gnu.linkonce.prop.*))
297 KEEP (*(.gnu.linkonce.p.*))