From 598b964ee3c1fab162bfc85fa3725501ab238881 Mon Sep 17 00:00:00 2001 From: stefan Date: Fri, 31 Mar 2023 18:41:36 -0400 Subject: entry.s and kernel.ld --- kernel/lds/kernel.ld | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 kernel/lds/kernel.ld (limited to 'kernel/lds/kernel.ld') diff --git a/kernel/lds/kernel.ld b/kernel/lds/kernel.ld new file mode 100644 index 0000000..052aa32 --- /dev/null +++ b/kernel/lds/kernel.ld @@ -0,0 +1,47 @@ +OUTPUT_ARCH(riscv) +ENTRY(_start) + +SECTIONS +{ + . = LOAD_ADDR; + . = ALIGN(PAGE_SIZE); + + .text : + { + provide(__text_start = .); + *(.text.init) + *(.text .text.*) + . = ALIGN(8); + PROVIDE(__text_end = .); + } + . = ALIGN(PAGE_SIZE); + + PROVIDE(__global_pointer$ = .); + + .rodata : + { + PROVIDE(__rodata_start = .); + *(.rodata .rodata.*) + . = ALIGN(8); + PROVIDE(__rodata_end = .); + } + + . = ALIGN(PAGE_SIZE); + + .data : + { + PROVIDE(__data_start = .); + *(.sdata .sdata.*) + *(.data .data.*) + *(.readmostly.data) + *(*.data) + . = ALIGN(8); + PROVIDE(__data_end = .); + } + + . = ALIGN(PAGE_SIZE); + + PROVIDE(__stack_start = .); + PROVIDE(__stack_end = __stack_start + (PAGE_SIZE * NPROC)); + PROVIDE(__heap_start = __stack_end); +} -- cgit v1.2.3