public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] vmlinux.lds: Fix TEXT_MAIN to include .text.start and friends
Date: Thu, 6 Nov 2025 10:35:02 +0100	[thread overview]
Message-ID: <20251106093502.GS4067720@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <2fm4yxe6nr6khoyjmo7r7v4u4zxwygz3wch2vb5yolo2tqjsx7@s27lvvoe6x3j>

On Wed, Nov 05, 2025 at 10:55:19PM -0800, Josh Poimboeuf wrote:
> On Tue, Nov 04, 2025 at 10:11:42PM -0800, Josh Poimboeuf wrote:
> > Since commit 6568f14cb5ae ("vmlinux.lds: Exclude .text.startup and
> > .text.exit from TEXT_MAIN"), the TEXT_MAIN macro uses a series of
> > patterns to prevent the .text.startup[.*] and .text.exit[.*] sections
> > from getting linked into vmlinux runtime .text.
> > 
> > That commit is a tad too aggressive: it also inadvertently filters out
> > valid runtime text sections like .text.start and
> > .text.start.constprop.0, which can be generated for a function named
> > start() when -ffunction-sections is enabled.
> > 
> > As a result, those sections become orphans when building with
> > CONFIG_LD_DEAD_CODE_DATA_ELIMINATION for arm:
> > 
> >   arm-linux-gnueabi-ld: warning: orphan section `.text.start.constprop.0' from `drivers/usb/host/sl811-hcd.o' being placed in section `.text.start.constprop.0'
> >   arm-linux-gnueabi-ld: warning: orphan section `.text.start.constprop.0' from `drivers/media/dvb-frontends/drxk_hard.o' being placed in section `.text.start.constprop.0'
> >   arm-linux-gnueabi-ld: warning: orphan section `.text.start' from `drivers/media/dvb-frontends/stv0910.o' being placed in section `.text.start'
> >   arm-linux-gnueabi-ld: warning: orphan section `.text.start.constprop.0' from `drivers/media/pci/ddbridge/ddbridge-sx8.o' being placed in section `.text.start.constprop.0'
> > 
> > Fix that by explicitly adding the partial "substring" sections (.text.s,
> > .text.st, .text.sta, etc) and their cloned derivatives.
> > 
> > While this unfortunately means that TEXT_MAIN continues to grow, these
> > changes are ultimately necessary for proper support of
> > -ffunction-sections.
> > 
> > Fixes: 6568f14cb5ae ("vmlinux.lds: Exclude .text.startup and .text.exit from TEXT_MAIN")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202511040812.DFGedJiy-lkp@intel.com/
> > Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> > ---
> > For tip/objtool/core.
> 
> Nack.
> 
> There are still some additional headaches that need fixing.

Hah, good thing I was otherwise pre-occupied yesterday.

I'll await a new version then!

      reply	other threads:[~2025-11-06  9:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05  6:11 [PATCH] vmlinux.lds: Fix TEXT_MAIN to include .text.start and friends Josh Poimboeuf
2025-11-06  6:55 ` Josh Poimboeuf
2025-11-06  9:35   ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251106093502.GS4067720@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox