Rev 2703 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2703 | Rev 4162 | ||
---|---|---|---|
1 | /** AMD64 linker script |
1 | /** AMD64 linker script |
2 | * |
2 | * |
3 | * umapped section: |
3 | * umapped section: |
4 | * kernel text |
4 | * kernel text |
5 | * kernel data |
5 | * kernel data |
6 | * mapped section: |
6 | * mapped section: |
7 | * kernel text |
7 | * kernel text |
8 | * kernel data |
8 | * kernel data |
9 | */ |
9 | */ |
10 | 10 | ||
11 | #include <arch/boot/boot.h> |
11 | #include <arch/boot/boot.h> |
12 | #include <arch/mm/page.h> |
12 | #include <arch/mm/page.h> |
13 | 13 | ||
14 | SECTIONS { |
14 | SECTIONS { |
15 | .unmapped BOOT_OFFSET: AT (0) { |
15 | .unmapped BOOT_OFFSET: AT (0) { |
16 | unmapped_ktext_start = .; |
16 | unmapped_ktext_start = .; |
17 | *(K_TEXT_START); |
17 | *(K_TEXT_START); |
18 | unmapped_ktext_end = .; |
18 | unmapped_ktext_end = .; |
19 | 19 | ||
20 | unmapped_kdata_start = .; |
20 | unmapped_kdata_start = .; |
21 | *(K_DATA_START); |
21 | *(K_DATA_START); |
22 | *(K_INI_PTLS); |
22 | *(K_INI_PTLS); |
23 | unmapped_kdata_end = .; |
23 | unmapped_kdata_end = .; |
24 | } |
24 | } |
25 | 25 | ||
26 | .mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)) : AT (SIZEOF(.unmapped)) { |
26 | .mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)) : AT (SIZEOF(.unmapped)) { |
27 | ktext_start = .; |
27 | ktext_start = .; |
28 | *(.text); |
28 | *(.text); |
29 | ktext_end = .; |
29 | ktext_end = .; |
30 | 30 | ||
31 | kdata_start = .; |
31 | kdata_start = .; |
32 | *(.data); /* initialized data */ |
32 | *(.data); /* initialized data */ |
33 | *(.rodata*); /* string literals */ |
33 | *(.rodata*); /* string literals */ |
34 | hardcoded_load_address = .; |
34 | hardcoded_load_address = .; |
35 | QUAD(PA2KA(BOOT_OFFSET)); |
35 | QUAD(PA2KA(BOOT_OFFSET)); |
36 | hardcoded_ktext_size = .; |
36 | hardcoded_ktext_size = .; |
37 | QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start)); |
37 | QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start)); |
38 | hardcoded_kdata_size = .; |
38 | hardcoded_kdata_size = .; |
39 | QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start)); |
39 | QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start)); |
40 | hardcoded_unmapped_ktext_size = .; |
40 | hardcoded_unmapped_ktext_size = .; |
41 | QUAD(unmapped_ktext_end - unmapped_ktext_start); |
41 | QUAD(unmapped_ktext_end - unmapped_ktext_start); |
42 | hardcoded_unmapped_kdata_size = .; |
42 | hardcoded_unmapped_kdata_size = .; |
43 | QUAD(unmapped_kdata_end - unmapped_kdata_start); |
43 | QUAD(unmapped_kdata_end - unmapped_kdata_start); |
44 | *(COMMON); /* global variables */ |
44 | *(COMMON); /* global variables */ |
45 | 45 | ||
46 | *(.eh_frame); |
- | |
47 | - | ||
48 | symbol_table = .; |
46 | symbol_table = .; |
49 | *(symtab.*); /* Symbol table, must be LAST symbol!*/ |
47 | *(symtab.*); /* Symbol table, must be LAST symbol!*/ |
50 | 48 | ||
51 | *(.bss); /* uninitialized static variables */ |
49 | *(.bss); /* uninitialized static variables */ |
52 | 50 | ||
53 | kdata_end = .; |
51 | kdata_end = .; |
54 | } |
52 | } |
- | 53 | ||
- | 54 | /DISCARD/ : { |
|
- | 55 | *(*); |
|
- | 56 | } |
|
55 | 57 | ||
56 | #ifdef CONFIG_SMP |
58 | #ifdef CONFIG_SMP |
57 | _hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start); |
59 | _hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start); |
58 | ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET; |
60 | ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET; |
59 | ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET; |
61 | ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET; |
60 | protected_ap_gdtr = PA2KA(ap_gdtr); |
62 | protected_ap_gdtr = PA2KA(ap_gdtr); |
61 | 63 | ||
62 | #endif /* CONFIG_SMP */ |
64 | #endif /* CONFIG_SMP */ |
63 | 65 | ||
64 | } |
66 | } |
65 | 67 |