From: Jiri Slaby <jirislaby@kernel.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>, x86@kernel.org
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] serial: icom: Fix namespace collision and startup() section placement with -ffunction-sections
Date: Wed, 19 Nov 2025 07:58:05 +0100 [thread overview]
Message-ID: <23f084ab-7b1a-485e-be1e-e639906fd5b3@kernel.org> (raw)
In-Reply-To: <45630ac97b19b8d3194763fe7f54bb3b498f3728.1763533593.git.jpoimboe@kernel.org>
On 19. 11. 25, 7:27, 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.
>
> This naming conflict causes the vmlinux linker script to wrongly place
> startup() function code in .init.text, which gets freed during boot.
This sounds rather error-prone. What are the patterns supposed to match
actually? Can't *those* real victims™ be renamed to something less
common instead?
> Fix that by renaming startup() to icom_startup(). For consistency, also
> rename its shutdown() counterpart to icom_shutdown().
I see also:
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c:static int
startup(struct v4l2_subdev *sd)
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:static int
startup(struct v4l2_subdev *sd)
drivers/tty/amiserial.c:static int startup(struct tty_struct *tty,
struct serial_state *info)
drivers/tty/synclink_gt.c:static int startup(struct slgt_info *info)
thanks,
--
js
suse labs
next prev parent reply other threads:[~2025-11-19 6:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-19 6:27 [PATCH] serial: icom: Fix namespace collision and startup() section placement with -ffunction-sections Josh Poimboeuf
2025-11-19 6:58 ` Jiri Slaby [this message]
2025-11-19 8:43 ` Peter Zijlstra
2025-11-19 8:44 ` Peter Zijlstra
2025-11-19 17:04 ` Josh Poimboeuf
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=23f084ab-7b1a-485e-be1e-e639906fd5b3@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=peterz@infradead.org \
--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