-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinker.ld
49 lines (42 loc) · 969 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
OUTPUT_ARCH( "riscv" )
ENTRY( _start )
MEMORY
{
ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 128M
}
PHDRS
{
text PT_LOAD;
data PT_LOAD;
bss PT_LOAD;
}
SECTIONS
{
.text : {
PROVIDE(__text_start = .);
*(.text.init) *(.text .text.*)
PROVIDE(__text_end = .);
} >ram AT>ram :text
PROVIDE(__global_pointer = .);
.rodata : {
PROVIDE(__rodata_start = .);
*(.rodata .rodata.*)
PROVIDE(__rodata_end = .);
} >ram AT>ram :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
PROVIDE(__memory_start = ORIGIN(ram));
PROVIDE(__stack = __bss_end + 0x80000);
PROVIDE(__memory_end = ORIGIN(ram) + LENGTH(ram));
PROVIDE(__heap_start = __stack);
PROVIDE(__heap_size = __memory_end - __stack);
}