1 /* mbed - LPC4330_M4 linker script
2 * Based linker script generated by Code Red Technologies Red Suite 7.0
4 GROUP(libgcc.a libc.a libstdc++.a libm.a libcr_newlib_nohost.a crti.o crtn.o crtbegin.o crtend.o)
8 /* Define each memory region */
9 RamLoc128 (rwx) : ORIGIN = 0x10000118, LENGTH = 0x1FEE8 /* 128K bytes */
10 RamLoc72 (rwx) : ORIGIN = 0x10080000, LENGTH = 0x12000 /* 72K bytes */
11 RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes */
12 RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes */
13 RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes */
14 SPIFI (rx) : ORIGIN = 0x14000000, LENGTH = 0x400000 /* 4M bytes */
18 /* Define a symbol for the top of each memory region */
19 __top_RamLoc128 = 0x10000000 + 0x20000;
20 __top_RamLoc72 = 0x10080000 + 0x12000;
21 __top_RamAHB32 = 0x20000000 + 0x8000;
22 __top_RamAHB16 = 0x20008000 + 0x4000;
23 __top_RamAHB_ETB16 = 0x2000c000 + 0x4000;
24 __top_SPIFI = 0x14000000 + 0x400000;
31 /* MAIN TEXT SECTION */
35 __vectors_start__ = ABSOLUTE(.) ;
38 /* Global Section Table */
40 __section_table_start = .;
41 __data_section_table = .;
42 LONG(LOADADDR(.data));
45 LONG(LOADADDR(.data_RAM2));
46 LONG( ADDR(.data_RAM2));
47 LONG( SIZEOF(.data_RAM2));
48 LONG(LOADADDR(.data_RAM3));
49 LONG( ADDR(.data_RAM3));
50 LONG( SIZEOF(.data_RAM3));
51 LONG(LOADADDR(.data_RAM4));
52 LONG( ADDR(.data_RAM4));
53 LONG( SIZEOF(.data_RAM4));
54 LONG(LOADADDR(.data_RAM5));
55 LONG( ADDR(.data_RAM5));
56 LONG( SIZEOF(.data_RAM5));
57 __data_section_table_end = .;
58 __bss_section_table = .;
61 LONG( ADDR(.bss_RAM2));
62 LONG( SIZEOF(.bss_RAM2));
63 LONG( ADDR(.bss_RAM3));
64 LONG( SIZEOF(.bss_RAM3));
65 LONG( ADDR(.bss_RAM4));
66 LONG( SIZEOF(.bss_RAM4));
67 LONG( ADDR(.bss_RAM5));
68 LONG( SIZEOF(.bss_RAM5));
69 __bss_section_table_end = .;
70 __section_table_end = . ;
71 /* End of Global Section Table */
81 *(.rodata .rodata.* .constdata .constdata.*)
84 /* C++ constructors etc */
89 __preinit_array_start = .;
90 KEEP (*(.preinit_array))
91 __preinit_array_end = .;
94 __init_array_start = .;
95 KEEP (*(SORT(.init_array.*)))
102 KEEP (*crtbegin.o(.ctors))
103 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
104 KEEP (*(SORT(.ctors.*)))
105 KEEP (*crtend.o(.ctors))
108 KEEP (*crtbegin.o(.dtors))
109 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
110 KEEP (*(SORT(.dtors.*)))
111 KEEP (*crtend.o(.dtors))
116 * for exception handling/unwind - some Newlib functions (in common
117 * with C++ and STDC++) use this.
119 .ARM.extab : ALIGN(4)
121 *(.ARM.extab* .gnu.linkonce.armextab.*)
125 .ARM.exidx : ALIGN(4)
127 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
134 /* DATA section for RamLoc72 */
135 .data_RAM2 : ALIGN(4)
139 *(.ramfunc.$RamLoc72)
143 } > RamLoc72 AT>SPIFI
145 /* DATA section for RamAHB32 */
146 .data_RAM3 : ALIGN(4)
150 *(.ramfunc.$RamAHB32)
154 } > RamAHB32 AT>SPIFI
156 /* DATA section for RamAHB16 */
157 .data_RAM4 : ALIGN(4)
161 *(.ramfunc.$RamAHB16)
165 } > RamAHB16 AT>SPIFI
167 /* DATA section for RamAHB_ETB16 */
168 .data_RAM5 : ALIGN(4)
172 *(.ramfunc.$RamAHB_ETB16)
174 *(.data.$RamAHB_ETB16*)
176 } > RamAHB_ETB16 AT>SPIFI
178 /* MAIN DATA SECTION */
181 .uninit_RESERVED : ALIGN(4)
183 KEEP(*(.bss.$RESERVED*))
185 _end_uninit_RESERVED = .;
189 /* Main DATA section (RamLoc128) */
199 } > RamLoc128 AT>SPIFI
201 /* BSS section for RamLoc72 */
208 /* BSS section for RamAHB32 */
215 /* BSS section for RamAHB16 */
222 /* BSS section for RamAHB_ETB16 */
226 *(.bss.$RamAHB_ETB16*)
230 /* MAIN BSS SECTION */
241 /* NOINIT section for RamLoc72 */
242 .noinit_RAM2 (NOLOAD) : ALIGN(4)
245 *(.noinit.$RamLoc72*)
248 /* NOINIT section for RamAHB32 */
249 .noinit_RAM3 (NOLOAD) : ALIGN(4)
252 *(.noinit.$RamAHB32*)
255 /* NOINIT section for RamAHB16 */
256 .noinit_RAM4 (NOLOAD) : ALIGN(4)
259 *(.noinit.$RamAHB16*)
262 /* NOINIT section for RamAHB_ETB16 */
263 .noinit_RAM5 (NOLOAD) : ALIGN(4)
266 *(.noinit.$RamAHB_ETB16*)
270 /* DEFAULT NOINIT SECTION */
271 .noinit (NOLOAD): ALIGN(4)
279 PROVIDE(_pvHeapStart = .);
280 PROVIDE(_vStackTop = __top_RamLoc128 - 0);