Okay that should work fine I guess. Try and search for how to use gdb with QEMU
However,after I edited my elf2efi,the error still occurs in RV64(Risc-V 64),other three platforms are running successfully.
UEFI internal debugger told me this and this is where error occurs:
.section .text.n_uefi_$$_efi_initialize$pointer$pefi_system_table,"ax"
.balign 8
.globl UEFI_$$_EFI_INITIALIZE$POINTER$PEFI_SYSTEM_TABLE
.type UEFI_$$_EFI_INITIALIZE$POINTER$PEFI_SYSTEM_TABLE,@function
UEFI_$$_EFI_INITIALIZE$POINTER$PEFI_SYSTEM_TABLE:
.globl EFI_INITIALIZE
.type EFI_INITIALIZE,@function
EFI_INITIALIZE:
.Lc8:
# [2858] begin
addi x2,x2,-16
sd x1,8(x2)
sd x8,0(x2)
addi x8,x2,16
addi x2,x2,-104
# Var InputImageHandle located in register x10
# Var InputSystemTable located in register x11
# Var InputImageHandle located in register x10
.La1:
# [2859] ParentImageHandle:=InputImageHandle; GlobalSystemTable:=InputSystemTable;
auipc x12,%got_pcrel_hi(TC_$UEFI_$$_PARENTIMAGEHANDLE)
ld x12,%pcrel_lo(.La1)(x12)
sd x10,0(x12) # where the error occurs
# Var InputSystemTable located in register x11
.La2:
auipc x10,%got_pcrel_hi(TC_$UEFI_$$_GLOBALSYSTEMTABLE)
ld x10,%pcrel_lo(.La2)(x10)
sd x11,0(x10)
# [2860] end;
ld x8,104(x2)
ld x1,112(x2)
addi x2,x2,120
jalr x0,x1
.Lc7:
.Le3:
.size UEFI_$$_EFI_INITIALIZE$POINTER$PEFI_SYSTEM_TABLE, .Le3 - UEFI_$$_EFI_INITIALIZE$POINTER$PEFI_SYSTEM_TABLE
This is the error type:
!!!! RISCV64 Exception Type - 000000000000000F(EXCEPT_RISCV_STORE_ACCESS_PAGE_FAULT) !!!!
t0 = 0x00000000000001000 t1 = 0x00000000083FFF620
t2 = 0x00000000000001000 t3 = 0x0FFFFFFFFBC62157E
t4 = 0x00000000000003E33 t5 = 0x00000000000004FEC
t6 = 0x00000000000000004 s0 = 0x00000000083FFF610
s1 = 0x00000000000000013 s2 = 0x00000000000000000
s3 = 0x00000000000000000 s4 = 0x000000000BFE00000
s5 = 0x0000000017FFFE018 s6 = 0x08000000A00006800
s7 = 0x00000000000000004 s8 = 0x00000000000002000
s9 = 0x00000000080043710 s10 = 0x00000000000000000
s11 = 0x00000000000000000 a0 = 0x0000000017F2AB998
a1 = 0x0000000017FFFE018 a2 = 0x00000000000000000
a3 = 0x00000000000000000 a4 = 0x0000000017FFFE018
a5 = 0x0000000017E2DFA88 a6 = 0x00000000000000006
a7 = 0x0000000000000000E zero = 0x00000000000000000
ra = 0x0000000017E2DFAD0 sp = 0x0000000017FE14D78
gp = 0x00000000000000000 tp = 0x0000000008004E000
sepc = 0x0000000017E2E06BC sstatus = 0x08000000200006120
stval = 0x00000000000000000