You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it is not possible to determine the target platform from the contents of an ELF. A program compiled against Linux headers looks the same as a programs compiled against Windows ones. This is a problem for projects which need to support loading ELF from both platforms because while the ELF are superficially similar the contents aren't compatible:
lmb
changed the title
Make it possible to discern ELF targeting eBPF for Windows from ones targeting Linux
Discern ELF targeting eBPF for Windows from ones targeting Linux
Oct 27, 2024
I'll send a PR which adds a temporary workaround to one of the headers in this project. I won't do the upstream discussion how to make this cross platform.
lmb
added a commit
to isovalent/ebpf-for-windows
that referenced
this issue
Oct 30, 2024
Compiling against Windows eBPF headers produces object files which are not easily
distinguishable from object files compiled against Linux headers. This is a problem
for cross-platform tooling which wishes to inspect the contents of an ELF.
Emit a section .ebpf_for_windows with the contents 0x01 into ELFs compiled against
the windows headers.
Updates microsoft#3956
Compiling against Windows eBPF headers produces object files which are not easily
distinguishable from object files compiled against Linux headers. This is a problem
for cross-platform tooling which wishes to inspect the contents of an ELF.
Emit a section .ebpf_for_windows with the contents 0x01 into ELFs compiled against
the windows headers.
Updates microsoft#3956
Compiling against Windows eBPF headers produces object files which are not easily
distinguishable from object files compiled against Linux headers. This is a problem
for cross-platform tooling which wishes to inspect the contents of an ELF.
Emit a section .ebpf_for_windows with the contents 0x01 into ELFs compiled against
the windows headers.
Updates #3956
Describe the feature you'd like supported
Right now it is not possible to determine the target platform from the contents of an ELF. A program compiled against Linux headers looks the same as a programs compiled against Windows ones. This is a problem for projects which need to support loading ELF from both platforms because while the ELF are superficially similar the contents aren't compatible:
There should be a way for toolchains to figure out the platform of an ELF.
Proposed solution
.license
which contains a string that indicates the platform, e.g.windows
orlinux
.It would be best if this was coordinated with upstream libbpf somehow.
Additional context
No response
The text was updated successfully, but these errors were encountered: