1/* Linker script to configure memory regions. */
2
3MEMORY
4{
5  ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000  /* 512K FLASH */
6  RAM (rw) : ORIGIN = 0x20000000, LENGTH = 0x10000  /* 64K RAM    */
7}
8ENTRY(Reset_Handler)
9_system_stack_size = 0x200;
10
11SECTIONS
12{
13    .text :
14    {
15        . = ALIGN(4);
16        _stext = .;
17        KEEP(*(.isr_vector))            /* Startup code */
18
19        . = ALIGN(4);
20        *(.text)                        /* remaining code */
21        *(.text.*)                      /* remaining code */
22        *(.rodata)                      /* read-only data (constants) */
23        *(.rodata*)
24        *(.glue_7)
25        *(.glue_7t)
26        *(.gnu.linkonce.t*)
27
28        /* section information for finsh shell */
29        . = ALIGN(4);
30        __fsymtab_start = .;
31        KEEP(*(FSymTab))
32        __fsymtab_end = .;
33
34        . = ALIGN(4);
35        __vsymtab_start = .;
36        KEEP(*(VSymTab))
37        __vsymtab_end = .;
38
39        /* section information for initial. */
40        . = ALIGN(4);
41        __rt_init_start = .;
42        KEEP(*(SORT(.rti_fn*)))
43        __rt_init_end = .;
44
45        /* section information for modules */
46        . = ALIGN(4);
47        __rtmsymtab_start = .;
48        KEEP(*(RTMSymTab))
49        __rtmsymtab_end = .;
50
51        . = ALIGN(4);
52
53        PROVIDE(__ctors_start__ = .);
54        KEEP (*(SORT(.init_array.*)))
55        KEEP (*(.init_array))
56        PROVIDE(__ctors_end__ = .);
57
58        . = ALIGN(4);
59
60        _etext = .;
61    } > ROM = 0
62
63    /* .ARM.exidx is sorted, so has to go in its own output section.  */
64    __exidx_start = .;
65    .ARM.exidx :
66    {
67        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
68
69        /* This is used by the startup in order to initialize the .data secion */
70        _sidata = .;
71    } > ROM
72    __exidx_end = .;
73
74    /* .data section which is used for initialized data */
75    .data : AT (_sidata)
76    {
77        . = ALIGN(4);
78        /* This is used by the startup in order to initialize the .data secion */
79        _sdata = . ;
80
81        *(.data)
82        *(.data.*)
83        *(.gnu.linkonce.d*)
84
85        PROVIDE(__dtors_start__ = .);
86        KEEP(*(SORT(.dtors.*)))
87        KEEP(*(.dtors))
88        PROVIDE(__dtors_end__ = .);
89
90        . = ALIGN(4);
91        /* This is used by the startup in order to initialize the .data secion */
92        _edata = . ;
93    } >RAM
94
95    .stack :
96    {
97        . = ALIGN(4);
98        _sstack = .;
99        . = . + _system_stack_size;
100        . = ALIGN(4);
101        _estack = .;
102    } >RAM
103
104    __bss_start = .;
105    .bss :
106    {
107        . = ALIGN(4);
108        /* This is used by the startup in order to initialize the .bss secion */
109        _sbss = .;
110
111        *(.bss)
112        *(.bss.*)
113        *(COMMON)
114
115        . = ALIGN(4);
116        /* This is used by the startup in order to initialize the .bss secion */
117        _ebss = . ;
118
119        *(.bss.init)
120    } > RAM
121    __bss_end = .;
122
123    _end = .;
124
125    PROVIDE(__etext = __exidx_end);
126    PROVIDE(__data_start__ = _sdata);
127    PROVIDE(__bss_start__ = __bss_start);
128    PROVIDE(__bss_end__ = __bss_end);
129    PROVIDE(__StackTop = _estack);
130}
131