Re: [PATCH] x86/boot: Discard .interp sections

From: Michael Matz

Date: Wed Apr 08 2026 - 08:10:53 EST


Hello,

On Wed, 8 Apr 2026, 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?

It does normally. (See any random executable file in /bin/)
But section layout can and does differ between ld.bfd and ld.lld (and for
bfd it depends on the linker script), so it's probably simply not getting
in the way of your explicitely placed sections with ld.bfd. You might be
interested in --no-dynamic-linker or -static, no idea what the current
needs of the kernel vmlinux image are.


Ciao,
Michael.