source: mainline/arch/amd64/_link.ld.in@ 5f85c91

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 5f85c91 was 389f41e, checked in by Martin Decky <martin@…>, 20 years ago

new build system almost finished

  • Property mode set to 100644
File size: 2.1 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
[4f1475d4]11#define __ASM__
12#include <arch/boot/boot.h>
13#include <arch/mm/page.h>
14
[389f41e]15OUTPUT_FORMAT(BFD)
[1141c1a]16ENTRY(kernel_image_start)
17
18SECTIONS {
[4f1475d4]19 .unmapped BOOTSTRAP_OFFSET: AT (BOOTSTRAP_OFFSET) {
[1141c1a]20 unmapped_ktext_start = .;
21 *(K_TEXT_START);
22 *(K_TEXT_START_2);
23 unmapped_ktext_end = .;
[c4b3e3e]24
[1141c1a]25 unmapped_kdata_start = .;
26 *(K_DATA_START);
27 unmapped_kdata_end = .;
28 }
29
[4f1475d4]30 .mapped (PA2KA(BOOT_OFFSET+BOOTSTRAP_OFFSET)+SIZEOF(.unmapped)) : AT (BOOTSTRAP_OFFSET+SIZEOF(.unmapped)) {
[1141c1a]31 ktext_start = .;
[32f6e1bd]32 *(BOOT_DATA);
[1141c1a]33 *(.text);
34 ktext_end = .;
35
36 kdata_start = .;
37 *(.data); /* initialized data */
38 *(.rodata*); /* string literals */
[c832cc0a]39 hardcoded_load_address = .;
[1b492b5]40 QUAD(PA2KA(BOOT_OFFSET+BOOTSTRAP_OFFSET));
[c832cc0a]41 hardcoded_ktext_size = .;
42 QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
43 hardcoded_kdata_size = .;
44 QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
[c4b3e3e]45 hardcoded_unmapped_ktext_size = .;
46 LONG(unmapped_ktext_end - unmapped_ktext_start);
47 hardcoded_unmapped_kdata_size = .;
48 LONG(unmapped_kdata_end - unmapped_kdata_start);
[ab08b42]49 *(COMMON); /* global variables */
50
[c245372b]51 *(.eh_frame);
[c832cc0a]52 *(.bss); /* uninitialized static variables */
[ab08b42]53
54 symbol_table = .;
55 *(symtab.*); /* Symbol table, must be LAST symbol!*/
56
[1141c1a]57 kdata_end = .;
58 }
[3396f59]59
60 _hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start);
[c4b3e3e]61
[3156582]62 /* Symbols that need to be accessed both from real mode & long mode */
63 /* e820*_boot is real mode (pre-above-1MB-move), e820* is */
64 /* kernel mapped above-1MB-physical copied symbol */
[4f1475d4]65 e820table_boot = KA2PA(e820table) - BOOT_OFFSET;
66 e820counter_boot = KA2PA(e820counter) - BOOT_OFFSET;
[3156582]67
68 /* real_bootstrap_gdtr is mapped real_bootstrap_gdtr_boot */
69 /* It is physically outside of kernel area, we have to access */
70 /* it after modification from long mode for booting */
71 /* SMP slave processors */
[4f1475d4]72 real_bootstrap_gdtr = PA2KA(real_bootstrap_gdtr_boot);
[1141c1a]73}
Note: See TracBrowser for help on using the repository browser.