Re: [PATCH 2/4] media: atomisp: Fix startup() section placement with -ffunction-sections
Peter Zijlstra <[email protected]> Fri, 14 Nov 2025 09:56:57 +0100
| Newsgroups | org.kernel.vger.linux-toolchains,org.kernel.vger.linux-kernel,org.kernel.vger.live-patching |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Nov 12, 2025 at 03:47:49PM -0800, Josh Poimboeuf wrote: > When compiling the kernel with -ffunction-sections (e.g., for LTO, > livepatch, dead code elimination, AutoFDO, or Propeller), the startup() > function gets compiled into the .text.startup section. In some cases it > can even be cloned into .text.startup.constprop.0 or > .text.startup.isra.0. > > However, the .text.startup and .text.startup.* section names are already > reserved for use by the compiler for __attribute__((constructor)) code. > Urgh, that's a 'fun' one. Is this not a -ffunction-sections bug? I mean, the compiler should never put regular non-reserved user symbols in a section it has reserved for itself, right?