using my own linker now
This commit is contained in:
parent
8d0178aff1
commit
d3f3adbf40
2
Makefile
2
Makefile
@ -13,7 +13,7 @@ GCC_PREF=riscv32-unknown-elf-
|
||||
CC=$(GCC_PREF)gcc
|
||||
OBJDUMP=$(GCC_PREF)objdump
|
||||
CFLAGS=-I$(KLIBDIR) -march=rv32im -O3
|
||||
KERNEL_CFLAGS=-nostdlib
|
||||
KERNEL_CFLAGS=-nostdlib -T linker.ld
|
||||
|
||||
# dependencies that need to be built:
|
||||
_DEPS = ecall.c csr.c mutex.c sched.c
|
||||
|
@ -5,7 +5,7 @@ stack_bottom:
|
||||
stack_top:
|
||||
|
||||
|
||||
.section .text
|
||||
.section .text._start
|
||||
|
||||
|
||||
// Set up all the CSR mstatus_offsets
|
||||
|
31
linker.ld
Normal file
31
linker.ld
Normal file
@ -0,0 +1,31 @@
|
||||
OUTPUT_ARCH("riscv")
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000100;
|
||||
.text :
|
||||
{
|
||||
*(.text._start)
|
||||
*(.text)
|
||||
}
|
||||
.sdata :
|
||||
{
|
||||
__global_pointer$ = . + 0x800;
|
||||
*(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*)
|
||||
*(.sdata .sdata.* .gnu.linkonce.s.*)
|
||||
}
|
||||
_edata = .; PROVIDE (edata = .);
|
||||
. = .;
|
||||
__bss_start = .;
|
||||
.sbss :
|
||||
{
|
||||
*(.dynsbss)
|
||||
*(.sbss .sbss.* .gnu.linkonce.sb.*)
|
||||
*(.scommon)
|
||||
}
|
||||
__bss_end = .;
|
||||
.stack :
|
||||
{
|
||||
*(.stack)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user