1
2OUTPUT_FORMAT("elf64-x86-64","elf64-x86-64","elf64-x86-64")
3OUTPUT_ARCH(i386:x86-64)
4ENTRY(_start)
5
6SECTIONS
7{
8	KERNEL_VMA = 0xffff800000000000;
9	//KERNEL_VMA = 0;
10	. = 0;
11	. = 0x100000;
12
13	.boot.text :
14	{
15		KEEP(*(.multiboot_header))
16		head.o(.bootstrap)
17		head.o(.bootstrap.code64)
18		head.o(.bootstrap.data)
19		. = ALIGN(4096);
20	}
21
22	. += KERNEL_VMA;
23	. = ALIGN(32768);
24	text_start_pa = .;
25	.text (text_start_pa): AT(text_start_pa - KERNEL_VMA)
26	{
27		_text = .;
28
29		*(.text)
30
31		_etext = .;
32	}
33	. = ALIGN(32768);
34	data_start_pa = .;
35	.data (data_start_pa): AT(data_start_pa - KERNEL_VMA)
36	{
37		_data = .;
38		*(.data)
39
40		_edata = .;
41	}
42
43	. = ALIGN(32768);
44
45	rodata_start_pa = .;
46	.rodata (rodata_start_pa): AT(rodata_start_pa - KERNEL_VMA)
47	{
48		_rodata = .;
49		*(.rodata)
50		*(.rodata.*)
51		_erodata = .;
52	}
53
54	. = ALIGN(32768);
55
56	init_proc_union_start_pa = .;
57	.data.init_proc_union (init_proc_union_start_pa): AT(init_proc_union_start_pa - KERNEL_VMA)
58	 { *(.data.init_proc_union) }
59
60	. = ALIGN(32768);
61	 bss_start_pa = .;
62	.bss (bss_start_pa): AT(bss_start_pa - KERNEL_VMA)
63	{
64		_bss = .;
65		*(.bss)
66		*(.bss.*)
67		_ebss = .;
68	}
69
70	_end = .;
71
72	/DISCARD/ : {
73		*(.eh_frame)
74
75	}
76}