-
Notifications
You must be signed in to change notification settings - Fork 0
/
linker.ld
92 lines (66 loc) · 1.16 KB
/
linker.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
MEMORY
{
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K
flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K
}
_stack_size = 2K;
_flash_start = ORIGIN(flash);
_flash_size = LENGTH(flash);
ENTRY(Reset_Handler)
SECTIONS
{
.text :
{
_text_start = .;
KEEP(*(.vector_table))
. = ALIGN(4);
*(.text*)
. = ALIGN(4);
_text_end = .;
} > flash
.rodata :
{
. = ALIGN(4);
*(.rodata*)
. = ALIGN(4);
} > flash
.stack :
{
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _stack_size;
_end_of_stack = .;
} > ram
.rtt :
{
KEEP(*(.rtt))
. = ALIGN(4);
} > ram
_data_start_in_flash = LOADADDR(.data);
.data :
{
. = ALIGN(4);
_data_start_in_ram = .;
*(.data*)
. = ALIGN(4);
_data_end_in_ram = .;
} > ram AT > flash
. = ALIGN(4);
.bss (NOLOAD) :
{
_bss_start = .;
*(.bss*)
*(COMMON)
. = ALIGN(4);
_bss_end = .;
} > ram
/DISCARD/ :
{
*(.ARM.exidx)
*(.init)
*(.fini)
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
}