-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinker.ld
47 lines (40 loc) · 883 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
OUTPUT_ARCH("riscv");
ENTRY(_entry);
SECTIONS
{
. = 0x80000000;
.text : {
*(.text.entry);
*(.text .text.*);
. = ALIGN(0x1000);
PROVIDE(_trampoline = .);
*(trampsec)
. = ALIGN(0x1000);
ASSERT(. - _trampoline == 0x1000, "error: trampoline larger than one page");
PROVIDE(_etext = .);
}
. = ALIGN(0x1000);
.rodata : {
. = ALIGN(16);
*(.srodata .srodata.*) /* do not need to distinguish this from .rodata */
. = ALIGN(16);
*(.rodata .rodata.*)
}
.data : {
. = ALIGN(16);
_sdata = .;
*(.sdata .sdata.*) /* do not need to distinguish this from .data */
. = ALIGN(16);
*(.data .data.*)
_edata = .;
}
.bss : {
. = ALIGN(16);
_sbss = .;
*(.sbss .sbss.*) /* do not need to distinguish this from .bss */
. = ALIGN(16);
*(.bss .bss.*)
_ebss = .;
}
PROVIDE(_END = .);
};