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