-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RISCV64 driver does not have the proper EFI subsystem set #27
Comments
Yep, no 16bit REL |
Any chance we could just combine the 16-bit However, while my testing doing just that compiles without throwing any error (and without the need for the Am I missing something obvious? Or is just another RISCV64 toolchain limitation/bug? |
That also seems weird 😕 , it should work like that. Also DllCharacteristics is now populated by NX bit data for UEFI |
Hmm, further testing shows that the value we pass in |
The RISC64 do not support 16-bit variable relocation from assembly, and even if it did support relocations, it would not properly set the subsystem from --defsym. So we add an extra step on RISCV64, post objcopy, to set the field manually (using dd and /bin/echo to output the relevant byte, as GNU Make's echo does not support -ne). Closes ncroxon#27.
All things considered, I think our best course of action for now is to just add an extra step to our build that sets the |
Despite having an explicit
--defsym=EFI_SUBSYSTEM=0xb
in the linker command:It seems that the EFI subsystem is not properly applied to the RISCV64 driver, as the
riscv64
artifacts from the build that produced https://github.com/ncroxon/gnu-efi/actions/runs/9159433032/job/25179796521 show that thedrv0.efi
is still set as a UEFI Application (EFI_SUBSYSTEM=0xa
):This is also confirmed by trying to load the driver in with an UEFI firmware in QEMU RISCV64, which fails because of the wrong subsystem type.
Considering that we have an explicit:
in
gnuefi/crt0-efi-riscv64.S
that we don't have in other archs, and that removing it produces the error:I would think that the issue is that we need a delayed symbol resolution in
crt0-efi-riscv64.o
(since it goes intolibgnuefi.a
which we then link with the app, and which is the library that contains the PE header with theEFI_SUBSYSTEM
field), that either we haven't figured how to do, or that the current RISCV64 toolchain doesn't support yet...The text was updated successfully, but these errors were encountered: