-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink.ld
More file actions
39 lines (34 loc) · 734 Bytes
/
link.ld
File metadata and controls
39 lines (34 loc) · 734 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
OUTPUT_FORMAT("elf64-x86-64")
ENTRY(_start)
/* Endereco fisico onde o Kernel sera alocado */
phys = 0X7E00;
VIRTUAL_OFFSET_ADDR = 0xFFFFFF8000000000;
//VIRTUAL_OFFSET_ADDR = 0x8000000000;
//VIRTUAL_OFFSET_ADDR = 0;
VIRTUAL_KERNEL_ADDR = phys + VIRTUAL_OFFSET_ADDR;
/* Exposicoes ao ld */
SECTIONS
{
.text VIRTUAL_KERNEL_ADDR : AT(VIRTUAL_KERNEL_ADDR) {
code = .;
*(.entry)
*(.text)
. = ALIGN(4096);
}
.data : AT(VIRTUAL_KERNEL_ADDR + (data - code))
{
data = .;
*(.rodata)
*(.data)
. = ALIGN(4096);
*(.stack)
. = ALIGN(4096);
}
.bss : AT(VIRTUAL_KERNEL_ADDR + (bss - code))
{
bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .;
}