source: mainline/arch/amd64/_link.ld@ 8ff2f3f

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 8ff2f3f was 3396f59, checked in by Ondrej Palkovsky <ondrap@…>, 20 years ago

Fixed gdtr naming issues after ia32 changes.
Fixed stack alignment on new thread to by multiple of 16,
we are now ABI-correct and we do not #GP on va_arg to boot.
Fixed bad exception register names reporting.
Fixed bad _hardcoded_load_addr, which caused allocation of kernel text
frames.

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[c245372b]1/** AMD64 linker script
[1141c1a]2 *
3 * umapped section:
4 * kernel text
5 * kernel data
6 * mapped section:
7 * kernel text
8 * kernel data
9 */
10
11OUTPUT_FORMAT(binary)
12ENTRY(kernel_image_start)
13
14SECTIONS {
15 .unmapped 0x8000: AT (0x8000) {
16 unmapped_ktext_start = .;
17 *(K_TEXT_START);
18 *(K_TEXT_START_2);
19 unmapped_ktext_end = .;
[c4b3e3e]20
[1141c1a]21 unmapped_kdata_start = .;
22 *(K_DATA_START);
23 unmapped_kdata_end = .;
24 }
25
[c4b3e3e]26 .mapped (0xffffffff80100000+0x8000+SIZEOF(.unmapped)) : AT (0x8000+SIZEOF(.unmapped)) {
[1141c1a]27 ktext_start = .;
[32f6e1bd]28 *(BOOT_DATA);
[1141c1a]29 *(.text);
30 ktext_end = .;
31
32 kdata_start = .;
33 *(.data); /* initialized data */
34 *(.rodata*); /* string literals */
[c832cc0a]35 hardcoded_load_address = .;
[3396f59]36 QUAD(ktext_start - SIZEOF(.unmapped));
[c832cc0a]37 hardcoded_ktext_size = .;
38 QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
39 hardcoded_kdata_size = .;
40 QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
[c4b3e3e]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);
[ab08b42]45 *(COMMON); /* global variables */
46
47
48
[c245372b]49 *(.eh_frame);
[c832cc0a]50 *(.bss); /* uninitialized static variables */
[1141c1a]51 *(K_DATA_END);
[ab08b42]52
53 symbol_table = .;
54 *(symtab.*); /* Symbol table, must be LAST symbol!*/
55
[1141c1a]56 kdata_end = .;
57 }
[3396f59]58
59 _hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start);
[946b630]60 _boot_offset = 0x100000;
61 _ka2pa_offset = 0xffffffff80000000;
62 _map_address = _ka2pa_offset + _boot_offset;
63
[c4b3e3e]64
[32f6e1bd]65 e820table_boot = e820table - _map_address;
66 e820counter_boot = e820counter - _map_address;
[3396f59]67 real_bootstrap_gdtr = real_bootstrap_gdtr_boot + _ka2pa_offset;
[1141c1a]68}
Note: See TracBrowser for help on using the repository browser.