diff options
author | Marvin Borner | 2021-04-02 19:04:34 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-02 19:11:56 +0200 |
commit | fe468b476d567b6aa0695a030c408ccf46278c7d (patch) | |
tree | 36b664e7f4ecbf991c7a563af75d81a4a604c45f /kernel/link.ld | |
parent | b62b9d1f33a4911feb9f318ece0c1565f27abf8d (diff) |
Mapped .text and .rodata readonly
Diffstat (limited to 'kernel/link.ld')
-rw-r--r-- | kernel/link.ld | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/kernel/link.ld b/kernel/link.ld index fbe8a8c..c3b59b3 100644 --- a/kernel/link.ld +++ b/kernel/link.ld @@ -5,27 +5,31 @@ phys = 0x00009000; SECTIONS { - .text phys : AT(phys) { - kernel_start = .; - code = .; + . = phys; + + kernel_ro_start = .; + .text BLOCK(4K) : ALIGN(4K) + { *(.text) + } + + .rodata BLOCK(4K) : ALIGN(4K) + { *(.rodata) - . = ALIGN(4096); } + kernel_ro_end = .; + - .data : AT(phys + (data - code)) + kernel_rw_start = .; + .data BLOCK(4K) : ALIGN(4K) { - data = .; *(.data) - . = ALIGN(4096); } - .bss : AT(phys + (bss - code)) + .bss BLOCK(4K) : ALIGN(4K) { - bss = .; + *(COMMON) *(.bss) - . = ALIGN(4096); } - - kernel_end = .; + kernel_rw_end = .; } |