aboutsummaryrefslogtreecommitdiff
path: root/linker.ld
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-03-15 22:41:31 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-03-15 22:41:31 +0200
commit0c0d220d3eaf61d6ab0aca6d006c278edc5a0440 (patch)
tree219f1c93e7b4514c57363c8cc8fa6351fce1fe86 /linker.ld
parentFix compile failure without -O2 (diff)
downloadkernel.cpp-0c0d220d3eaf61d6ab0aca6d006c278edc5a0440.tar.xz
Map .text and .rodata as read-only
Diffstat (limited to 'linker.ld')
-rw-r--r--linker.ld4
1 files changed, 1 insertions, 3 deletions
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 = .;
}