-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstm32f103.ld
executable file
·75 lines (65 loc) · 1.21 KB
/
stm32f103.ld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* @target: armv7-m3
* @author: Sagar Ladla [sagarladla@gmail.com]
* @file: stm32f103.ld
* @brief: STM32F103C8T6 microcontroller linker script file.
* This program handles:
* - set FLASH memory from 0x08000000 address with 64KB space
* - set SRAM memory from 0x20000000 address with 20KB space
* - define sections of memory
*/
ENTRY(isr_reset)
MEMORY
{
flash(rx) : ORIGIN = 0x08000000, LENGTH = 64K,
sram(rwx) : ORIGIN = 0x20000000, LENGTH = 20K
}
_eram = ORIGIN(sram) + LENGTH(sram);
_stack = _eram;
SECTIONS
{
.ivt : ALIGN(0x4)
{
KEEP(*(.ivt))
. = ALIGN(0x4);
} > flash
.text : ALIGN(0x4)
{
*(.text*)
. = ALIGN(4);
PROVIDE(_etext = .);
} > flash
.rodata : ALIGN(0x4)
{
*(.rodata*)
. = ALIGN(0x4);
} > flash
.init_array : ALIGN(0x4)
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(0x04);
} > flash
_idata = LOADADDR(.data);
.data : ALIGN(0x4)
{
PROVIDE(_data = .);
*(.data*)
. = ALIGN(4);
PROVIDE(_edata = .);
} > sram AT > flash
.bss : ALIGN(0x4)
{
PROVIDE(_bss = .);
*(.bss*)
. = ALIGN(4);
PROVIDE(_ebss = .);
} > sram
/DISCARD/ :
{
libc.a(*)
libm.a(*)
libgcc.a(*)
}
}