-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout.ld
63 lines (53 loc) · 1.1 KB
/
layout.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
MEMORY
{
FLASH : ORIGIN = 0x08000000, LENGTH = 512K
RAM : ORIGIN = 0x20000000, LENGTH = 64K
}
panic_str_size = 512;
stack_size = 1024;
/* INCLUDE linker/cm3.ld */
SECTIONS
{
.isr_vector ORIGIN(FLASH) : {
LONG(ORIGIN(RAM) + LENGTH(RAM))
KEEP(*(.text.exceptions*))
KEEP(*(.text.isr*))
} > FLASH
.text : {
*(.text*)
} > FLASH
.rodata : {
*(.rodata*)
idata_from = .;
} > FLASH
.panic_fmt ORIGIN(RAM) : {
. = ALIGN(. + panic_str_size, 4);
} > RAM
.data : AT(idata_from) {
idata_to = .;
*(.data*)
} > RAM
idata_size = SIZEOF(.data);
.bss : {
bss_start = .;
*(.bss*)
} > RAM
bss_size = SIZEOF(.bss);
heap_size = LENGTH(RAM) - idata_size - panic_str_size - stack_size - bss_size;
.heap : {
heap_start = .;
. = . + heap_size;
} > RAM = 0xAAAAAAAA
stack_start = ALIGN(stack_end - (stack_size + 7), 8);
stack_end = ORIGIN(RAM) + LENGTH(RAM);
.stack stack_start : {
. = . + stack_size;
} > RAM = 0x55555555
/DISCARD/ :
{
*(.note.gnu.build-id*)
*(.ARM.attributes*)
*(.ARM.extab*)
*(.ARM.exidx*)
}
}