-
Notifications
You must be signed in to change notification settings - Fork 61
/
piko.lds.S
96 lines (78 loc) · 2.26 KB
/
piko.lds.S
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
93
94
95
96
OUTPUT_FORMAT("elf32-littlearm")
OUTPUT_ARCH(arm)
#define RAMORG 0x20000000
MEMORY
{
rom (rx) : ORIGIN = 0, LENGTH = ROMSZ
ram (rwx) : ORIGIN = RAMORG, LENGTH = RAMSZ
}
SECTIONS
{
.vector 0 : {
PROVIDE(__vector_start__ = .);
KEEP(*(.vector))
} > rom
.text BLOCK(8) : {
PROVIDE(__text_start__ = .);
*(.text*)
PROVIDE(__text_end__ = .);
. = ALIGN(8);
PROVIDE(__shell_cmd_start__ = .);
KEEP(*(.shell_cmd*))
PROVIDE(__shell_cmd_end__ = .);
PROVIDE(__sched_classes_start__ = .);
KEEP(*(.sched.class*))
PROVIDE(__sched_classes_end__ = .);
PROVIDE(__serial_hook_start__ = .);
KEEP(*(.serial.hook*))
PROVIDE(__serial_hook_end__ = .);
PROVIDE(__rodata_start__ = .);
*(.rodata*)
PROVIDE(__rodata_end__ = .);
} > rom
/* Initialized data (.data* sections) are initially stored in Flash,
but need to be copied to a volatile storage for they are not
read-only. */
.data : AT (__rodata_end__) {
PROVIDE(__data_start__ = .);
*(.data*)
PROVIDE(__data_end__ = .);
} > ram
PROVIDE(__data_size__ = SIZEOF(.data));
.bss : {
PROVIDE(__bss_start__ = .);
*(.bss*)
*(COMMON)
PROVIDE(__bss_end__ = .);
} > ram
PROVIDE(__bss_size__ = SIZEOF(.bss));
/* heap for the kernel's malloc */
.heap BLOCK(32) : {
PROVIDE(__heap_start__ = .);
. += 4k;
PROVIDE(__heap_end__ = .);
} > ram
PROVIDE(__heap_size__ = SIZEOF(.heap));
.pgmem RAMORG + RAMSZ - 32k : {
PROVIDE(__pgmem_start__ = .);
. += 26k;
/* Reserve the last page for the early stack. Must be of the biggest size
* such that there will be no coalescing when freeing the page, for lower
* booting time. */
PROVIDE(__early_stack_end__ = .);
. += 2k;
PROVIDE(__early_stack_start__ = .);
PROVIDE(__pgmem_end__ = .);
} > ram
PROVIDE(__pgmem_size__ = SIZEOF(.pgmem));
.mtdram : {
PROVIDE(__mtdram_start__ = .);
. += 4k;
} > ram
PROVIDE(__mtdram_size__ = SIZEOF(.mtdram));
/DISCARD/ :
{
*(.ARM.exidx)
*(.ARM.attributes)
}
}