Subversion Repositories HelenOS

Rev

Rev 2089 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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