Fix linker RWX warning
This commit is contained in:
37
arch/riscv/kernel.ld
Normal file
37
arch/riscv/kernel.ld
Normal file
@@ -0,0 +1,37 @@
|
||||
OUTPUT_ARCH("riscv")
|
||||
OUTPUT_FORMAT("elf32-littleriscv")
|
||||
ENTRY(_entry)
|
||||
|
||||
PHDRS {
|
||||
text PT_LOAD FLAGS(5);
|
||||
data PT_LOAD FLAGS(6);
|
||||
}
|
||||
|
||||
SECTIONS {
|
||||
.text 0x80200000 : {
|
||||
__kernel_base = .;
|
||||
KEEP(*(.text.boot));
|
||||
*(.text .text.*);
|
||||
} :text
|
||||
|
||||
.rodata : ALIGN(16) {
|
||||
*(.rodata .rodata.*);
|
||||
}
|
||||
|
||||
.data : ALIGN(16) {
|
||||
*(.data .data.*);
|
||||
} :data
|
||||
|
||||
.bss : ALIGN(16) {
|
||||
__bss = .;
|
||||
*(.bss .bss.* .sbss .sbss.*);
|
||||
__bss_end = .;
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
. += 128 * 1024; /* 128KB */
|
||||
__stack_top = .;
|
||||
|
||||
. = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||
__free_ram = .;
|
||||
}
|
Reference in New Issue
Block a user