Changeset View
Changeset View
Standalone View
Standalone View
sys/conf/ldscript.riscv
/* $FreeBSD$ */ | /* $FreeBSD$ */ | ||||
OUTPUT_ARCH(riscv) | OUTPUT_ARCH(riscv) | ||||
ENTRY(_start) | ENTRY(_start) | ||||
SEARCH_DIR(/usr/lib); | SEARCH_DIR(/usr/lib); | ||||
/* | |||||
* Set the ELF LMA to the address that OpenSBI's fw_jump jumps to. This allows | |||||
* us to load the kernel with the -kernel flag in QEMU without having to embed | |||||
* it inside BBL or OpenSBI's fw_payload first. | |||||
*/ | |||||
__OPENSBI_FW_JUMP_ADDR__ = 0x80200000; /* Note: 0x80400000 for RISCV32 */ | |||||
mhorne: I think you could drop the trailing underscores here, but that's totally up to you. I had a… | |||||
SECTIONS | SECTIONS | ||||
{ | { | ||||
/* Read-only sections, merged into text segment: */ | /* Read-only sections, merged into text segment: */ | ||||
. = kernbase; | . = kernbase; | ||||
.text : AT(ADDR(.text) - kernbase) | .text : AT(__OPENSBI_FW_JUMP_ADDR__) | ||||
{ | { | ||||
*(.text) | *(.text) | ||||
*(.stub) | *(.stub) | ||||
/* .gnu.warning sections are handled specially by elf32.em. */ | /* .gnu.warning sections are handled specially by elf32.em. */ | ||||
*(.gnu.warning) | *(.gnu.warning) | ||||
*(.gnu.linkonce.t*) | *(.gnu.linkonce.t*) | ||||
} =0x9090 | } =0x9090 | ||||
_etext = .; | _etext = .; | ||||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |
I think you could drop the trailing underscores here, but that's totally up to you. I had a glance through our other linker scripts but I didn't find a good precedent.