-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinker.ld
More file actions
43 lines (33 loc) · 770 Bytes
/
linker.ld
File metadata and controls
43 lines (33 loc) · 770 Bytes
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
OUTPUT_ARCH( riscv )
ENTRY( _start )
SECTIONS {
. = 0x80000000;
PROVIDE( __memory_start = . );
PROVIDE( __kernel_start = . );
.text : {
*( .text.proem ) *( .text .text.* )
}
.rodata : {
*( .rodata .rodata.* )
}
.data : {
*( .data .data.* )
/*
This is important. I do not understand why, nor do I care.
https://groups.google.com/a/groups.riscv.org/d/msg/sw-dev/60IdaZj27dY/s1eJMlrUAQAJ
*/
PROVIDE( __global_pointer = . + 0x800 );
}
.bss : {
PROVIDE( __bss_start = . );
*( .bss .bss.* )
. += 512K;
PROVIDE( __stack_top = . );
PROVIDE( __bss_end = . );
}
PROVIDE( __kernel_end = . );
. = ALIGN( 4K );
PROVIDE( __heap_start = . );
. += 256M;
PROVIDE ( __heap_end = . );
}