2 * Default linker script for GCC CEC1302
\r
3 * Based upon linker scripts from GNU ARM Eclipse plug-in
\r
7 __SRAM_segment_end__ = ORIGIN( RAM ) + LENGTH( RAM );
\r
10 * The '__stack' definition is required by crt0, do not remove it.
\r
12 /* Place top of stack immediate before ROM Log
\r
13 *__stack = ORIGIN(RAM) + LENGTH(RAM);
\r
15 __stack = ORIGIN(RAM) + LENGTH(RAM);
\r
20 * Default stack sizes.
\r
21 * These are used by the startup in order to allocate stacks
\r
22 * for the different modes.
\r
25 __Main_Stack_Size = 2048 ;
\r
27 PROVIDE ( _Main_Stack_Size = __Main_Stack_Size ) ;
\r
29 __Main_Stack_Limit = __stack - __Main_Stack_Size ;
\r
31 /*"PROVIDE" allows to easily override these values from an object file or the command line. */
\r
32 PROVIDE ( _Main_Stack_Limit = __Main_Stack_Limit ) ;
\r
35 * There will be a link error if there is not this amount of
\r
36 * RAM free at the end.
\r
38 _Minimum_Stack_Size = 1024 ;
\r
41 * Default heap definitions.
\r
42 * The heap start immediately after the last statically allocated
\r
43 * .sbss/.noinit section, and extends up to the main stack limit.
\r
45 PROVIDE ( _Heap_Begin = _end_noinit ) ;
\r
46 PROVIDE ( _Heap_Limit = __stack - __Main_Stack_Size ) ;
\r
49 * The entry point is informative, for debuggers and simulators,
\r
50 * since the Cortex-M vector points to it anyway.
\r
54 /* Sections Definitions */
\r
59 * For Cortex-M devices, the beginning of the startup code is stored in
\r
60 * the .isr_vector section, which goes to ROM
\r
67 KEEP(*(.isr_vector))
\r
77 * This section is here for convenience, to store the
\r
78 * startup code at the beginning of the flash area, hoping that
\r
79 * this will increase the readability of the listing.
\r
81 KEEP(*(.after_vectors .after_vectors.*)) /* Startup code and ISR */
\r
86 * These are the old initialisation sections, intended to contain
\r
87 * naked code, with the prologue/epilogue added by crti.o/crtn.o
\r
88 * when linking with startup files. The standalone startup code
\r
89 * currently does not run these, better use the init arrays below.
\r
97 * The preinit code, i.e. an array of pointers to initialisation
\r
98 * functions to be performed before constructors.
\r
100 PROVIDE_HIDDEN (__preinit_array_start = .);
\r
103 * Used to run the SystemInit() before anything else.
\r
105 KEEP(*(.preinit_array_sysinit .preinit_array_sysinit.*))
\r
108 * Used for other platform inits.
\r
110 KEEP(*(.preinit_array_platform .preinit_array_platform.*))
\r
113 * The application inits. If you need to enforce some order in
\r
114 * execution, create new sections, as before.
\r
116 KEEP(*(.preinit_array .preinit_array.*))
\r
118 PROVIDE_HIDDEN (__preinit_array_end = .);
\r
123 * The init code, i.e. an array of pointers to static constructors.
\r
125 PROVIDE_HIDDEN (__init_array_start = .);
\r
126 KEEP(*(SORT(.init_array.*)))
\r
127 KEEP(*(.init_array))
\r
128 PROVIDE_HIDDEN (__init_array_end = .);
\r
133 * The fini code, i.e. an array of pointers to static destructors.
\r
135 PROVIDE_HIDDEN (__fini_array_start = .);
\r
136 KEEP(*(SORT(.fini_array.*)))
\r
137 KEEP(*(.fini_array))
\r
138 PROVIDE_HIDDEN (__fini_array_end = .);
\r
143 *(.text*) /* all remaining code */
\r
145 *(vtable) /* C++ virtual tables */
\r
151 *(.rodata*) /* read-only data (constants) */
\r
156 KEEP(*(.eh_frame*))
\r
159 * Stub sections generated by the linker, to glue together
\r
160 * ARM and Thumb code. .glue_7 is used for ARM code calling
\r
161 * Thumb code, and .glue_7t is used for Thumb code calling
\r
162 * ARM code. Apparently always generated by the linker, for some
\r
163 * architectures, so better leave them here.
\r
169 /* ARM magic sections */
\r
172 *(.ARM.extab* .gnu.linkonce.armextab.*)
\r
178 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
\r
187 * This address is used by the startup code to
\r
188 * initialise the .data section.
\r
196 *(.ROarraySection .ROarraySection.*)
\r
200 * The initialised data section.
\r
201 * The program executes knowing that the data is in the RAM
\r
202 * but the loader puts the initial values in the ROM (inidata).
\r
203 * It is one task of the startup to copy the initial values from
\r
206 .data : AT ( _sidata )
\r
210 /* This is used by the startup code to initialise the .data section */
\r
211 _sdata = . ; /* STM specific definition */
\r
212 __data_start__ = . ;
\r
213 *(.data_begin .data_begin.*)
\r
217 *(.data_end .data_end.*)
\r
220 /* This is used by the startup code to initialise the .data section */
\r
221 _edata = . ; /* STM specific definition */
\r
228 * The uninitialised data section. NOLOAD is used to avoid
\r
229 * the "section `.bss' type changed to PROGBITS" warning
\r
234 __bss_start__ = .; /* standard newlib definition */
\r
235 _sbss = .; /* STM specific definition */
\r
236 *(.bss_begin .bss_begin.*)
\r
241 *(.bss_end .bss_end.*)
\r
243 __bss_end__ = .; /* standard newlib definition */
\r
244 _ebss = . ; /* STM specific definition */
\r
252 *(.noinit .noinit.*)
\r
258 /* Mandatory to be word aligned, _sbrk assumes this */
\r
259 PROVIDE ( end = _end_noinit ); /* was _ebss */
\r
260 PROVIDE ( _end = _end_noinit );
\r
261 PROVIDE ( __end = _end_noinit );
\r
262 PROVIDE ( __end__ = _end_noinit );
\r
263 PROVIDE ( ROM_DATA_START = __data_start__ );
\r
266 * Used for validation only, do not allocate anything here!
\r
268 * This is just to check that there is enough RAM left for the Main
\r
269 * stack. It should generate an error if it's full.
\r
275 . = . + _Minimum_Stack_Size ;
\r
284 /* . = . + __ROM_Log_Size ; */
\r
290 .bss_CCMRAM : ALIGN(4)
\r
292 *(.bss.CCMRAM .bss.CCMRAM.*)
\r
297 * The C or assembly source must explicitly place the code
\r
298 * or data there using the "section" attribute.
\r
302 /* remaining code */
\r
303 /* read-only data (constants) */
\r
314 * The C or assembly source must explicitly place the code or data there
\r
315 * using the "section" attribute.
\r
355 /* After that there are only debugging sections. */
\r
357 /* This can remove the debugging information from the standard libraries */
\r
367 /* Stabs debugging sections. */
\r
368 .stab 0 : { *(.stab) }
\r
369 .stabstr 0 : { *(.stabstr) }
\r
370 .stab.excl 0 : { *(.stab.excl) }
\r
371 .stab.exclstr 0 : { *(.stab.exclstr) }
\r
372 .stab.index 0 : { *(.stab.index) }
\r
373 .stab.indexstr 0 : { *(.stab.indexstr) }
\r
374 .comment 0 : { *(.comment) }
\r
376 * DWARF debug sections.
\r
377 * Symbols in the DWARF debugging sections are relative to the beginning
\r
378 * of the section so we begin them at 0.
\r
381 .debug 0 : { *(.debug) }
\r
382 .line 0 : { *(.line) }
\r
383 /* GNU DWARF 1 extensions */
\r
384 .debug_srcinfo 0 : { *(.debug_srcinfo) }
\r
385 .debug_sfnames 0 : { *(.debug_sfnames) }
\r
386 /* DWARF 1.1 and DWARF 2 */
\r
387 .debug_aranges 0 : { *(.debug_aranges) }
\r
388 .debug_pubnames 0 : { *(.debug_pubnames) }
\r
390 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
\r
391 .debug_abbrev 0 : { *(.debug_abbrev) }
\r
392 .debug_line 0 : { *(.debug_line) }
\r
393 .debug_frame 0 : { *(.debug_frame) }
\r
394 .debug_str 0 : { *(.debug_str) }
\r
395 .debug_loc 0 : { *(.debug_loc) }
\r
396 .debug_macinfo 0 : { *(.debug_macinfo) }
\r
397 /* SGI/MIPS DWARF 2 extensions */
\r
398 .debug_weaknames 0 : { *(.debug_weaknames) }
\r
399 .debug_funcnames 0 : { *(.debug_funcnames) }
\r
400 .debug_typenames 0 : { *(.debug_typenames) }
\r
401 .debug_varnames 0 : { *(.debug_varnames) }
\r