Git Product home page Git Product logo

Comments (5)

gmbr3 avatar gmbr3 commented on July 29, 2024

Yep, no 16bit REL
(https://github.com/bminor/binutils-gdb/blob/92f59183ab085f5762650c3242a33119d161e668/bfd/elfxx-riscv.c#L973)
RISCV64 will have to use generator mode (like fwupd-efi) and/or objcopy
It can't support delayed symbol mode

from gnu-efi.

pbatard avatar pbatard commented on July 29, 2024

Any chance we could just combine the 16-bit Subsystem and subsequent 16-bit DllCharacteristics into a 32-bit, since we have 32bit REL? DllCharacteristics is always zero for UEFI and we are dealing with little endian values, so, on paper, this looks like a simpler workaround.

However, while my testing doing just that compiles without throwing any error (and without the need for the #ifndef EFI_SUBSYSTEM), the resulting Subsystem and DllCharacteristics fields in the PE are always set to 0. Yet, if I change the name of the EFI_SUBSYSTEM variable in the .S to something else, the linker will throw an error about undefined reference for that other name, which tends to indicate that the linker does see the 32-bit EFI_SUBSYSTEM as a delayed symbol, but it somehow still fail to populate it with the value we pass in --defsym=EFI_SUBSYSTEM...

Am I missing something obvious? Or is just another RISCV64 toolchain limitation/bug?

from gnu-efi.

gmbr3 avatar gmbr3 commented on July 29, 2024

Yet, if I change the name of the EFI_SUBSYSTEM variable in the .S to something else, the linker will throw an error about undefined reference for that other name, which tends to indicate that the linker does see the 32-bit EFI_SUBSYSTEM as a delayed symbol, but it somehow still fail to populate it with the value we pass in --defsym=EFI_SUBSYSTEM...

That also seems weird 😕 , it should work like that.

Also DllCharacteristics is now populated by NX bit data for UEFI

from gnu-efi.

pbatard avatar pbatard commented on July 29, 2024

Hmm, further testing shows that the value we pass in --defsym=EFI_SUBSYSTEM ends up in the .rodata section rather than in the header...

from gnu-efi.

pbatard avatar pbatard commented on July 29, 2024

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 SubSystem property after the objcopy step, and I have just proposed a patchset that does this.

from gnu-efi.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.