Subversion Repositories HelenOS

Rev

Rev 602 | Rev 696 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

/** AMD64 linker script
 *  
 * umapped section:
 *  kernel text
 *  kernel data
 * mapped section:
 *  kernel text
 *  kernel data 
 */

#define __ASM__
#include <arch/boot/boot.h>
#include <arch/mm/page.h>

SECTIONS {
    .unmapped BOOT_OFFSET: AT (0) {
        unmapped_ktext_start = .;
        *(K_TEXT_START);
        unmapped_ktext_end = .;

        unmapped_kdata_start = .;
        *(K_DATA_START);
        unmapped_kdata_end = .;
    }

    .mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)) : AT (SIZEOF(.unmapped)) {
        ktext_start = .;
        *(.text);
        ktext_end = .;

        kdata_start = .;
        *(.data);       /* initialized data */
        *(.rodata*);        /* string literals */
        hardcoded_load_address = .;
        QUAD(PA2KA(BOOT_OFFSET));
        hardcoded_ktext_size = .;
        QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
        hardcoded_kdata_size = .;
        QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
        hardcoded_unmapped_ktext_size = .;
        LONG(unmapped_ktext_end - unmapped_ktext_start);
        hardcoded_unmapped_kdata_size = .;
        LONG(unmapped_kdata_end - unmapped_kdata_start);
        *(COMMON);      /* global variables */

        *(.eh_frame);

        symbol_table = .;
        *(symtab.*);            /* Symbol table, must be LAST symbol!*/

        *(.bss);        /* uninitialized static variables */

        kdata_end = .;
    }
}