|
|
@ -3,21 +3,51 @@ ENTRY(start) |
|
|
|
SECTIONS { |
|
|
|
. = 1M; /* load the kernel at 1MiB above 0x0 */ |
|
|
|
|
|
|
|
.boot : { |
|
|
|
/* Merged section for both the multiboot header and .rodata, |
|
|
|
so we don't waste a page on the multiboot header */ |
|
|
|
.rodata : { |
|
|
|
/* ensure the multiboot header is at the start of the binary */ |
|
|
|
KEEP(*(.multiboot_header)) |
|
|
|
|
|
|
|
/* ensure small fragments in .rodata and .rel.ro are linked together */ |
|
|
|
*(.rodata .rodata.*) |
|
|
|
|
|
|
|
. = ALIGN(4K); |
|
|
|
} |
|
|
|
|
|
|
|
.text : { |
|
|
|
/* Kernel code */ |
|
|
|
*(.text .text.*) /* .text.* ensures that all small .text fragments are linked together */ |
|
|
|
. = ALIGN(4K); |
|
|
|
} |
|
|
|
|
|
|
|
/* ensure small fragments in .rodata and .rel.ro are linked together */ |
|
|
|
.rodata : { |
|
|
|
*(.rodata .rodata.*) |
|
|
|
.data : { |
|
|
|
*(.data .data.*) |
|
|
|
. = ALIGN(4K); |
|
|
|
} |
|
|
|
|
|
|
|
.bss : { |
|
|
|
*(.bss .bss.*) |
|
|
|
. = ALIGN(4K); |
|
|
|
} |
|
|
|
.data.rel.ro : { |
|
|
|
|
|
|
|
.got : { |
|
|
|
*(.got) |
|
|
|
. = ALIGN(4K); |
|
|
|
} |
|
|
|
|
|
|
|
.got.plt : { |
|
|
|
*(.got.plt) |
|
|
|
. = ALIGN(4K); |
|
|
|
} |
|
|
|
|
|
|
|
.data.rel.ro : ALIGN(4K) { |
|
|
|
*(.data.rel.ro.local*) *(.data.rel.ro .data.rel.ro.*) |
|
|
|
. = ALIGN(4K); |
|
|
|
} |
|
|
|
|
|
|
|
.gcc_except_table : ALIGN(4K) { |
|
|
|
*(.gcc_except_table) |
|
|
|
. = ALIGN(4K); |
|
|
|
} |
|
|
|
} |