Changeset 87db879 in mainline for kernel/arch/ia32/_link.ld.in


Ignore:
Timestamp:
2018-11-13T20:22:20Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
948e85b
Parents:
156bae23
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-24 14:37:23)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-13 20:22:20)
Message:

Minimize wasted space in IA-32 kernel image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/_link.ld.in

    r156bae23 r87db879  
    2323        kernel_load_address = PA2KA(BOOT_OFFSET);
    2424
    25         .ap_bootstrap (AP_BOOT_OFFSET): AT (AP_BOOT_OFFSET) {
    26                 ap_bootstrap_start = .;
     25        . = AP_BOOT_OFFSET + SIZEOF_HEADERS;
    2726
    28                 /* Must be first. */
    29                 *(.multiboot);
     27        /* Must be first. */
     28        .multiboot : { *(.multiboot); } :ap_boot
    3029
     30        ap_bootstrap_start = .;
     31
     32        .ap_bootstrap : {
    3133                *(K_AP_TEXT_START);
    3234                *(K_AP_DATA_START);
    33                 ap_bootstrap_end = .;
    3435        } :ap_boot
    3536
    36         .unmapped (BOOT_OFFSET): AT (BOOT_OFFSET) {
    37                 unmapped_start = .;
     37        ap_bootstrap_end = .;
     38
     39        . = BOOT_OFFSET + (ap_bootstrap_end & (PAGE_SIZE-1));
     40        unmapped_start = .;
     41
     42        .unmapped : {
    3843                *(K_TEXT_START);
    3944                *(K_DATA_START);
    40                 unmapped_end = .;
    4145        } :unmapped
     46
     47        unmapped_file_end = .;
    4248
    4349        .unmapped_bss : {
    4450                *(.bootstack);
     51                *(K_BSS_START);
    4552        } :unmapped
    4653
    47         .mapped (PA2KA(BOOT_OFFSET) + SIZEOF(.unmapped) + SIZEOF(.unmapped_bss)): AT (BOOT_OFFSET + SIZEOF(.unmapped) + SIZEOF(.unmapped_bss)) {
     54        unmapped_end = .;
     55        mapped_load_start = ALIGN(PAGE_SIZE) + (unmapped_file_end & (PAGE_SIZE-1));
     56
     57        .mapped (PA2KA(mapped_load_start)): AT (mapped_load_start) {
    4858                ktext_start = .;
    4959                *(.text .text.*);
Note: See TracChangeset for help on using the changeset viewer.