Comments (5)
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.
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.
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-bitEFI_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.
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.
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)
- Migration to GitHub is not complete HOT 3
- gnu-efi-3.0.18 fails to link with lld as linker
- gnu-efi 3.0.16+ breaks AArch64 EFI binaries HOT 6
- Align ReallocatePool() parameters with EDK2 HOT 2
- Move riscv64 crt0 to objcopy HOT 3
- Avoid wchar_t by moving to C11 types HOT 1
- MIPS64: Compilation error on Ubuntu 24.04 HOT 5
- Debug files not installed to correct directory HOT 1
- Cant compile on m2 mac HOT 6
- macOS support is missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gnu-efi.