[PATCH] RISC-V: Add support for RISCV64 EFI(efi-*-riscv64)

Jan Beulich jbeulich@suse.com
Mon Nov 28 07:50:12 GMT 2022


On 28.11.2022 07:35, jiawei wrote:
> This adds support for efi-*-riscv64 by virtue of adding a new PEI target pei-
> riscv64. This is not a full target and only exists to support EFI at 
> this time.

Just some general remarks below; I haven't looked at the changes
themselves, yet (and I also can't promise I would get to doing so any
time soon).

> This means that this target does not support relocation processing and is mostly
> a container format.  This format has been added to elf based riscv64 targets
> such that efi images can be made natively on Linux.

Hmm, I have reservations (not just for RISC-V) against this objcopy-only
model. It would imo be better if ld was made capable of producing EFI
binaries (and then likely also other PE ones) from ELF input, like is
possible for at least some other targets (e.g. x86).

Furthermore I also question the usefulness of conversion without reloc
handling. This may help with images built into firmware, but anything
you can load at runtime may not be loadable at all if the address range
it was linked for is occupied or otherwise unavailable, and if the
image cannot be relocated because relocations were stripped (and the
image is marked accordingly).

> However this target is not valid for use with gas but only with objcopy.

I guess you mean ld, not gas here? PE is an executable file format after all,
not an object file one. It would be COFF there ...

Jan


More information about the Binutils mailing list