Linux kernel to support $ORIGIN via eBPF
Programmable interpreter selection coming to binfmt_misc subsystem.
1Quest for Relocatable Binaries in Nix
During TacoSprint 2026, research began for relocatable binary support in Nix. The idea emerged to add $ORIGIN support in Linux kernel, allowing dynamic loader paths to be determined relative to executable location.
2Collaboration with Kernel Community
VFS maintainer Christian Brauner responded positively and proposed an eBPF-based programmable solution. This approach goes beyond $ORIGIN support, offering flexibility in interpreter selection.
3Programmable Solution with eBPF
eBPF (extended Berkeley Packet Filter) allows writing programs in a C subset that compile to kernel VM. The new patch series enables dynamic interpreter selection via eBPF programs in binfmt_misc subsystem.
4Special Implementation for Nix
Sample eBPF program recognizes ELF files and provides $ORIGIN support. This facilitates Nix's relocatable binary goals while maintaining backward compatibility through new segments like PT_INTERP_NIX.
5Advanced Features
The patch series even allows replacing QEMU binfmt_misc registration with eBPF. Features like $ORIGIN in shebangs and loader substitution (L flag) solve process identity issues while keeping stock dynamic loaders functional.
6NixOS Integration Plans
After patches land in -next branch, a NixOS module will be upstreamed to enable $ORIGIN support at boot. This marks a significant step forward for relocatable binaries in Linux ecosystem.
Original article: Hacker News — Linux çekirdeği $ORIGIN desteği ekliyor