Trailing whitespace
[bertos.git] / bertos / cpu / cortex-m3 / scripts / cortex-m3_rom.ld
1 /**
2  * \file
3  * <!--
4  * This file is part of BeRTOS.
5  *
6  * Bertos is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * As a special exception, you may use this file as part of a free software
21  * library without restriction.  Specifically, if other files instantiate
22  * templates or use macros or inline functions from this file, or you compile
23  * this file and link it with other files to produce an executable, this
24  * file does not by itself cause the resulting executable to be covered by
25  * the GNU General Public License.  This exception does not however
26  * invalidate any other reasons why the executable file might be covered by
27  * the GNU General Public License.
28  *
29  * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \brief Script Cortex M3 family processors.
34  *
35  * \author Daniele Basile <asterix@develer.com>
36  */
37
38 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
39 OUTPUT_ARCH(arm)
40
41
42 /*
43  * Allocate section memory
44  */
45 SECTIONS
46 {
47         .text :
48         {
49                 KEEP(*(.vectors));
50                 . = ALIGN (4);
51                 KEEP(*(.init));
52                 . = ALIGN (4);
53                 *(.rodata .rodata.*);
54                 . = ALIGN (4);
55                 *(.text .text.*);
56                 . = ALIGN (4);
57                 *(.glue_7t);
58                 . = ALIGN(4);
59                 *(.glue_7);
60                 . = ALIGN(4);
61         } > rom
62
63         __text_end = .;
64         PROVIDE (__text_end = .);
65
66         .data : AT (__text_end)
67         {
68                 . = ALIGN (0x400);
69                 PROVIDE (__data_start = .);
70                 *(vtable)
71                 . = ALIGN (4);
72                 *(.ramfunc)
73                 . = ALIGN (4);
74                 *(.data .data.*)
75                 . = ALIGN (4);
76                 _edata = .;
77                 PROVIDE (__data_end = .);
78         } > ram
79
80         .bss :
81         {
82                 PROVIDE (__bss_start = .);
83                 *(.bss .bss.*)
84                 . = ALIGN(4);
85                 *(COMMON)
86                 . = ALIGN(4);
87                 PROVIDE (__bss_end = .);
88         } > ram
89
90         /*
91          * Allocated stack at the end of bss section.
92          * Data heap is allocate at end of stack.
93          * STACK_SIZE variable is defined in the CPU specific linker script file.
94          */
95         PROVIDE (__msp_start = .);
96         . = ALIGN(8);
97         . += STACK_SIZE;
98         PROVIDE (__msp_end = .);
99
100         PROVIDE (__psp_start = .);
101         . = ALIGN(8);
102         . += STACK_SIZE;
103         PROVIDE (__psp_end = .);
104
105         PROVIDE (__heap_start = .);
106         . = ALIGN(8);
107 }