|
1 | | -/* |
2 | | -Default linker script for STM32F10x_128K_20K |
3 | | -Original Copyright RAISONANCE S.A.S. 2008 |
4 | | -Modified P Harrison May 2009 |
5 | | -*/ |
6 | | - |
7 | | -/* |
8 | | - * Default stack sizes. |
9 | | - * |
10 | | - * These are used by the startup in order to allocate stacks for the different modes. |
11 | | - * PROVIDE" allows to easily override these values from an object file or the commmand line. |
12 | | - */ |
13 | | - |
14 | | -__Stack_Size = 1024 ; |
15 | | -PROVIDE ( _Stack_Size = __Stack_Size ) ; |
16 | | -__Stack_Init = _estack - __Stack_Size ; |
17 | | -PROVIDE ( _Stack_Init = __Stack_Init ) ; |
18 | | - |
19 | | -/* |
20 | | - *There will be a link error if there is not this amount of RAM free at the end. |
21 | | - */ |
22 | | -_Minimum_Stack_Size = 0x100 ; |
23 | | - |
24 | | - |
25 | | -MEMORY |
26 | | -{ |
27 | | - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K |
28 | | - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K |
29 | | -} |
30 | | - |
31 | | -/* higher address of the user mode stack */ |
32 | | -_estack = 0x20005000; |
33 | | - |
34 | | -SECTIONS |
35 | | -{ |
36 | | -/* |
37 | | - * for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, |
38 | | - * which goes to FLASH |
39 | | - */ |
40 | | - .isr_vector : |
41 | | - { |
42 | | - . = ALIGN(4); |
43 | | - KEEP(*(.isr_vector)) /* Startup code */ |
44 | | - . = ALIGN(4); |
45 | | - } >FLASH |
46 | | - |
47 | | -/* |
48 | | - * for some STRx devices, the beginning of the startup code is stored in the .flashtext section, |
49 | | - * which goes to FLASH |
50 | | - */ |
51 | | - .flashtext : |
52 | | - { |
53 | | - . = ALIGN(4); |
54 | | - KEEP (*(.flashtext)) /* Startup code */ |
55 | | - . = ALIGN(4); |
56 | | - } >FLASH |
57 | | - |
58 | | - /* |
59 | | - * the program code is stored in the .text section, which goes to Flash |
60 | | - */ |
61 | | - .text : |
62 | | - { |
63 | | - . = ALIGN(4); |
64 | | - *(.text) /* remaining code */ |
65 | | - *(.text.*) /* remaining code */ |
66 | | - *(.rodata) /* read-only data (constants) */ |
67 | | - *(.rodata*) |
68 | | - *(.glue_7) |
69 | | - *(.glue_7t) |
70 | | - . = ALIGN(4); |
71 | | - _etext = .; |
72 | | - _sidata = _etext; |
73 | | - } >FLASH |
74 | | - |
75 | | -/* |
76 | | - * This is the initialized data section. It is stored in RAM but the initial values |
77 | | - * are held in flash and copied to RAM by the startup code |
78 | | - */ |
79 | | - |
80 | | -/* we copy the important program globals vector in RAM as well, so that users can fool with it */ |
81 | | - .data : AT ( _sidata ) /* AT makes the LMA follow on in the binary image */ |
82 | | - { |
83 | | - . = ALIGN(4); |
84 | | - _sdata = . ; /* Used by the startup in order to initialize the .data section */ |
85 | | - KEEP( *(.data) ) |
86 | | - KEEP( *(.data.*) ) |
87 | | - . = ALIGN(4); |
88 | | - _edata = . ; /* Used by the startup in order to initialize the .data section */ |
89 | | - } >RAM |
90 | | - |
91 | | - |
92 | | - |
93 | | -/* |
94 | | - * This is the uninitialized data section. Date here is stored in RAM and will be |
95 | | - * set to zero by the startup code. |
96 | | - */ |
97 | | - .bss : |
98 | | - { |
99 | | - . = ALIGN(4); |
100 | | - _sbss = .; /* Used by the startup in order to initialize the .bss section */ |
101 | | - *(.bss) |
102 | | - *(COMMON) |
103 | | - . = ALIGN(4); |
104 | | - _ebss = . ; /* Used by the startup in order to initialize the .bss section */ |
105 | | - } >RAM |
106 | | - |
107 | | -PROVIDE ( end = _ebss ); |
108 | | -PROVIDE ( _end = _ebss ); |
109 | | - |
110 | | -/* |
111 | | - * This is the user stack section |
112 | | - * This is just to check that there is enough RAM left for the User mode stack |
113 | | - * It should generate an error if it's full. |
114 | | - */ |
115 | | - ._usrstack : |
116 | | - { |
117 | | - . = ALIGN(4); |
118 | | - _susrstack = . ; |
119 | | - . = . + _Minimum_Stack_Size ; |
120 | | - . = ALIGN(4); |
121 | | - _eusrstack = . ; |
122 | | - } >RAM |
123 | | - |
124 | | -/* |
125 | | - * after that it's only debugging information. |
126 | | - */ |
127 | | - |
128 | | -/* remove the debugging information from the standard libraries */ |
129 | | -DISCARD : |
130 | | - { |
131 | | - libc.a ( * ) |
132 | | - libm.a ( * ) |
133 | | - libgcc.a ( * ) |
134 | | - } |
135 | | - |
136 | | -/* Stabs debugging sections. */ |
137 | | - .stab 0 : { *(.stab) } |
138 | | - .stabstr 0 : { *(.stabstr) } |
139 | | - .stab.excl 0 : { *(.stab.excl) } |
140 | | - .stab.exclstr 0 : { *(.stab.exclstr) } |
141 | | - .stab.index 0 : { *(.stab.index) } |
142 | | - .stab.indexstr 0 : { *(.stab.indexstr) } |
143 | | - .comment 0 : { *(.comment) } |
144 | | -/* |
145 | | - * DWARF debug sections. |
146 | | - * Symbols in the DWARF debugging sections are relative to the beginning |
147 | | - * of the section so we begin them at 0. |
148 | | - */ |
149 | | - |
150 | | -/* DWARF 1 */ |
151 | | - .debug 0 : { *(.debug) } |
152 | | - .line 0 : { *(.line) } |
153 | | -/* GNU DWARF 1 extensions */ |
154 | | - .debug_srcinfo 0 : { *(.debug_srcinfo) } |
155 | | - .debug_sfnames 0 : { *(.debug_sfnames) } |
156 | | -/* DWARF 1.1 and DWARF 2 */ |
157 | | - .debug_aranges 0 : { *(.debug_aranges) } |
158 | | - .debug_pubnames 0 : { *(.debug_pubnames) } |
159 | | -/* DWARF 2 */ |
160 | | - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
161 | | - .debug_abbrev 0 : { *(.debug_abbrev) } |
162 | | - .debug_line 0 : { *(.debug_line) } |
163 | | - .debug_frame 0 : { *(.debug_frame) } |
164 | | - .debug_str 0 : { *(.debug_str) } |
165 | | - .debug_loc 0 : { *(.debug_loc) } |
166 | | - .debug_macinfo 0 : { *(.debug_macinfo) } |
167 | | -/* SGI/MIPS DWARF 2 extensions */ |
168 | | - .debug_weaknames 0 : { *(.debug_weaknames) } |
169 | | - .debug_funcnames 0 : { *(.debug_funcnames) } |
170 | | - .debug_typenames 0 : { *(.debug_typenames) } |
171 | | - .debug_varnames 0 : { *(.debug_varnames) } |
172 | | -} |
| 1 | +/* |
| 2 | +Default linker script for STM32F10x_128K_20K |
| 3 | +Original Copyright RAISONANCE S.A.S. 2008 |
| 4 | +Modified P Harrison May 2009 |
| 5 | +*/ |
| 6 | + |
| 7 | +/* |
| 8 | + * Default stack sizes. |
| 9 | + * |
| 10 | + * These are used by the startup in order to allocate stacks for the different modes. |
| 11 | + * PROVIDE" allows to easily override these values from an object file or the commmand line. |
| 12 | + */ |
| 13 | + |
| 14 | +__Stack_Size = 1024 ; |
| 15 | +PROVIDE ( _Stack_Size = __Stack_Size ) ; |
| 16 | +__Stack_Init = _estack - __Stack_Size ; |
| 17 | +PROVIDE ( _Stack_Init = __Stack_Init ) ; |
| 18 | + |
| 19 | +/* |
| 20 | + *There will be a link error if there is not this amount of RAM free at the end. |
| 21 | + */ |
| 22 | +_Minimum_Stack_Size = 0x100 ; |
| 23 | + |
| 24 | + |
| 25 | +MEMORY |
| 26 | +{ |
| 27 | + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K |
| 28 | + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K |
| 29 | +} |
| 30 | + |
| 31 | +/* higher address of the user mode stack */ |
| 32 | +_estack = 0x20005000; |
| 33 | + |
| 34 | +SECTIONS |
| 35 | +{ |
| 36 | +/* |
| 37 | + * for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, |
| 38 | + * which goes to FLASH |
| 39 | + */ |
| 40 | + .isr_vector : |
| 41 | + { |
| 42 | + . = ALIGN(4); |
| 43 | + KEEP(*(.isr_vector)) /* Startup code */ |
| 44 | + . = ALIGN(4); |
| 45 | + } >FLASH |
| 46 | + |
| 47 | +/* |
| 48 | + * for some STRx devices, the beginning of the startup code is stored in the .flashtext section, |
| 49 | + * which goes to FLASH |
| 50 | + */ |
| 51 | + .flashtext : |
| 52 | + { |
| 53 | + . = ALIGN(4); |
| 54 | + KEEP (*(.flashtext)) /* Startup code */ |
| 55 | + . = ALIGN(4); |
| 56 | + } >FLASH |
| 57 | + |
| 58 | + /* |
| 59 | + * the program code is stored in the .text section, which goes to Flash |
| 60 | + */ |
| 61 | + .text : |
| 62 | + { |
| 63 | + . = ALIGN(4); |
| 64 | + *(.text) /* remaining code */ |
| 65 | + *(.text.*) /* remaining code */ |
| 66 | + *(.rodata) /* read-only data (constants) */ |
| 67 | + *(.rodata*) |
| 68 | + *(.glue_7) |
| 69 | + *(.glue_7t) |
| 70 | + . = ALIGN(4); |
| 71 | + _etext = .; |
| 72 | + _sidata = _etext; |
| 73 | + } >FLASH |
| 74 | + |
| 75 | +/* |
| 76 | + * This is the initialized data section. It is stored in RAM but the initial values |
| 77 | + * are held in flash and copied to RAM by the startup code |
| 78 | + */ |
| 79 | + |
| 80 | +/* we copy the important program globals vector in RAM as well, so that users can fool with it */ |
| 81 | + .data : AT ( _sidata ) /* AT makes the LMA follow on in the binary image */ |
| 82 | + { |
| 83 | + . = ALIGN(4); |
| 84 | + _sdata = . ; /* Used by the startup in order to initialize the .data section */ |
| 85 | + KEEP( *(.data) ) |
| 86 | + KEEP( *(.data.*) ) |
| 87 | + . = ALIGN(4); |
| 88 | + _edata = . ; /* Used by the startup in order to initialize the .data section */ |
| 89 | + } >RAM |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +/* |
| 94 | + * This is the uninitialized data section. Date here is stored in RAM and will be |
| 95 | + * set to zero by the startup code. |
| 96 | + */ |
| 97 | + .bss : |
| 98 | + { |
| 99 | + . = ALIGN(4); |
| 100 | + _sbss = .; /* Used by the startup in order to initialize the .bss section */ |
| 101 | + *(.bss) |
| 102 | + *(COMMON) |
| 103 | + . = ALIGN(4); |
| 104 | + _ebss = . ; /* Used by the startup in order to initialize the .bss section */ |
| 105 | + } >RAM |
| 106 | + |
| 107 | +PROVIDE ( end = _ebss ); |
| 108 | +PROVIDE ( _end = _ebss ); |
| 109 | + |
| 110 | +/* |
| 111 | + * This is the user stack section |
| 112 | + * This is just to check that there is enough RAM left for the User mode stack |
| 113 | + * It should generate an error if it's full. |
| 114 | + */ |
| 115 | + ._usrstack : |
| 116 | + { |
| 117 | + . = ALIGN(4); |
| 118 | + _susrstack = . ; |
| 119 | + . = . + _Minimum_Stack_Size ; |
| 120 | + . = ALIGN(4); |
| 121 | + _eusrstack = . ; |
| 122 | + } >RAM |
| 123 | + |
| 124 | +/* |
| 125 | + * after that it's only debugging information. |
| 126 | + */ |
| 127 | + |
| 128 | +/* remove the debugging information from the standard libraries */ |
| 129 | +DISCARD : |
| 130 | + { |
| 131 | + libc.a ( * ) |
| 132 | + libm.a ( * ) |
| 133 | + libgcc.a ( * ) |
| 134 | + } |
| 135 | + |
| 136 | +/* Stabs debugging sections. */ |
| 137 | + .stab 0 : { *(.stab) } |
| 138 | + .stabstr 0 : { *(.stabstr) } |
| 139 | + .stab.excl 0 : { *(.stab.excl) } |
| 140 | + .stab.exclstr 0 : { *(.stab.exclstr) } |
| 141 | + .stab.index 0 : { *(.stab.index) } |
| 142 | + .stab.indexstr 0 : { *(.stab.indexstr) } |
| 143 | + .comment 0 : { *(.comment) } |
| 144 | +/* |
| 145 | + * DWARF debug sections. |
| 146 | + * Symbols in the DWARF debugging sections are relative to the beginning |
| 147 | + * of the section so we begin them at 0. |
| 148 | + */ |
| 149 | + |
| 150 | +/* DWARF 1 */ |
| 151 | + .debug 0 : { *(.debug) } |
| 152 | + .line 0 : { *(.line) } |
| 153 | +/* GNU DWARF 1 extensions */ |
| 154 | + .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 155 | + .debug_sfnames 0 : { *(.debug_sfnames) } |
| 156 | +/* DWARF 1.1 and DWARF 2 */ |
| 157 | + .debug_aranges 0 : { *(.debug_aranges) } |
| 158 | + .debug_pubnames 0 : { *(.debug_pubnames) } |
| 159 | +/* DWARF 2 */ |
| 160 | + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
| 161 | + .debug_abbrev 0 : { *(.debug_abbrev) } |
| 162 | + .debug_line 0 : { *(.debug_line) } |
| 163 | + .debug_frame 0 : { *(.debug_frame) } |
| 164 | + .debug_str 0 : { *(.debug_str) } |
| 165 | + .debug_loc 0 : { *(.debug_loc) } |
| 166 | + .debug_macinfo 0 : { *(.debug_macinfo) } |
| 167 | +/* SGI/MIPS DWARF 2 extensions */ |
| 168 | + .debug_weaknames 0 : { *(.debug_weaknames) } |
| 169 | + .debug_funcnames 0 : { *(.debug_funcnames) } |
| 170 | + .debug_typenames 0 : { *(.debug_typenames) } |
| 171 | + .debug_varnames 0 : { *(.debug_varnames) } |
| 172 | +} |
0 commit comments