source: mainline/kernel/arch/ia32/_link.ld.in@ ad12b5ea

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

ia32: improve linker scripts

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