Refactor to use new protocol module and sipo.
[bertos.git] / bertos / cpu / cortex-m3 / scripts / cortex-m3_ram.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 2008 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \author Manuele Fanelli <qwert@develer.com>
34  *
35  * \brief Script for Cortex M3 family processors.
36  *
37  */
38
39 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
40 OUTPUT_ARCH(arm)
41
42
43 /*
44  * Allocate section memory
45  */
46 SECTIONS
47 {
48         .text :
49         {
50                 KEEP(*(.vectors));
51                 . = ALIGN (4);
52                 KEEP(*(.init));
53                 . = ALIGN (4);
54                 *(.rodata .rodata.*);
55                 . = ALIGN (4);
56                 *(.text .text.*);
57                 . = ALIGN (4);
58                 *(.glue_7t);
59                 . = ALIGN(4);
60                 *(.glue_7);
61                 . = ALIGN(4);
62         } > ram
63
64         __text_end = .;
65         PROVIDE (__text_end = .);
66
67         .data : AT (__text_end)
68         {
69                 . = ALIGN (0x400);
70                 PROVIDE (__data_start = .);
71                 *(vtable)
72                 *(.data .data.*)
73                 . = ALIGN (4);
74                 _edata = .;
75                 PROVIDE (__data_end = .);
76         } > ram
77
78         .bss :
79         {
80                 PROVIDE (__bss_start = .);
81                 *(.bss .bss.*)
82                 . = ALIGN(4);
83                 *(COMMON)
84                 . = ALIGN(4);
85                 PROVIDE (__bss_end = .);
86         } > ram
87
88         /*
89          * Allocated stack at the end of bss section.
90          * Data heap is allocate at end of stack.
91          * STACK_SIZE variable is defined in the CPU specific linker script file.
92          */
93         PROVIDE (__msp_start = .);
94         . = ALIGN(8);
95         . += STACK_SIZE;
96         PROVIDE (__msp_end = .);
97
98         PROVIDE (__psp_start = .);
99         . = ALIGN(8);
100         . += STACK_SIZE;
101         PROVIDE (__psp_end = .);
102
103         PROVIDE (__heap_start = .);
104         . = ALIGN(8);
105 }
106