Subversion Repositories HelenOS

Rev

Rev 4162 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
178 palkovsky 1
/** AMD64 linker script
164 palkovsky 2
 *  
3
 * umapped section:
4
 * 	kernel text
5
 * 	kernel data
6
 * mapped section:
7
 *	kernel text
8
 *	kernel data 
9
 */
10
 
289 palkovsky 11
#include <arch/boot/boot.h>
12
#include <arch/mm/page.h>
13
 
164 palkovsky 14
SECTIONS {
694 decky 15
	.unmapped BOOT_OFFSET: AT (0) {
164 palkovsky 16
		unmapped_ktext_start = .;
17
		*(K_TEXT_START);
18
		unmapped_ktext_end = .;
275 palkovsky 19
 
164 palkovsky 20
		unmapped_kdata_start = .;
21
		*(K_DATA_START);
2703 jermar 22
		*(K_INI_PTLS);
164 palkovsky 23
		unmapped_kdata_end = .;
24
	}
25
 
694 decky 26
	.mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)) : AT (SIZEOF(.unmapped)) {
164 palkovsky 27
		ktext_start = .;
28
		*(.text);
29
		ktext_end = .;
30
 
31
		kdata_start = .;
32
		*(.data);		/* initialized data */
33
		*(.rodata*);		/* string literals */
216 palkovsky 34
		hardcoded_load_address = .;
694 decky 35
		QUAD(PA2KA(BOOT_OFFSET));
216 palkovsky 36
		hardcoded_ktext_size = .;
37
		QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
38
		hardcoded_kdata_size = .;
39
		QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
275 palkovsky 40
		hardcoded_unmapped_ktext_size = .;
820 jermar 41
		QUAD(unmapped_ktext_end - unmapped_ktext_start);
275 palkovsky 42
		hardcoded_unmapped_kdata_size = .;
820 jermar 43
		QUAD(unmapped_kdata_end - unmapped_kdata_start);
268 palkovsky 44
		*(COMMON);		/* global variables */
45
 
46
		symbol_table = .;
47
		*(symtab.*);            /* Symbol table, must be LAST symbol!*/
48
 
602 palkovsky 49
		*(.bss);		/* uninitialized static variables */
50
 
164 palkovsky 51
		kdata_end = .;
52
	}
4162 jermar 53
 
54
	/DISCARD/ : {
55
		*(*);
56
	}
696 decky 57
 
58
#ifdef CONFIG_SMP	
59
	_hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);
60
	ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET;
61
	ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET;
62
	protected_ap_gdtr = PA2KA(ap_gdtr);
63
 
64
#endif /* CONFIG_SMP */
65
 
164 palkovsky 66
}