amiro-os / ports / STM32F103xE.ld @ 7520e117
History | View | Annotate | Download (2.706 KB)
1 |
/* |
---|---|
2 |
* ST32F103xE memory setup. |
3 |
*/ |
4 |
__main_stack_size__ = 0x0400; |
5 |
__process_stack_size__ = 0x0400; |
6 |
|
7 |
MEMORY |
8 |
{ |
9 |
flash : org = 0x08006000, len = 512k-24k |
10 |
ram : org = 0x20000000, len = 64k |
11 |
} |
12 |
|
13 |
__ram_start__ = ORIGIN(ram); |
14 |
__ram_size__ = LENGTH(ram); |
15 |
__ram_end__ = __ram_start__ + __ram_size__; |
16 |
|
17 |
__crc_start__ = ORIGIN(flash) + 0x150; |
18 |
|
19 |
ENTRY(ResetHandler) |
20 |
|
21 |
SECTIONS |
22 |
{ |
23 |
. = 0; |
24 |
_text = .; |
25 |
|
26 |
startup : ALIGN(16) SUBALIGN(16) |
27 |
{ |
28 |
KEEP(*(vectors)) |
29 |
} > flash |
30 |
|
31 |
crc __crc_start__ : |
32 |
{ |
33 |
LONG(0x55aa11ee); |
34 |
} > flash |
35 |
|
36 |
constructors : ALIGN(4) SUBALIGN(4) |
37 |
{ |
38 |
PROVIDE(__init_array_start = .); |
39 |
KEEP(*(SORT(.init_array.*))) |
40 |
KEEP(*(.init_array)) |
41 |
PROVIDE(__init_array_end = .); |
42 |
} > flash |
43 |
|
44 |
destructors : ALIGN(4) SUBALIGN(4) |
45 |
{ |
46 |
PROVIDE(__fini_array_start = .); |
47 |
KEEP(*(.fini_array)) |
48 |
KEEP(*(SORT(.fini_array.*))) |
49 |
PROVIDE(__fini_array_end = .); |
50 |
} > flash |
51 |
|
52 |
.text : ALIGN(16) SUBALIGN(16) |
53 |
{ |
54 |
*(.text.startup.*) |
55 |
*(.text) |
56 |
*(.text.*) |
57 |
*(.rodata) |
58 |
*(.rodata.*) |
59 |
*(.glue_7t) |
60 |
*(.glue_7) |
61 |
*(.gcc*) |
62 |
} > flash |
63 |
|
64 |
.ARM.extab : |
65 |
{ |
66 |
*(.ARM.extab* .gnu.linkonce.armextab.*) |
67 |
} > flash |
68 |
|
69 |
.ARM.exidx : { |
70 |
PROVIDE(__exidx_start = .); |
71 |
*(.ARM.exidx* .gnu.linkonce.armexidx.*) |
72 |
PROVIDE(__exidx_end = .); |
73 |
} > flash |
74 |
|
75 |
.eh_frame_hdr : |
76 |
{ |
77 |
*(.eh_frame_hdr) |
78 |
} > flash |
79 |
|
80 |
.eh_frame : ONLY_IF_RO |
81 |
{ |
82 |
*(.eh_frame) |
83 |
} > flash |
84 |
|
85 |
.textalign : ONLY_IF_RO |
86 |
{ |
87 |
. = ALIGN(8); |
88 |
} > flash |
89 |
|
90 |
. = ALIGN(4); |
91 |
_etext = .; |
92 |
_textdata = _etext; |
93 |
|
94 |
.stacks : |
95 |
{ |
96 |
. = ALIGN(8); |
97 |
__main_stack_base__ = .; |
98 |
. += __main_stack_size__; |
99 |
. = ALIGN(8); |
100 |
__main_stack_end__ = .; |
101 |
__process_stack_base__ = .; |
102 |
__main_thread_stack_base__ = .; |
103 |
. += __process_stack_size__; |
104 |
. = ALIGN(8); |
105 |
__process_stack_end__ = .; |
106 |
__main_thread_stack_end__ = .; |
107 |
} > ram |
108 |
|
109 |
.data ALIGN(4) : ALIGN(4) |
110 |
{ |
111 |
. = ALIGN(4); |
112 |
PROVIDE(_data = .); |
113 |
*(.data) |
114 |
*(.data.*) |
115 |
*(.ramtext) |
116 |
. = ALIGN(4); |
117 |
PROVIDE(_edata = .); |
118 |
} > ram AT > flash |
119 |
|
120 |
.bss ALIGN(4) : ALIGN(4) |
121 |
{ |
122 |
. = ALIGN(4); |
123 |
PROVIDE(_bss_start = .); |
124 |
*(.bss) |
125 |
*(.bss.*) |
126 |
*(COMMON) |
127 |
. = ALIGN(4); |
128 |
PROVIDE(_bss_end = .); |
129 |
} > ram |
130 |
} |
131 |
|
132 |
PROVIDE(end = .); |
133 |
_end = .; |
134 |
|
135 |
__heap_base__ = _end; |
136 |
__heap_end__ = __ram_end__; |