Align section size instead of section start due to #126

This fixes the problem that GRUB sometimes puts the multiboot info struct between kernel sections if the hole is big enough. This leads to problems since we would try to map the same page twice in that case.
This commit is contained in:
Philipp Oppermann
2016-02-13 16:59:04 +01:00
parent 4142cff3e6
commit 635f7d3f9d

View File

@@ -14,28 +14,39 @@ ENTRY(start)
SECTIONS {
. = 1M;
.rodata : ALIGN(4K)
.rodata :
{
/* ensure that the multiboot header is at the beginning */
KEEP(*(.multiboot_header))
*(.rodata .rodata.*)
. = ALIGN(4K);
}
.text : ALIGN(4K)
.text :
{
*(.text .text.*)
. = ALIGN(4K);
}
.data : ALIGN(4K)
.data :
{
*(.data .data.*)
. = ALIGN(4K);
}
.bss :
{
*(.bss .bss.*)
. = 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);
}
}