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

jiawei@iscas.ac.cn jiawei@iscas.ac.cn
Mon Nov 28 15:08:05 GMT 2022




> -----原始邮件-----
> 发件人: "Jan Beulich" <jbeulich@suse.com>
> 发送时间: 2022-11-28 15:50:12 (星期一)
> 收件人: jiawei <jiawei@iscas.ac.cn>
> 抄送: nelson@rivosinc.com, kito.cheng@sifive.com, palmer@rivosinc.com, christoph.muellner@vrull.eu, philipp.tomsich@vrull.eu, felixonmars@archlinux.org, wuwei2016@iscas.ac.cn, binutils@sourceware.org
> 主题: Re: [PATCH] RISC-V: Add support for RISCV64 EFI(efi-*-riscv64)
> 
> 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).

Thanks for your comments, you are right, I think this only a partial 

implement for efistub support: 

https://man.archlinux.org/man/core/systemd/linuxaa64.efi.stub.7.en

> 
> > 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

Yes, it just mean it can verify with using objdump. Added a testcase to verify
that if we can use target 'pei-riscv'.


</jiawei@iscas.ac.cn></jbeulich@suse.com>


More information about the Binutils mailing list