Re: extlinux can't boot kernel after commit "kbuild: keep .modinfo section in vmlinux.unstripped"

From: Ed W

Date: Wed Feb 25 2026 - 06:58:57 EST


Hi Nathan (and Thorsten), thanks for replying! Appreciated

On 24/02/2026 20:46, Nathan Chancellor wrote:
> So I will deal with this one, as I committed the series.


Thanks so much!!


>>> My guess is that something has moved or become re-ordered such that the extlinux is rejecting the
>>> image?? 
>>>
>>> At this point I'm honestly not quite sure what I am doing, so would some kind soul please help me
>>> figure out what is happening? I apologise in advance that I've likely not given enough information
>>> about the problem, please be gentle...
> I think you provided good information off the bat, so no worries on that
> front. I am not entirely positive that this is the root cause but now
> that I am looking at it and have some additional context from a recent
> 7.0-rc1 commit [1], I think 3e86e4d74c04 adding .modinfo to ELF_DETAILS
> and removing it from DISCARDS results in .modinfo appears in certain
> places, namely arch/x86/boot/compressed/vmlinux, where it may not be
> expected. Why that breaks this bootloader, not sure, but I don't really
> think it matters. I think we should move .modinfo from ELF_DETAILS
> (which may be used in other non-vmlinux linker scripts) to its own
> macro, add that to all vmlinux linker scripts, and discard it from
> places where it used to be properly discarded. More code but I think
> it will result in fewer problems. As far as I can tell, this is the
> reason that commit d50f21091358 ("kbuild: align modinfo section for
> Secureboot Authenticode EDK2 compat") was needed and that change needed
> a further follow up fix in commit a26a6c93edfe ("kbuild: Strip trailing
> padding bytes from modules.builtin.modinfo"), so we could have saved
> some headache from doing it right from the beginning.
>
> Ed, could you test the below patch with your setup (it should apply
> cleanly to 6.18.13, 6.19.3, or 7.0-rc1) and see if it resolves your
> issue?
>
> [1] ddc6cbef3ef1 ("s390/boot/vmlinux.lds.S: Ensure bzImage ends with SecureBoot trailer")
>
> Cheers,
> Nathan


Yes, your patch works fine against my 6.18.12 kernel on my AMD64 machine and booting with extlinux
(previously not working)

I also played around a little with some variations and it seems as though the adding in of the
.modinfo into the strip is the key, caveat that in my messing around (based on inspiration from the
commit [1] that you mention), I needed to reorder the macros to get it to compile. Note, I'm not
suggestion this as a solution, just illustrating some extra info:

--- arch/x86/boot/compressed/vmlinux.lds.S.orig    2026-02-25 10:42:45.040655315 +0000
+++ arch/x86/boot/compressed/vmlinux.lds.S    2026-02-25 11:06:32.907372114 +0000
@@ -80,17 +80,18 @@
     . = ALIGN(PAGE_SIZE);    /* keep ZO size page aligned */
     _end = .;

-    STABS_DEBUG
-    DWARF_DEBUG
-    ELF_DETAILS
-
     DISCARDS
     /DISCARD/ : {
         *(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss)
         *(.hash) *(.gnu.hash)
         *(.note.*)
+        *(.modinfo)
     }

+    STABS_DEBUG
+    DWARF_DEBUG
+    ELF_DETAILS
+
     .got.plt (INFO) : {
         *(.got.plt)
     }


Thanks for isolating the issue!

Ed W