1MEMORY
2{
3  RAM (wx) : ORIGIN = 0x20000000, LENGTH = 0x00800000
4  FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00400000
5}
6
7__STACKSIZE__ = 1024;
8__STACKSIZE_PROCESS__ = 0;
9__HEAPSIZE__ = 128;
10
11SECTIONS
12{
13  .vectors :
14  {
15    KEEP(*(.vectors .vectors.*))
16  } > FLASH
17
18	.text :
19	{
20		*(.text*)
21
22		KEEP(*(.init))
23		KEEP(*(.fini))
24
25		/* .ctors */
26		*crtbegin.o(.ctors)
27		*crtbegin?.o(.ctors)
28		*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
29    __ctors_start__ = ALIGN(4);
30		*(SORT(.ctors.*))
31		*(.ctors)
32    __ctors_end__ = ALIGN(4);
33
34		/* .dtors */
35 		*crtbegin.o(.dtors)
36 		*crtbegin?.o(.dtors)
37 		*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
38    __dtors_start__ = ALIGN(4);
39 		*(SORT(.dtors.*))
40 		*(.dtors)
41    __dtors_end__ = ALIGN(4);
42
43		*(.rodata*)
44
45		KEEP(*(.eh_frame*))
46	} > FLASH
47
48	.ARM.extab :
49	{
50		*(.ARM.extab* .gnu.linkonce.armextab.*)
51	} > FLASH
52
53	__exidx_start = .;
54	.ARM.exidx :
55	{
56		*(.ARM.exidx* .gnu.linkonce.armexidx.*)
57	} > FLASH
58	__exidx_end = .;
59
60	__data_load_start__ = ALIGN (4);
61
62	.data : AT (__data_load_start__)
63	{
64		__data_start__ = .;
65
66		*(vtable)
67		*(.data*)
68
69		. = ALIGN(4);
70		/* preinit data */
71		PROVIDE_HIDDEN (__preinit_array_start = .);
72		KEEP(*(.preinit_array))
73		PROVIDE_HIDDEN (__preinit_array_end = .);
74
75		. = ALIGN(4);
76		/* init data */
77		PROVIDE_HIDDEN (__init_array_start = .);
78		KEEP(*(SORT(.init_array.*)))
79		KEEP(*(.init_array))
80		PROVIDE_HIDDEN (__init_array_end = .);
81
82		. = ALIGN(4);
83		/* finit data */
84		PROVIDE_HIDDEN (__fini_array_start = .);
85		KEEP(*(SORT(.fini_array.*)))
86		KEEP(*(.fini_array))
87		PROVIDE_HIDDEN (__fini_array_end = .);
88
89		KEEP(*(.jcr*))
90		. = ALIGN(4);
91		/* All data end */
92
93    __data_end__ = .;
94
95	} > RAM
96
97	.bss :
98	{
99		. = ALIGN(4);
100		__bss_start__ = .;
101		*(.bss*)
102		*(COMMON)
103		. = ALIGN(4);
104		__bss_end__ = .;
105
106	} > RAM
107
108	.heap (COPY):
109	{
110    __heap_start__ = ALIGN(4);
111    *(.heap)
112    . = ALIGN(. + __HEAPSIZE__, 4);
113    __heap_end__ = ALIGN(4);
114	} > RAM
115
116  .stack ALIGN(4) (NOLOAD) :
117  {
118    __stack_start__ = ALIGN(4);
119    *(.stack)
120    . = ALIGN(. + __STACKSIZE__, 4);
121    __stack_end__ = ALIGN(4);
122  } > RAM
123
124  __RAM_segment_used_end__ = .;
125}
126