diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-15 22:41:31 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-15 22:41:31 +0200 |
commit | 0c0d220d3eaf61d6ab0aca6d006c278edc5a0440 (patch) | |
tree | 219f1c93e7b4514c57363c8cc8fa6351fce1fe86 /linker.ld | |
parent | Fix compile failure without -O2 (diff) | |
download | kernel.cpp-0c0d220d3eaf61d6ab0aca6d006c278edc5a0440.tar.xz |
Map .text and .rodata as read-only
Diffstat (limited to 'linker.ld')
-rw-r--r-- | linker.ld | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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 = .; } |