Re: [PATCH v3 01/20] kbuild: do not allocate .modinfo in vmlinux
From: Nathan Chancellor
Date: Thu Sep 17 2026 - 21:33:19 EST
On Thu, Sep 17, 2026 at 09:52:32AM -0700, Kees Cook wrote:
> On Thu, Sep 17, 2026 at 05:06:11PM +0100, Lorenzo Stoakes (ARM) wrote:
> > -# .modinfo in vmlinux.unstripped is aligned to 8 bytes for compatibility with
> > -# tools that expect vmlinux to have sufficiently aligned sections but the
> > -# additional bytes used for padding .modinfo to satisfy this requirement break
> > -# certain versions of kmod with
> > -#
> > -# depmod: ERROR: kmod_builtin_iter_next: unexpected string without modname prefix
> > -#
> > -# Strip the trailing padding bytes after extracting .modinfo to comply with
> > -# what kmod expects to parse.
>
> This comment still seems useful here (afaict the stripping is still
> happening with the "sed"). Maybe better to leave it, or future readers
> are left wondering what the sed is for?
Thanks for bringing this up. I think we can actually get rid of that sed
and comment altogether. It was added by
a26a6c93edfe ("kbuild: Strip trailing padding bytes from modules.builtin.modinfo")
to fix
d50f21091358 ("kbuild: align modinfo section for Secureboot Authenticode EDK2 compat")
but I do not think that this alignment is needed anymore since I
properly fixed Dimitri's issue in
8678591b4746 ("kbuild: Split .modinfo out from ELF_DETAILS")
So I think we could go with something like