1212 RAM (xrw) : ORIGIN = 0x20000000 , LENGTH = 0x020000 /* 128 KiB */
1313}
1414
15- ENTRY (Reset_Handler )
16-
1715/* produce a link error if there is not this amount of RAM for these sections */
1816_minimum_stack_size = 2K;
1917_minimum_heap_size = 16K;
@@ -23,114 +21,11 @@ _minimum_heap_size = 16K;
2321 aligned for a call. */
2422_estack = ORIGIN (RAM ) + LENGTH (RAM );
2523
24+ /* define common sections and symbols */
25+ INCLUDE common.ld
26+
2627/* RAM extents for the garbage collector */
28+ _ram_start = ORIGIN (RAM );
2729_ram_end = ORIGIN (RAM ) + LENGTH (RAM );
30+ _heap_start = _ebss; /* heap starts just after statically allocated memory */
2831_heap_end = 0x2001c000 ; /* tunable */
29-
30- /* define output sections */
31- SECTIONS
32- {
33- /* The startup code goes first into FLASH */
34- .isr_vector :
35- {
36- . = ALIGN (4 );
37- KEEP (*(.isr_vector )) /* Startup code */
38-
39- /* This first flash block is 16K annd the isr vectors only take up
40- about 400 bytes. So we pull in a couple of object files to pad it
41- out. */
42-
43- . = ALIGN (4 );
44- */ff.o(.text*)
45- */stm32f4xx_hal_sd.o(.text*)
46-
47- . = ALIGN (4 );
48- } >FLASH_ISR
49-
50- /* The program code and other data goes into FLASH */
51- .text :
52- {
53- . = ALIGN (4 );
54- *(.text *) /* .text* sections (code) */
55- *(.rodata *) /* .rodata* sections (constants, strings, etc.) */
56- /* *(.glue_7) */ /* glue arm to thumb code */
57- /* *(.glue_7t) */ /* glue thumb to arm code */
58-
59- . = ALIGN (4 );
60- _etext = .; /* define a global symbol at end of code */
61- } >FLASH_TEXT
62-
63- /*
64- .ARM.extab :
65- {
66- *(.ARM.extab* .gnu.linkonce.armextab.*)
67- } >FLASH
68-
69- .ARM :
70- {
71- __exidx_start = .;
72- *(.ARM.exidx*)
73- __exidx_end = .;
74- } >FLASH
75- */
76-
77- /* used by the startup to initialize data */
78- _sidata = LOADADDR (.data );
79-
80- /* This is the initialized data section
81- The program executes knowing that the data is in the RAM
82- but the loader puts the initial values in the FLASH (inidata).
83- It is one task of the startup to copy the initial values from FLASH to RAM. */
84- .data :
85- {
86- . = ALIGN (4 );
87- _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
88- _ram_start = .; /* create a global symbol at ram start for garbage collector */
89- *(.data *) /* .data* sections */
90-
91- . = ALIGN (4 );
92- _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
93- } >RAM AT > FLASH_TEXT
94-
95- /* Uninitialized data section */
96- .bss :
97- {
98- . = ALIGN (4 );
99- _sbss = .; /* define a global symbol at bss start; used by startup code */
100- *(.bss *)
101- *(COMMON )
102-
103- . = ALIGN (4 );
104- _ebss = .; /* define a global symbol at bss end; used by startup code and GC */
105- } >RAM
106-
107- /* this is to define the start of the heap, and make sure we have a minimum size */
108- .heap :
109- {
110- . = ALIGN (4 );
111- PROVIDE ( end = . );
112- PROVIDE ( _end = . );
113- _heap_start = .; /* define a global symbol at heap start */
114- . = . + _minimum_heap_size;
115- } >RAM
116-
117- /* this just checks there is enough RAM for the stack */
118- .stack :
119- {
120- . = ALIGN (4 );
121- . = . + _minimum_stack_size;
122- . = ALIGN (4 );
123- } >RAM
124-
125- /* Remove information from the standard libraries */
126- /*
127- /DISCARD/ :
128- {
129- libc.a ( * )
130- libm.a ( * )
131- libgcc.a ( * )
132- }
133- */
134-
135- .ARM .attributes 0 : { *(.ARM .attributes ) }
136- }
0 commit comments