每日 Harness 开源 · Source
返回本期 · Back to 2026-07-22

博客文章 · Blog Posts2026-07-22 · Wednesday, July 22, 2026

Linux kernel will support `$ORIGIN`, sort of

fzakaria.com原文 ↗

Linux kernel will support `$ORIGIN`, sort of
Farid Zakaria 最初想让 Nix 二进制在 `PT_INTERP` 和 shebang 中使用 `$ORIGIN`,内核讨论最终演化成更通用的 eBPF `binfmt_misc` 解释器选择机制。配套的 `L` loader-substitution 模式让目标 ELF 仍是主映像,只替换动态加载器,因而不会像传统 hand-off 那样破坏 `argv[0]` 与 `/proc/self/exe`。若进入正式版本,Nix/Bazel 可用显式 ELF 段选择相对加载器,实现更干净的可搬移二进制;目前仍应视为待进入 `-next` 和发布周期的内核工作。
浏览

评论 · Comments