Mcucpp
167 строк · 4.0 Кб
1/**
2* linker script for STM32F10x Medium Density Value Line Devices
3*/
4
5ENTRY(ResetISR)
6
7_Minimum_Stack_Size = 0x400;
8
9MEMORY
10{
11RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
12FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
13}
14
15/* higher address of the user mode stack */
16PROVIDE ( _estack = ALIGN(ORIGIN(RAM) + LENGTH(RAM) - 8 ,8) );
17
18SECTIONS
19{
20.isr_vectors :
21{
22. = ALIGN(4);
23KEEP(*(.isr_vectors))
24. = ALIGN(4);
25} > FLASH
26
27.metadata_section :
28{
29. = ALIGN(8);
30KEEP(*(.crc_section))
31. = ALIGN(8);
32} > FLASH
33
34.text :
35{
36_stext = .;
37__ctors_start__ = .;
38KEEP(SORT(*)(.init_array)) /* eabi uses .init_array for static constructor lists */
39__ctors_end__ = .;
40
41__dtors_start__ = .;
42__dtors_end__ = .;
43
44. = ALIGN(4);
45*(.text) /* remaining code */
46*(.text.*)
47*(.rodata) /* read-only data (constants) */
48*(.rodata*)
49
50*(.eh_frame_hdr)
51*(.eh_frame)
52*(.ARM.extab* .gnu.linkonce.armextab.*)
53*(.gcc_except_table)
54*(.eh_frame_hdr)
55*(.eh_frame)
56
57*(.glue_7)
58*(.glue_7t)
59. = ALIGN(4);
60} > FLASH
61
62/* .ARM.exidx is sorted, so has to go in its own output section. */
63__exidx_start = .;
64.ARM.exidx :
65{
66*(.ARM.exidx* .gnu.linkonce.armexidx.*)
67} > FLASH
68__exidx_end = .;
69
70.text.align :
71{
72. = ALIGN(8);
73_etext = .;
74_sidata = _etext; /* start of initialized data label */
75} > FLASH
76
77.data : AT ( _sidata ) /* AT makes the LMA follow on in the binary image */
78{
79. = ALIGN(4);
80_sdata = .; /* start of .data label */
81KEEP( *(.data) )
82KEEP( *(.data.*) )
83. = ALIGN(4);
84_edata = .; /* end of .data label */
85} > RAM
86
87/* .bss section - uninitialized data */
88.bss :
89{
90. = ALIGN(4);
91_sbss = .; /* start of .bss label (for startup) */
92*(.bss)
93*(.bss.*)
94*(COMMON)
95. = ALIGN(4);
96_ebss = .; /* end of .bss label (for startup) */
97_end = .; /* end of used ram (start of free memory, for malloc) */
98__end = .; /* the same */
99} > RAM
100
101/*
102* This is the user stack section
103* This is just to check that there is enough RAM left for the User mode stack
104* It should generate an error if it's full.
105*/
106._usrstack :
107{
108. = ALIGN(4);
109_susrstack = . ;
110. = . + _Minimum_Stack_Size ;
111. = ALIGN(4);
112_eusrstack = . ;
113} >RAM
114
115
116PROVIDE( _heap = _ebss );
117PROVIDE ( _eheap = ALIGN(ORIGIN(RAM) + LENGTH(RAM) - 8 ,8) );
118
119/*
120* after that it's only debugging information.
121*/
122
123/* remove the debugging information from the standard libraries */
124DISCARD :
125{
126libc.a ( * )
127libm.a ( * )
128libgcc.a ( * )
129}
130
131/* Stabs debugging sections. */
132.stab 0 : { *(.stab) }
133.stabstr 0 : { *(.stabstr) }
134.stab.excl 0 : { *(.stab.excl) }
135.stab.exclstr 0 : { *(.stab.exclstr) }
136.stab.index 0 : { *(.stab.index) }
137.stab.indexstr 0 : { *(.stab.indexstr) }
138.comment 0 : { *(.comment) }
139/*
140* DWARF debug sections.
141* Symbols in the DWARF debugging sections are relative to the beginning
142* of the section so we begin them at 0.
143*/
144
145/* DWARF 1 */
146.debug 0 : { *(.debug) }
147.line 0 : { *(.line) }
148/* GNU DWARF 1 extensions */
149.debug_srcinfo 0 : { *(.debug_srcinfo) }
150.debug_sfnames 0 : { *(.debug_sfnames) }
151/* DWARF 1.1 and DWARF 2 */
152.debug_aranges 0 : { *(.debug_aranges) }
153.debug_pubnames 0 : { *(.debug_pubnames) }
154/* DWARF 2 */
155.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
156.debug_abbrev 0 : { *(.debug_abbrev) }
157.debug_line 0 : { *(.debug_line) }
158.debug_frame 0 : { *(.debug_frame) }
159.debug_str 0 : { *(.debug_str) }
160.debug_loc 0 : { *(.debug_loc) }
161.debug_macinfo 0 : { *(.debug_macinfo) }
162/* SGI/MIPS DWARF 2 extensions */
163.debug_weaknames 0 : { *(.debug_weaknames) }
164.debug_funcnames 0 : { *(.debug_funcnames) }
165.debug_typenames 0 : { *(.debug_typenames) }
166.debug_varnames 0 : { *(.debug_varnames) }
167}
168
169