# Linux Kernel Gains $ORIGIN Support via eBPF and binfmt_misc

Original title: Linux kernel will support $ORIGIN, sort of

> Hacker News story 48988793 · language: en · submitted 2026-07-21
> Web version: https://zeli.app/story/48988793
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 91 · by [ingve](<https://news.ycombinator.com/user?id=ingve>) · 💬 74
[original](<https://fzakaria.com/2026/07/20/linux-kernel-will-support-origin-sort-of>) · [HN discussion](<https://news.ycombinator.com/item?id=48988793>)

## Summary

I proposed adding $ORIGIN support to the Linux kernel for relocatable Nix binaries, expecting rejection. Instead, maintainer Christian Brauner collaborated on a solution using eBPF and binfmt_misc. This breakthrough allows dynamic interpreter selection and transparent execution, enabling powerful new use cases for tools like Nix, Buck, and Bazel while maintaining full backwards compatibility.

## Key quote

> A ship in harbor is safe, but that is not what ships are built for.

## HN discussion (74 comments)

### [nextaccountic](<https://news.ycombinator.com/item?id=48989212>)

> I was confused on what $ORIGIN means, so, macroexpanding the article a bit
>
> https://fzakaria.com/2026/06/21/nix-needs-relocatable-binari...
>
> \> The loader in Linux however natively supports the variable $ORIGIN which translates to “the directory containing the executable.”
>
> https://man7.org/linux/man-pages/man8/ld.so.8.html
>
> But, if ld.so supports $ORIGIN already, why does the kernel needs to support it also? Or rather, why can't the kernel leverage ld.so and do this entirely on userspace?

### [wzdd](<https://news.ycombinator.com/item?id=48990045>)

> My reaction was negative when I read the title (policy!), but the actual outcome was very reasonable. "Hey, can we add $ORIGIN to the VFS layer to support relocatable interpreters?" "You can already do that with binfmt_misc and ebpf, here's an example."
>
> Then, later, a couple of patches to make binfmt_misc more ergonomic. Seems like a good outcome.

### [stabbles](<https://news.ycombinator.com/item?id=48989300>)

> Nice, PT_INTERP is the only non-relocatable thing of ELF files and typically requires wrapper scripts/executables.
>
> Regarding shebangs, I've never understood why the kernel cannot resolve e.g. `#!sh` relative to PATH instead of CWD. Posix prescribes that you should look for `sh` in PATH and don't expect it to be in `/bin/sh`. And using `/usr/bin/env sh` has the same issue: what if coreutils is installed elsewhere.

---

## Cite

- Page: https://zeli.app/story/48988793
- Date: 2026-07-21
- Source: fzakaria.com (https://fzakaria.com/2026/07/20/linux-kernel-will-support-origin-sort-of)
- Hacker News: https://news.ycombinator.com/item?id=48988793

## Other languages

- zh: https://zeli.app/zh/story/48988793 · markdown: https://zeli.app/zh/story/48988793.md
- ja: https://zeli.app/ja/story/48988793 · markdown: https://zeli.app/ja/story/48988793.md
- ko: https://zeli.app/ko/story/48988793 · markdown: https://zeli.app/ko/story/48988793.md
- de: https://zeli.app/de/story/48988793 · markdown: https://zeli.app/de/story/48988793.md
- es: https://zeli.app/es/story/48988793 · markdown: https://zeli.app/es/story/48988793.md
