From: Josh Poimboeuf <jpoimboe@kernel.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans de Goede <hansg@kernel.org>
Subject: [PATCH 2/6] media: atomisp: gc2235: Fix namespace collision and startup() section placement with -ffunction-sections
Date: Thu, 20 Nov 2025 12:14:17 -0800 [thread overview]
Message-ID: <d28103a6edf7beceb5e3c6fa24e49dbad1350389.1763669451.git.jpoimboe@kernel.org> (raw)
In-Reply-To: <cover.1763669451.git.jpoimboe@kernel.org>
When compiled with -ffunction-sections (e.g., for LTO, livepatch, dead
code elimination, AutoFDO, or Propeller), the startup() function gets
compiled into the .text.startup section (or in some cases
.text.startup.constprop.0 or .text.startup.isra.0).
However, the .text.startup and .text.startup.* sections are also used 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.
Some builds have a mix of objects, both with and without
-ffunctions-sections, so it's not possible for the linker script to
disambiguate with #ifdef CONFIG_FUNCTION_SECTIONS or similar. This
means that "startup" unfortunately needs to be prohibited as a function
name.
Rename startup() to gc2235_startup().
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
index 6fc39ab95e46..6050637a0def 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
@@ -491,7 +491,7 @@ static int gc2235_s_power(struct v4l2_subdev *sd, int on)
return ret;
}
-static int startup(struct v4l2_subdev *sd)
+static int gc2235_startup(struct v4l2_subdev *sd)
{
struct gc2235_device *dev = to_gc2235_sensor(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -556,7 +556,7 @@ static int gc2235_set_fmt(struct v4l2_subdev *sd,
return 0;
}
- ret = startup(sd);
+ ret = gc2235_startup(sd);
if (ret) {
dev_err(&client->dev, "gc2235 startup err\n");
goto err;
--
2.51.1
next prev parent reply other threads:[~2025-11-20 20:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 20:14 [PATCH 0/6] objtool: More -ffunction-sections fixes Josh Poimboeuf
2025-11-20 20:14 ` [PATCH 1/6] serial: icom: Fix namespace collision and startup() section placement with -ffunction-sections Josh Poimboeuf
2025-11-21 9:57 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-11-20 20:14 ` Josh Poimboeuf [this message]
2025-11-21 9:57 ` [tip: objtool/core] media: atomisp: gc2235: " tip-bot2 for Josh Poimboeuf
2025-11-21 13:28 ` [PATCH 2/6] " Hans de Goede
2025-11-20 20:14 ` [PATCH 3/6] tty: amiserial: " Josh Poimboeuf
2025-11-21 9:57 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-11-20 20:14 ` [PATCH 4/6] tty: synclink_gt: " Josh Poimboeuf
2025-11-21 9:57 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-11-20 20:14 ` [PATCH 5/6] kbuild: Check for functions with ambiguous -ffunction-sections section names Josh Poimboeuf
2025-11-21 9:57 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-11-20 20:14 ` [PATCH 6/6] Revert "objtool: Warn on functions with ambiguous -ffunction-sections section names" Josh Poimboeuf
2025-11-21 9:57 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-11-21 7:00 ` [PATCH 0/6] objtool: More -ffunction-sections fixes Greg Kroah-Hartman
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=d28103a6edf7beceb5e3c6fa24e49dbad1350389.1763669451.git.jpoimboe@kernel.org \
--to=jpoimboe@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--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
all inboxes | Powered by JetHome®