1/* Program Entry, set to mark it as "used" and avoid gc */
2MEMORY
3{
4    ROM (rx) : ORIGIN = 0x08000000, LENGTH = 64k /* 64KB flash */
5    RAM (rw) : ORIGIN = 0x20000000, LENGTH =  20k /* 20K sram */
6}
7ENTRY(Reset_Handler)
8_system_stack_size = 0x200;
9
10SECTIONS
11{
12    .text :
13    {
14        . = ALIGN(4);
15        _stext = .;
16        KEEP(*(.isr_vector))            /* Startup code */
17
18        . = ALIGN(4);
19        *(.text)                        /* remaining code */
20        *(.text.*)                      /* remaining code */
21        *(.rodata)                      /* read-only data (constants) */
22        *(.rodata*)
23        *(.glue_7)
24        *(.glue_7t)
25        *(.gnu.linkonce.t*)
26
27        /* section information for finsh shell */
28        . = ALIGN(4);
29        __fsymtab_start = .;
30        KEEP(*(FSymTab))
31        __fsymtab_end = .;
32
33        . = ALIGN(4);
34        __vsymtab_start = .;
35        KEEP(*(VSymTab))
36        __vsymtab_end = .;
37
38        /* section information for initial. */
39        . = ALIGN(4);
40        __rt_init_start = .;
41        KEEP(*(SORT(.rti_fn*)))
42        __rt_init_end = .;
43
44        . = ALIGN(4);
45
46        PROVIDE(__ctors_start__ = .);
47        KEEP (*(SORT(.init_array.*)))
48        KEEP (*(.init_array))
49        PROVIDE(__ctors_end__ = .);
50
51        . = ALIGN(4);
52
53        _etext = .;
54    } > ROM = 0
55
56    /* .ARM.exidx is sorted, so has to go in its own output section.  */
57    __exidx_start = .;
58    .ARM.exidx :
59    {
60        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
61
62        /* This is used by the startup in order to initialize the .data secion */
63        _sidata = .;
64    } > ROM
65    __exidx_end = .;
66
67    /* .data section which is used for initialized data */
68
69    .data : AT (_sidata)
70    {
71        . = ALIGN(4);
72        /* This is used by the startup in order to initialize the .data secion */
73        _sdata = . ;
74
75        *(.data)
76        *(.data.*)
77        *(.gnu.linkonce.d*)
78
79        PROVIDE(__dtors_start__ = .);
80        KEEP(*(SORT(.dtors.*)))
81        KEEP(*(.dtors))
82        PROVIDE(__dtors_end__ = .);
83
84        . = ALIGN(4);
85        /* This is used by the startup in order to initialize the .data secion */
86        _edata = . ;
87    } >RAM
88
89    .stack :
90    {
91        . = ALIGN(4);
92        _sstack = .;
93        . = . + _system_stack_size;
94        . = ALIGN(4);
95        _estack = .;
96    } >RAM
97
98    __bss_start = .;
99    .bss :
100    {
101        . = ALIGN(4);
102        /* This is used by the startup in order to initialize the .bss secion */
103        _sbss = .;
104
105        *(.bss)
106        *(.bss.*)
107        *(COMMON)
108
109        . = ALIGN(4);
110        /* This is used by the startup in order to initialize the .bss secion */
111        _ebss = . ;
112
113        *(.bss.init)
114    } > RAM
115    __bss_end = .;
116
117    _end = .;
118
119    /* Stabs debugging sections.  */
120    .stab          0 : { *(.stab) }
121    .stabstr       0 : { *(.stabstr) }
122    .stab.excl     0 : { *(.stab.excl) }
123    .stab.exclstr  0 : { *(.stab.exclstr) }
124    .stab.index    0 : { *(.stab.index) }
125    .stab.indexstr 0 : { *(.stab.indexstr) }
126    .comment       0 : { *(.comment) }
127    /* DWARF debug sections.
128     * Symbols in the DWARF debugging sections are relative to the beginning
129     * of the section so we begin them at 0.  */
130    /* DWARF 1 */
131    .debug          0 : { *(.debug) }
132    .line           0 : { *(.line) }
133    /* GNU DWARF 1 extensions */
134    .debug_srcinfo  0 : { *(.debug_srcinfo) }
135    .debug_sfnames  0 : { *(.debug_sfnames) }
136    /* DWARF 1.1 and DWARF 2 */
137    .debug_aranges  0 : { *(.debug_aranges) }
138    .debug_pubnames 0 : { *(.debug_pubnames) }
139    /* DWARF 2 */
140    .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
141    .debug_abbrev   0 : { *(.debug_abbrev) }
142    .debug_line     0 : { *(.debug_line) }
143    .debug_frame    0 : { *(.debug_frame) }
144    .debug_str      0 : { *(.debug_str) }
145    .debug_loc      0 : { *(.debug_loc) }
146    .debug_macinfo  0 : { *(.debug_macinfo) }
147    /* SGI/MIPS DWARF 2 extensions */
148    .debug_weaknames 0 : { *(.debug_weaknames) }
149    .debug_funcnames 0 : { *(.debug_funcnames) }
150    .debug_typenames 0 : { *(.debug_typenames) }
151    .debug_varnames  0 : { *(.debug_varnames) }
152}
153