forked from LdB-ECM/Raspberry-Pi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrpi64.ld
126 lines (115 loc) · 3.84 KB
/
rpi64.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
OUTPUT_ARCH(aarch64)
ENTRY(_start)
SECTIONS
{
/*
* First and formost we need the .init section, containing the code to
* be run first. We allow room for the ATAGs and stack and conform to
* the bootloader's expectation by putting this code at 0x8000.
*/
.init 0x80000 : {
KEEP(*(.init))
}
/*
* Next we put the rest of the code.
*/
.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 rodata .. C/C++ compilers store preset constants here.
*/
.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 align 16 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 the bss data .. C/C++ compilers produce this and needs to be zeroed by startup
*/
.bss : {
. = ALIGN(4);
__bss_start__ = .; /* Label in case we want address of BSS section start */
*(.bss .bss.*)
*(COMMON)
__bss_end__ = .; /* Label in case we want address of BSS section end */
}
.stack_core0 : {
. = ALIGN(16); /* Stack must always be aligned to 16 byte boundary AAPCS64 call standard */
__stack_start_core0__ = .;
. = . + 512; /* EL0 stack size */
__EL0_stack_core0 = .;
. = . + 32768; /* EL1 stack size */
__EL1_stack_core0 = .;
. = . + 512; /* EL2 stack size (start-up) */
__EL2_stack_core0 = .;
__stack_end_core0__ = .;
}
.stack_core1 : {
. = ALIGN(16); /* Stack must always be aligned to 16 byte boundary AAPCS64 call standard */
__stack_start_core1__ = .;
. = . + 512; /* EL0 stack size */
__EL0_stack_core1 = .;
. = . + 1024; /* EL1 stack size */
__EL1_stack_core1 = .;
. = . + 512; /* EL2 stack size (start-up) */
__EL2_stack_core1 = .;
__stack_end_core1__ = .;
}
.stack_core2 : {
. = ALIGN(16); /* Stack must always be aligned to 16 byte boundary AAPCS call standard */
__stack_start_core2__ = .;
. = . + 512; /* EL0 stack size */
__EL0_stack_core2 = .;
. = . + 1024; /* EL1 stack size */
__EL1_stack_core2 = .;
. = . + 512; /* EL2 stack size (start-up) */
__EL2_stack_core2 = .;
__stack_end_core2__ = .;
}
.stack_core3 : {
. = ALIGN(16); /* Stack must always be aligned to 16 byte boundary AAPCS call standard */
__stack_start_core3__ = .;
. = . + 512; /* EL0 stack size */
__EL0_stack_core3 = .;
. = . + 1024; /* EL1 stack size */
__EL1_stack_core3 = .;
. = . + 512; /* EL2 stack size (start-up) */
__EL2_stack_core3 = .;
__stack_end_core3__ = .;
}
.heap : {
. = ALIGN(4);
__heap_start__ = .; /* Label in case we want address of heap section start */
_end = .; PROVIDE (end = .);/* Any memory from here is free to use so this is end of code and start of heap */
}
/*
* Finally comes everything else. A fun trick here is to put all other
* sections into this section, which will be discarded by default.
*/
/DISCARD/ : {
*(*)
}
}