On x86, my system's default objcopy has a target pei-x86-64
that can be used to convert a shared object file to an EFI application. However, the list of supported targets in the riscv-gnu-toolchain
I recently built (riscv64-unknown-linux-gnu-gcc
) doesn't appear to include any target related to EFI, as shown below:
/opt/riscv/bin/riscv64-unknown-linux-gnu-objcopy: supported targets: elf64-littleriscv elf32-littleriscv elf32-bigriscv elf64-bigriscv elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex plugin
I wonder what tweak should I apply when building riscv-gnu-toolchain
and what target to use to output the proper EFI application file.
I tried to build riscv-gnu-toolchain
using the instructions below:
./configure --prefix=/opt/riscv
make linux
It generated a set of build tools for RV64 Linux.
I am expecting to see the targets like efi-app-riscv64
or pei-riscv64
listed when I run riscv64-unknown-linux-gnu-objcopy --help
. It allows me to convert the shared ELF file to a PE EFI application file.