riscv64: Add missing linker scripts, fix some kernel dependencies

Change-Id: Ic63b0bbdddda629bb9bc76017a806746c983023e
This commit is contained in:
Alexander von Gluck IV 2020-02-19 18:41:59 -06:00
parent 2a0d1eb890
commit 40c4917414
4 changed files with 100 additions and 13 deletions

View File

@ -15,19 +15,42 @@ local kernelLibArchObjects =
<src!system!kernel!lib!arch!$(TARGET_ARCH)>memset.o
;
BootMergeObject boot_arch_$(TARGET_KERNEL_ARCH).o :
debug_uart_8250.cpp
#arch_uart_8250.cpp
arch_elf.cpp
: # additional flags
:
$(kernelArchObjects)
$(kernelLibArchObjects)
local kernelDebugSources =
blue_screen.cpp
frame_buffer_console.cpp
;
SEARCH on [ FGristFiles arch_elf.cpp arch_uart_8250.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
local kernelArchDriverSources =
arch_elf.cpp
# Serial UART Drivers
#arch_uart_8250.cpp
#arch_uart_8250_omap.cpp
#arch_uart_pl011.cpp
;
SEARCH on [ FGristFiles debug_uart_8250.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ;
local kernelGenericDriverSources =
debug_uart_8250.cpp
;
local platform ;
for platform in [ MultiBootSubDirSetup u-boot efi ] {
on $(platform) {
DEFINES += _BOOT_MODE ;
BootMergeObject [ FGristFiles boot_arch_$(TARGET_KERNEL_ARCH).o ] :
$(kernelDebugSources)
$(kernelArchDriverSources)
$(kernelGenericDriverSources)
: # additional flags
:
$(kernelArchObjects)
$(kernelLibArchObjects)
;
SEARCH on [ FGristFiles $(kernelArchDriverSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
SEARCH on [ FGristFiles $(kernelGenericDriverSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ;
SEARCH on [ FGristFiles $(kernelDebugSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel debug ] ;
}
}

View File

@ -9,7 +9,7 @@ SEARCH_SOURCE += [ FDirName $(librootSources) os arch $(TARGET_ARCH) ] ;
SEARCH_SOURCE += [ FDirName $(librootSources) os arch generic ] ;
KernelMergeObject kernel_os_arch_$(TARGET_ARCH).o :
#byteorder.S
byteorder.S
generic_atomic.cpp
generic_system_time_nsecs.cpp

View File

@ -0,0 +1,63 @@
OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv")
OUTPUT_ARCH(riscv)
ENTRY(runtime_loader)
SEARCH_DIR("libgcc");
SECTIONS
{
. = 0x00100000 + SIZEOF_HEADERS;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
.rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
.rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
.rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
.rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
.rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : { *(.init) } =0x9090
.plt : { *(.plt) }
/* text/read-only data */
.text : { *(.text .gnu.linkonce.t.*) }
.rodata : { *(.rodata) }
/* writable data */
. = ALIGN(0x1000) + (. & (0x1000 - 1));
__data_start = .;
PROVIDE(_data_start = .);
.data : { *(.data .gnu.linkonce.d.*) }
__ctor_list = .;
PROVIDE (_ctor_list = .);
.ctors : { *(.ctors) }
PROVIDE (__ctor_end = .);
/* uninitialized data (in same segment as writable data) */
PROVIDE (__bss_start = .);
.bss : { *(.bss) }
. = ALIGN(0x1000);
PROVIDE (_end = .);
/* Strip unnecessary stuff */
/DISCARD/ : { *(.comment .note .dtors) }
}

View File

@ -23,6 +23,7 @@ for architectureObject in [ MultiArchSubDirSetup riscv64 ] {
thread.c
generic_atomic.cpp
generic_stack_trace.cpp
generic_system_time_nsecs.cpp
;
}