Sie sind auf Seite 1von 4

LinkerScript.

ld

1 /*
2 ******************************************************************************
3 **
4 ** File : LinkerScript.ld
5 **
6 ** Author : Auto-generated by Ac6 System Workbench
7 **
8 ** Abstract : Linker script for STM32F401RETx Device from STM32F4 series
9 ** 96Kbytes RAM
10 ** 512Kbytes ROM
11 **
12 ** Set heap size, stack size and stack location according
13 ** to application requirements.
14 **
15 ** Set memory bank area and size if external memory is used.
16 **
17 ** Target : STMicroelectronics STM32
18 **
19 ** Distribution: The file is distributed �as is,� without any warranty
20 ** of any kind.
21 **
22 *****************************************************************************
23 ** @attention
24 **
25 ** <h2><center>&copy; COPYRIGHT(c) 2018 Ac6</center></h2>
26 **
27 ** Redistribution and use in source and binary forms, with or without modification,
28 ** are permitted provided that the following conditions are met:
29 ** 1. Redistributions of source code must retain the above copyright notice,
30 ** this list of conditions and the following disclaimer.
31 ** 2. Redistributions in binary form must reproduce the above copyright notice,
32 ** this list of conditions and the following disclaimer in the documentation
33 ** and/or other materials provided with the distribution.
34 ** 3. Neither the name of Ac6 nor the names of its contributors
35 ** may be used to endorse or promote products derived from this software
36 ** without specific prior written permission.
37 **
38 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
39 ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
42 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
43 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
44 ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
45 ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46 ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
47 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48 **
49 *****************************************************************************
50 */
51
52 /* Entry Point */
53 ENTRY(Reset_Handler)
54
55 /* Highest address of the user mode stack */
56 _estack = 0x20018000; /* end of RAM */
57
58 _Min_Heap_Size = 0; /* required amount of heap */
59 _Min_Stack_Size = 0x400; /* required amount of stack */
60
61 /* Memories definition */
62 MEMORY

Page 1
LinkerScript.ld

63 {
64 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
65 ROM (rx) : ORIGIN = 0x8000000, LENGTH = 512K
66 }
67
68 /* Sections */
69 SECTIONS
70 {
71 /* The startup code into ROM memory */
72 .isr_vector :
73 {
74 . = ALIGN(4);
75 KEEP(*(.isr_vector)) /* Startup code */
76 . = ALIGN(4);
77 } >ROM
78
79 /* The program code and other data into ROM memory */
80 .text :
81 {
82 . = ALIGN(4);
83 *(.text) /* .text sections (code) */
84 *(.text*) /* .text* sections (code) */
85 *(.glue_7) /* glue arm to thumb code */
86 *(.glue_7t) /* glue thumb to arm code */
87 *(.eh_frame)
88
89 KEEP (*(.init))
90 KEEP (*(.fini))
91
92 . = ALIGN(4);
93 _etext = .; /* define a global symbols at end of code */
94 } >ROM
95
96 /* Constant data into ROM memory*/
97 .rodata :
98 {
99 . = ALIGN(4);
100 *(.rodata) /* .rodata sections (constants, strings, etc.) */
101 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
102 . = ALIGN(4);
103 } >ROM
104
105 .ARM.extab : {
106 . = ALIGN(4);
107 *(.ARM.extab* .gnu.linkonce.armextab.*)
108 . = ALIGN(4);
109 } >ROM
110
111 .ARM : {
112 . = ALIGN(4);
113 __exidx_start = .;
114 *(.ARM.exidx*)
115 __exidx_end = .;
116 . = ALIGN(4);
117 } >ROM
118
119 .preinit_array :
120 {
121 . = ALIGN(4);
122 PROVIDE_HIDDEN (__preinit_array_start = .);
123 KEEP (*(.preinit_array*))
124 PROVIDE_HIDDEN (__preinit_array_end = .);

Page 2
LinkerScript.ld

125 . = ALIGN(4);
126 } >ROM
127
128 .init_array :
129 {
130 . = ALIGN(4);
131 PROVIDE_HIDDEN (__init_array_start = .);
132 KEEP (*(SORT(.init_array.*)))
133 KEEP (*(.init_array*))
134 PROVIDE_HIDDEN (__init_array_end = .);
135 . = ALIGN(4);
136 } >ROM
137
138 .fini_array :
139 {
140 . = ALIGN(4);
141 PROVIDE_HIDDEN (__fini_array_start = .);
142 KEEP (*(SORT(.fini_array.*)))
143 KEEP (*(.fini_array*))
144 PROVIDE_HIDDEN (__fini_array_end = .);
145 . = ALIGN(4);
146 } >ROM
147
148 /* Used by the startup to initialize data */
149 _sidata = LOADADDR(.data);
150
151 /* Initialized data sections into RAM memory */
152 .data :
153 {
154 . = ALIGN(4);
155 _sdata = .; /* create a global symbol at data start */
156 *(.data) /* .data sections */
157 *(.data*) /* .data* sections */
158
159 . = ALIGN(4);
160 _edata = .; /* define a global symbol at data end */
161 } >RAM AT> ROM
162
163
164 /* Uninitialized data section into RAM memory */
165 . = ALIGN(4);
166 .bss :
167 {
168 /* This is used by the startup in order to initialize the .bss secion */
169 _sbss = .; /* define a global symbol at bss start */
170 __bss_start__ = _sbss;
171 *(.bss)
172 *(.bss*)
173 *(COMMON)
174
175 . = ALIGN(4);
176 _ebss = .; /* define a global symbol at bss end */
177 __bss_end__ = _ebss;
178 } >RAM
179
180 /* User_heap_stack section, used to check that there is enough RAM left */
181 ._user_heap_stack :
182 {
183 . = ALIGN(8);
184 PROVIDE ( end = . );
185 PROVIDE ( _end = . );
186 . = . + _Min_Heap_Size;

Page 3
LinkerScript.ld

187 . = . + _Min_Stack_Size;
188 . = ALIGN(8);
189 } >RAM
190
191
192
193 /* Remove information from the compiler libraries */
194 /DISCARD/ :
195 {
196 libc.a ( * )
197 libm.a ( * )
198 libgcc.a ( * )
199 }
200
201 .ARM.attributes 0 : { *(.ARM.attributes) }
202 }
203

Page 4

Das könnte Ihnen auch gefallen