source: mainline/kernel/arch/amd64/_link.ld.in@ 340ba25c

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 340ba25c was d21e72db, checked in by Martin Decky <martin@…>, 14 years ago

amd64: improve linker scripts

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[c245372b]1/** AMD64 linker script
[2ddcc7b]2 *
[1141c1a]3 * umapped section:
[2ddcc7b]4 * kernel text
5 * kernel data
[1141c1a]6 * mapped section:
[2ddcc7b]7 * kernel text
8 * kernel data
[1141c1a]9 */
10
[4f1475d4]11#include <arch/boot/boot.h>
12#include <arch/mm/page.h>
13
[1141c1a]14SECTIONS {
[8725fb4]15 .unmapped BOOT_OFFSET: AT (0) {
[1141c1a]16 unmapped_ktext_start = .;
17 *(K_TEXT_START);
18 unmapped_ktext_end = .;
[2ddcc7b]19
[1141c1a]20 unmapped_kdata_start = .;
21 *(K_DATA_START);
[19077a5]22 *(K_INI_PTLS);
[1141c1a]23 unmapped_kdata_end = .;
24 }
[2ddcc7b]25
[8725fb4]26 .mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)) : AT (SIZEOF(.unmapped)) {
[1141c1a]27 ktext_start = .;
[d21e72db]28 *(.text .text.*);
[1141c1a]29 ktext_end = .;
[2ddcc7b]30
[1141c1a]31 kdata_start = .;
[d21e72db]32 *(.data); /* initialized data */
33 *(.rodata .rodata.*); /* string literals */
[c832cc0a]34 hardcoded_load_address = .;
[8725fb4]35 QUAD(PA2KA(BOOT_OFFSET));
[c832cc0a]36 hardcoded_ktext_size = .;
37 QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
38 hardcoded_kdata_size = .;
39 QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
[c4b3e3e]40 hardcoded_unmapped_ktext_size = .;
[42744880]41 QUAD(unmapped_ktext_end - unmapped_ktext_start);
[c4b3e3e]42 hardcoded_unmapped_kdata_size = .;
[42744880]43 QUAD(unmapped_kdata_end - unmapped_kdata_start);
[2ddcc7b]44 *(COMMON); /* global variables */
45
[1ac3a52]46 . = ALIGN(8);
[ab08b42]47 symbol_table = .;
[2ddcc7b]48 *(symtab.*); /* Symbol table, must be LAST symbol!*/
49
50 *(.bss); /* uninitialized static variables */
51
[1141c1a]52 kdata_end = .;
53 }
[2ddcc7b]54
[9ded977]55#ifdef CONFIG_LINE_DEBUG
56 .comment 0 : { *(.comment); }
57 .debug_abbrev 0 : { *(.debug_abbrev); }
58 .debug_aranges 0 : { *(.debug_aranges); }
59 .debug_info 0 : { *(.debug_info); }
60 .debug_line 0 : { *(.debug_line); }
61 .debug_loc 0 : { *(.debug_loc); }
62 .debug_pubnames 0 : { *(.debug_pubnames); }
63 .debug_pubtypes 0 : { *(.debug_pubtypes); }
64 .debug_ranges 0 : { *(.debug_ranges); }
65 .debug_str 0 : { *(.debug_str); }
66#endif
67
[5b8c75a]68 /DISCARD/ : {
69 *(*);
70 }
[42edee68]71
[2ddcc7b]72#ifdef CONFIG_SMP
[42edee68]73 _hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);
74 ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET;
75 ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET;
76 protected_ap_gdtr = PA2KA(ap_gdtr);
77#endif /* CONFIG_SMP */
[2ddcc7b]78
[1141c1a]79}
Note: See TracBrowser for help on using the repository browser.