From a1b352fdc033e2b6a5695bd0628063330e93074b Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Tue, 3 May 2022 14:01:03 +0200 Subject: [PATCH] Kernel: Add some mission sections to the aarch64 linker script The sections did end up in the ELF file, however they weren't explicitely mentioned in the linker.ld script. In the future, we can add the --orphan-handling=error flag to the linker options, which will enforce that the sections used in the sources files also are mentioned in the linker script. --- Kernel/Arch/aarch64/linker.ld | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Kernel/Arch/aarch64/linker.ld b/Kernel/Arch/aarch64/linker.ld index 5a78882ca9..2fc3a52885 100644 --- a/Kernel/Arch/aarch64/linker.ld +++ b/Kernel/Arch/aarch64/linker.ld @@ -1,11 +1,13 @@ ENTRY(start) +/* TODO: Add FLAGS to the program headers */ PHDRS { text PT_LOAD ; data PT_LOAD ; bss PT_LOAD ; - ksyms PT_LOAD FLAGS(PF_R) ; + super_pages PT_LOAD ; + ksyms PT_LOAD ; } SECTIONS @@ -20,6 +22,10 @@ SECTIONS .rodata ALIGN(4K) : AT (ADDR(.rodata)) { + start_ctors = .; + *(.init_array) + end_ctors = .; + *(.rodata*) } :data @@ -33,8 +39,16 @@ SECTIONS start_of_bss = .; *(.bss) end_of_bss = .; + + . = ALIGN(4K); + *(.heap) } :bss + .super_pages ALIGN(4K) (NOLOAD) : AT (ADDR(.super_pages)) + { + *(.super_pages) + } :super_pages + .ksyms ALIGN(4K) : AT (ADDR(.ksyms)) { start_of_kernel_ksyms = .;