Re: [PATCH] x86/boot: Discard .interp sections
From: Nam Le
Date: Wed Apr 08 2026 - 08:01:35 EST
On 08/04/2026 11:09, Borislav Petkov wrote:
> On Wed, Apr 08, 2026 at 04:58:08AM -0500, Segher Boessenkool wrote:
>> On Wed, Apr 08, 2026 at 11:52:02AM +0200, Borislav Petkov wrote:
>>> Sounds to me like you're shooting yourself in the foot on purpose:
>>
>> And no matter what this needs to add a comment there saying this is to
>> work around, hrm, imperfections in LLVM! So that people who hit
>> problems here later have something to start with.
>
> Right, I see --dynamic-linker=file in ld.bfd too. Why isn't that one slapping
> a section too?
>
> :-)
>
I am not sure why ld.bfd doesn't add the section in, but it seems the LLVM
maintainers have no plans of making ld.lld behave the same as ld.bfd
according to the comments made here:
Link: https://github.com/llvm/llvm-project/issues/78873#issuecomment-1902794108
> Sounds to me like you're shooting yourself in the foot on purpose:
>
> --dynamic-linker=value
> Specify the dynamic linker to be used for a dynamically linked executable.
> This is recorded in an ELF segment of type PT_INTERP.
>
> So don't do that then.
Normally I would never add this flag, but some package manager
(specifically Nix) adds --dynamic-linker as a default when
building any applications. Ideally this should be a fix on LLVM's side
of things since its a pretty significant difference in behavior between
ld.lld and ld.bfd, but for the meantime I believe this is a minimal enough
change to fix the issue.
> And no matter what this needs to add a comment there saying this is to
> work around, hrm, imperfections in LLVM! So that people who hit
> problems here later have something to start with.
Thank you for the advice! Should I add a comment and submit a v2 patch for the change?