rvc/rust_payload/linker.ld
Stefan 7f47c7655d Add rust_payload and fixes to allow running it as supervisor
Note that the 'riscv32ima-unknown-none-elf' target is not available by
default in rustc, you need a patched version.

I'm also pretty sure just converting the ELF binary to raw using objdump
messes with stack and heap addresses, but it seems to work fine for now.
2021-06-09 18:38:46 +02:00

31 lines
424 B
Plaintext

OUTPUT_ARCH( "riscv" )
ENTRY( _start )
MEMORY
{
ram (rwx) : ORIGIN = 0x80400000, LENGTH = 0x800000
}
SECTIONS
{
.kernel : {
*(.start_here)
*(.text .text.*)
*(.rodata .rodata.*)
*(.data .data.*)
} > ram
.stack (NOLOAD) : {
. = . + 0x20000;
PROVIDE(_end_stack = .);
} > ram
.heap (NOLOAD) : {
PROVIDE(_begin_heap = .);
. = . + 0x40000;
PROVIDE(_end_heap = .);
} > ram
}