# Linux kernel to support $ORIGIN via eBPF

Programmable interpreter selection coming to binfmt_misc subsystem.

- **Source:** [Hacker News](https://news.ycombinator.com)
- **Published:** 2026-07-21
- **Topic:** [Software & Engineering](https://brifing.si/c/engineering)
- **Original article:** <https://fzakaria.com/2026/07/20/linux-kernel-will-support-origin-sort-of>
- **On Brifing:** https://brifing.si/s/87468151-b9db-4473-a014-9bd3b72fb7d1

## Quest 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.

## Collaboration 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.

## Programmable 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.

## Special 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.

## Advanced 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.

## NixOS 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.

## Sources covering this story

- https://fzakaria.com/2026/07/20/linux-kernel-will-support-origin-sort-of — 

---

_Summary written by Brifing from the original reporting. Copyright in the original article belongs to its publisher; read the full piece at the link above._
