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