-
Notifications
You must be signed in to change notification settings - Fork 1
/
linker.ld
executable file
·49 lines (37 loc) · 1.08 KB
/
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
ENTRY (loader)
kernel_load_address = 0x100000;
MEMORY { kernel_phy_address_space : ORIGIN = 0xC00000, LENGTH = 0x200000 }
MEMORY { kernel_address_space : ORIGIN = 0xC0000000, LENGTH = 0x200000 }
SECTIONS{
/*kernel_phy_address_space*/
.text_1 :{
loader.o(.text)
}>kernel_phy_address_space
.rodata_1 :{
loader.o(.rodata)
}>kernel_phy_address_space
.data_1 :{
loader.o(.data)
}>kernel_phy_address_space
.bss_1 :{
loader.o(.bss)
}>kernel_phy_address_space
/* kernel address space */
.text :AT(kernel_load_address){
text = .;
loader.o(.multiboot)
*(EXCLUDE_FILE (loader.o).text)
}>kernel_address_space
.rodata :AT(kernel_load_address + (rodata - text)){
rodata = .;
*(EXCLUDE_FILE (loader.o).rodata)
}>kernel_address_space
.data :AT(kernel_load_address +(data - text)){
data = .;
*(EXCLUDE_FILE (loader.o) .data)
}>kernel_address_space
.bss :AT(kernel_load_address + (bss - text)){
bss = .;
*(EXCLUDE_FILE (loader.o) .bss)
}>kernel_address_space
}