118 lines
3.6 KiB
Text
118 lines
3.6 KiB
Text
|
|
ENTRY(__start)
|
|
|
|
high_base = 0xFFFF800000000000;
|
|
|
|
MEMORY
|
|
{
|
|
MULTIBOOT_HEADER_PV : ORIGIN = 16k, LENGTH = 4k
|
|
TRAMPOLINE_PV : ORIGIN = 0x0, LENGTH = 16k
|
|
START_MEMORY_PV : ORIGIN = 20k, LENGTH = 44k
|
|
|
|
KERNEL_MEMORY_P : ORIGIN = 64k, LENGTH = (1024M - ORIGIN(KERNEL_MEMORY_P))
|
|
|
|
HIGH_KERNEL_V : ORIGIN = high_base + ORIGIN(KERNEL_MEMORY_P), LENGTH = LENGTH(KERNEL_MEMORY_P)
|
|
}
|
|
|
|
SECTIONS
|
|
{
|
|
.boot : {
|
|
__boot_start__ = .;
|
|
KEEP(*(.multiboot_header))
|
|
__boot_end__ = .;
|
|
} > MULTIBOOT_HEADER_PV
|
|
.startup_text : {
|
|
__startup_text_start__ = .;
|
|
*(.startup_text)
|
|
__startup_text_end__ = .;
|
|
} > START_MEMORY_PV
|
|
.startup_data : {
|
|
__startup_data_start__ = .;
|
|
KEEP(*(.startup_data))
|
|
__startup_data_end__ = .;
|
|
} > START_MEMORY_PV
|
|
.text : AT(ADDR(.text) - high_base) {
|
|
__text_start__ = .;
|
|
*(EXCLUDE_FILE(*trampoline*) .text .text.*)
|
|
*(EXCLUDE_FILE(*trampoline*) .iplt)
|
|
__text_end__ = .;
|
|
} > HIGH_KERNEL_V
|
|
.rodata : AT(ADDR(.rodata) - high_base) {
|
|
__rodata_start__ = .;
|
|
*(EXCLUDE_FILE(*trampoline*) .rodata .rodata.*)
|
|
. = ALIGN(8);
|
|
__reserved_ranges_start__ = .;
|
|
KEEP(*(.reserved_ranges))
|
|
__reserved_ranges_end__ = .;
|
|
__init_array_start__ = .;
|
|
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
|
|
KEEP(*(.init_array .ctors))
|
|
__init_array_end__ = .;
|
|
__rodata_end__ = .;
|
|
} > HIGH_KERNEL_V
|
|
.data : AT(ADDR(.data) - high_base) {
|
|
__data_start__ = .;
|
|
*(EXCLUDE_FILE(*trampoline*) .data .data.*)
|
|
*(EXCLUDE_FILE(*trampoline*) .got .got.plt .igot.plt .data.rel.ro .data.rel.ro.*)
|
|
__data_end__ = .;
|
|
} > HIGH_KERNEL_V
|
|
.bss (NOLOAD) : AT(ADDR(.bss) - high_base) {
|
|
__bss_start__ = .;
|
|
*(EXCLUDE_FILE(*trampoline*) .bss .bss.*)
|
|
__bss_end__ = .;
|
|
} > HIGH_KERNEL_V
|
|
|
|
.trampoline_text : {
|
|
__trampoline_text_start__ = .;
|
|
*trampoline*(.text)
|
|
__trampoline_text_end__ = .;
|
|
} > TRAMPOLINE_PV
|
|
|
|
.trampoline_data : {
|
|
__trampoline_data_start__ = .;
|
|
*trampoline*(.data)
|
|
__trampoline_data_end__ = .;
|
|
} > TRAMPOLINE_PV
|
|
|
|
.trampoline_rodata : {
|
|
__trampoline_rodata_start__ = .;
|
|
*trampoline*(.rodata)
|
|
__trampoline_rodata_end__ = .;
|
|
} > TRAMPOLINE_PV
|
|
|
|
.trampoline_bss (NOLOAD) : {
|
|
__trampoline_bss_start__ = .;
|
|
*trampoline*(.bss)
|
|
__trampoline_bss_end__ = .;
|
|
} > TRAMPOLINE_PV
|
|
|
|
.debug_aranges 0 : { *(.debug_aranges) }
|
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
|
.debug_pubtypes 0 : { *(.debug_pubtypes) }
|
|
.debug_info 0 : { *(.debug_info) }
|
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
|
.debug_line 0 : { *(.debug_line) }
|
|
.debug_line_str 0 : { *(.debug_line_str) }
|
|
.debug_frame 0 : { *(.debug_frame) }
|
|
.debug_str 0 : { *(.debug_str) }
|
|
.debug_loc 0 : { *(.debug_loc) }
|
|
.debug_loclists 0 : { *(.debug_loclists) }
|
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
|
.debug_macro 0 : { *(.debug_macro) }
|
|
.debug_ranges 0 : { *(.debug_ranges) }
|
|
.debug_rnglists 0 : { *(.debug_rnglists) }
|
|
.debug_addr 0 : { *(.debug_addr) }
|
|
.debug_str_offsets 0 : { *(.debug_str_offsets) }
|
|
.debug_names 0 : { *(.debug_names) }
|
|
.debug_types 0 : { *(.debug_types) }
|
|
|
|
/DISCARD/ : {
|
|
*(.comment)
|
|
*(.eh_frame)
|
|
*(.note)
|
|
*(.note.gnu.build-id)
|
|
*(.note.GNU-stack)
|
|
*(.rela*)
|
|
}
|
|
}
|
|
|