-
Notifications
You must be signed in to change notification settings - Fork 0
/
linker.ld
51 lines (42 loc) · 886 Bytes
/
linker.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
OUTPUT_ARCH( "riscv" )
MEMORY
{
flash : ORIGIN = 0x20400000, LENGTH = 512K
ram : ORIGIN = 0x80000000, LENGTH = 16K
}
PHDRS
{
text PT_LOAD;
data PT_LOAD;
bss PT_LOAD;
}
ENTRY(_start)
SECTIONS
{
.text : {
PROVIDE(_text_start = .);
*(.text.boot) *(.text .text.*)
PROVIDE(_text_end = .);
} >flash AT>flash :text
.rodata : {
PROVIDE(_rodata_start = .);
*(.rodata .rodata.*)
PROVIDE(_rodata_end = .);
} >flash AT>flash :text
.data : {
. = ALIGN(4096);
PROVIDE(_data_start = .);
*(.sdata .sdata.*) *(.data .data.*)
PROVIDE(_data_end = .);
} >ram AT>ram :data
.bss :{
PROVIDE(_bss_start = .);
*(.sbss .sbss.*) *(.bss .bss.*)
PROVIDE(_bss_end = .);
} >ram AT>ram :bss
.eh_frame (INFO) : {
*(.eh_frame)
}
PROVIDE(_memory_start = ORIGIN(ram));
PROVIDE(_memory_end = ORIGIN(ram) + LENGTH(ram));
}