From 5d898d84748d38a3977c29eb110035d61085d3bc Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 18 Apr 2017 12:12:28 +0200 Subject: [PATCH] Page align all sections as they will be individually mapped --- src/arch/x86_64/linker.ld | 61 +++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/src/arch/x86_64/linker.ld b/src/arch/x86_64/linker.ld index f763e62c..5b58518b 100644 --- a/src/arch/x86_64/linker.ld +++ b/src/arch/x86_64/linker.ld @@ -1,24 +1,53 @@ ENTRY(start) SECTIONS { - . = 1M; + . = 1M; - .boot : - { - /* ensure that the multiboot header is at the beginning */ - KEEP(*(.multiboot_header)) - } + .rodata : + { + /* ensure that the multiboot header is at the beginning */ + KEEP(*(.multiboot_header)) + *(.rodata .rodata.*) + . = ALIGN(4K); + } - .text : - { - *(.text .text.*) - } + .text : + { + *(.text .text.*) + . = ALIGN(4K); + } - .rodata : { - *(.rodata .rodata.*) - } + .data : + { + *(.data .data.*) + . = ALIGN(4K); + } - .data.rel.ro : { - *(.data.rel.ro.local*) *(.data.rel.ro .data.rel.ro.*) - } + .bss : + { + *(.bss .bss.*) + . = ALIGN(4K); + } + + .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); + } }