From 0c0d220d3eaf61d6ab0aca6d006c278edc5a0440 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 15 Mar 2021 22:41:31 +0200 Subject: Map .text and .rodata as read-only --- linker.ld | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'linker.ld') diff --git a/linker.ld b/linker.ld index 764b78b..d1dedd2 100644 --- a/linker.ld +++ b/linker.ld @@ -16,7 +16,6 @@ SECTIONS /* Begin putting sections at 4 MiB */ . = VADDR_BASE; - _kernel_start = .; .text ALIGN(4K) : AT(ADDR(.text) - VADDR_BASE + 4M) { begin_text = .; @@ -34,6 +33,7 @@ SECTIONS /* Read-write data (initialized) */ .data ALIGN(4K) : AT(ADDR(.data) - VADDR_BASE + 4M) { + begin_data = .; begin_constinit = .; *(.constinit) end_constinit = .; @@ -42,7 +42,6 @@ SECTIONS KEEP(*(.init_array)); /* global constructors */ end_ctors = .; - begin_data = .; *(.data) end_data = .; } @@ -55,5 +54,4 @@ SECTIONS *(.stack) end_bss = .; } - _kernel_end = .; } -- cgit v1.2.1