Rename to correct CPU part number.
[bertos.git] / bertos / cpu / cortex-m3 / scripts / stm32f103r8_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  * \author Andrea Righi <arighi@develer.com>
34  *
35  * \brief Script for Olimex STM32-P103 Cortex-M3 board.
36  *
37  */
38
39 SEARCH_DIR(.)
40 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
41 OUTPUT_ARCH(arm)
42
43 /*
44  * Define memory configuration for STM32F103R8 
45  */
46 MEMORY
47 {
48         rom(rx) : org = 0x00000000, len = 128k
49         ram(rwx) : org = 0x20000000, len = 20k
50 }
51
52 /*
53  * Define stack size here
54  */
55 STACK_SIZE = 0x1000;
56
57 /*
58  * Allocate section memory
59  */
60 SECTIONS
61 {
62         .text :
63         {
64                 KEEP(*(.vectors));
65                 . = ALIGN (4);
66                 KEEP(*(.init));
67                 . = ALIGN (4);
68                 *(.rodata .rodata.*);
69                 . = ALIGN (4);
70                 *(.text .text.*);
71                 . = ALIGN (4);
72                 *(.glue_7t);
73                 . = ALIGN(4);
74                 *(.glue_7);
75                 . = ALIGN(4);
76         } > rom
77
78         __text_end = .;
79         PROVIDE (__text_end = .);
80
81         .data : AT (__text_end)
82         {
83                 PROVIDE (__data_start = .);
84                 . = ALIGN (0x400);
85                 *(vtable)
86                 *(.data .data.*)
87                 . = ALIGN (4);
88                 _edata = .;
89                 PROVIDE (__data_end = .);
90         } > ram
91
92         .bss :
93         {
94                 PROVIDE (__bss_start = .);
95                 *(.bss .bss.*)
96                 . = ALIGN(4);
97                 *(COMMON)
98                 . = ALIGN(4);
99                 PROVIDE (__bss_end = .);
100         } > ram
101
102         /*
103          * Allocated stack at the end of bss section.
104          * Data heap is allocate at end of stack.
105          */
106         PROVIDE (__msp_start = .);
107         . = ALIGN(8);
108         . += STACK_SIZE;
109         PROVIDE (__msp_end = .);
110
111         PROVIDE (__psp_start = .);
112         . = ALIGN(8);
113         . += STACK_SIZE;
114         PROVIDE (__psp_end = .);
115
116         PROVIDE (__heap_start = .);
117         . = ALIGN(8);
118 }