Hi I was trying to figure out how to put the following risc-v code :
.globl _start
.extern main
.section .text
_start:
# Set up for c
la sp, _stack_top
jal ra, main
end: j end
Into the linker section sm :
ENTRY(_start)
MEMORY {
SM : ORIGIN = 0x80000000, LENGTH = 10M
ENCLAVE_TEXT : ORIGIN = 0x80000000 + 10M, LENGTH = 4M
ENCLAVE_DATA : ORIGIN = 0x80000000 + 14M, LENGTH = 4M
}
SECTIONS {
. = 0x80000000;
.sm : {
_sm_start = .;
*(main*)
*(boot*)
*(pmp*)
. = . +0x100000;
_stack_top = .;
_sm_end = .;
} > SM AT > SM
.enclave :{
_enclave_start = .;
*(enlcave*)
_enclave_end = .;
} > ENCLAVE_TEXT AT > ENCLAVE_TEXT
.enclave_data :{
_enclave_data_start = .;
. = . +0x100000;
_enclave_stack_top = .;
_enclave_data_end = .;
} > ENCLAVE_DATA AT > ENCLAVE_DATA
_end = .;
}
I tried changing section to .section .sm but it didn’t work I could not find any documentation on how to accomplish this online. Does anyone know how to accomplish this? Thanks in advance, jip.