-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpi32.ld
162 lines (147 loc) · 5.02 KB
/
rpi32.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
OUTPUT_ARCH(arm)
ENTRY(_start)
ENTRY(_start)
SECTIONS {
/*
* Our init section allows us to place the bootstrap code at address 0x8000
*
* This is where the Graphics processor forces the ARM to start execution.
* However the interrupt vector code remains at 0x0000, and so we must copy the correct
* branch instructions to 0x0000 - 0x001C in order to get the processor to handle interrupts.
*
*/
.init 0x8000 : {
KEEP(*(.init))
}
.module_entries : {
__module_entries_start = .;
KEEP(*(.module_entries))
KEEP(*(.module_entries.*))
__module_entries_end = .;
__module_entries_size = SIZEOF(.module_entries);
}
/**
* This is the main code section, it is essentially of unlimited size. (128Mb).
*
**/
.text : {
. = ALIGN(4);
__text_start__ = .; /* Label in case we want address of text section start */
*(.text .text.*)
__text_end__ = .; /* Label in case we want address of text section end */
}
/*
* Next we put the read only data.
*/
.rodata : {
. = ALIGN(4);
__rodata_start__ = .; /* Label in case we want address of rodata section start */
*(.rodata .rodata.*)
__rodata_end__ = .; /* Label in case we want address of rodata section start */
}
/*
* Next we put the data.
*/
.data : {
. = ALIGN(4);
__data_start__ = .; /* Label in case we want address of data section start */
*(.data .data.*)
__data_end__ = .; /* Label in case we want address of data section end */
}
/*
* Next we put the data1 .. 16 byte aligned data.
*/
.data1 : {
. = ALIGN(16);
__data1_start__ = .; /* Label in case we want address of data section start */
*(.data1 .data1.*)
__data1_end__ = .; /* Label in case we want address of data section end */
}
/*
* Next we put stack for Core0
*/
.stack0 : {
. = ALIGN(8); /* Stack must always be aligned to 8 byte boundary AAPCS32 call standard */
__stack_start__core0 = .; /* Label in case we want address of stack core 0 section start */
. = . + 512; /* IRQ stack size core 0 */
__IRQ_stack_core0 = .;
. = . + 512; /* FIQ stack size core 0 */
__FIQ_stack_core0 = .;
. = . + 32768; /* SVC stack size core 0 */
__SVC_stack_core0 = .;
. = . + 32768; /* SYS stack size core 0 */
__SYS_stack_core0 = .;
__stack_end__core0 = .; /* Label in case we want address of stack core 0 section end */
}
/*
* Next we put stack for Core1
*/
.stack1 : {
. = ALIGN(8); /* Stack must always be aligned to 8 byte boundary AAPCS32 call standard */
__stack_start__core1 = .; /* Label in case we want address of stack core 1 section start */
. = . + 512; /* IRQ stack size core 1 */
__IRQ_stack_core1 = .;
. = . + 512; /* FIQ stack size core 1 */
__FIQ_stack_core1 = .;
. = . + 512; /* SVC stack size core 1 */
__SVC_stack_core1 = .;
. = . + 512; /* SYS stack size core 1 */
__SYS_stack_core1 = .;
__stack_end__core1 = .; /* Label in case we want address of stack core 1 section end */
}
/*
* Next we put stack for Core2
*/
.stack2 : {
. = ALIGN(8); /* Stack must always be aligned to 8 byte boundary AAPCS32 call standard */
__stack_start__core2 = .; /* Label in case we want address of stack core 2 section start */
. = . + 512; /* IRQ stack size core 2 */
__IRQ_stack_core2 = .;
. = . + 512; /* FIQ stack size core 2 */
__FIQ_stack_core2 = .;
. = . + 512; /* SVC stack size core 2 */
__SVC_stack_core2 = .;
. = . + 512; /* SYS stack size core 2 */
__SYS_stack_core2 = .;
__stack_end__core2 = .; /* Label in case we want address of stack core 2 section end */
}
/*
* Next we put stack for Core3
*/
.stack3 : {
. = ALIGN(8); /* Stack must always be aligned to 8 byte boundary AAPCS32 call standard */
__stack_start__core3 = .; /* Label in case we want address of stack core 3 section start */
. = . + 1024; /* IRQ stack size core 3 */
__IRQ_stack_core3 = .;
. = . + 1024; /* FIQ stack size core 3 */
__FIQ_stack_core3 = .;
. = . + 32768; /* SVC stack size core 3 */
__SVC_stack_core3 = .;
. = . + 32768; /* SYS stack size core 3 */
__SYS_stack_core3 = .;
__stack_end__core3 = .; /* Label in case we want address of stack core 3 section end */
}
.bss :
{
. = ALIGN(4);
__bss_start = .;
*(.bss .bss.*)
__bss_end = .;
}
/**
* Place HEAP here???
**/
/**
* Stack starts at the top of the RAM, and moves down!
**/
. = ALIGN(8); /* Stack must always be aligned to 8 byte boundary AAPCS32 call standard */
. = . + 65536;
_estack = .;
/*
* Finally comes everything else. A fun trick here is to put all other
* sections into this section, which will be discarded by default.
*/
/DISCARD/ : {
*(*)
}
}