From: "tip-bot2 for Josh Poimboeuf" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: objtool/core] tty: amiserial: Fix namespace collision and startup() section placement with -ffunction-sections
Date: Fri, 21 Nov 2025 09:57:52 -0000 [thread overview]
Message-ID: <176371907263.498.16211124701635103033.tip-bot2@tip-bot2> (raw)
In-Reply-To: <9e56afff5268b0b12b99a8aa9bf244d6ebdcdf47.1763669451.git.jpoimboe@kernel.org>
The following commit has been merged into the objtool/core branch of tip:
Commit-ID: 845c09e4744f111eae894ad3b67a369bb43d50fb
Gitweb: https://git.kernel.org/tip/845c09e4744f111eae894ad3b67a369bb43d50fb
Author: Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate: Thu, 20 Nov 2025 12:14:18 -08:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 21 Nov 2025 10:04:09 +01:00
tty: amiserial: Fix namespace collision and startup() section placement with -ffunction-sections
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 rs_startup(). For consistency, also rename its
shutdown() counterpart to rs_shutdown().
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/9e56afff5268b0b12b99a8aa9bf244d6ebdcdf47.1763669451.git.jpoimboe@kernel.org
---
drivers/tty/amiserial.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index 5af4644..81eaca7 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -438,7 +438,7 @@ static irqreturn_t ser_tx_int(int irq, void *dev_id)
* ---------------------------------------------------------------
*/
-static int startup(struct tty_struct *tty, struct serial_state *info)
+static int rs_startup(struct tty_struct *tty, struct serial_state *info)
{
struct tty_port *port = &info->tport;
unsigned long flags;
@@ -513,7 +513,7 @@ errout:
* This routine will shutdown a serial port; interrupts are disabled, and
* DTR is dropped if the hangup on close termio flag is on.
*/
-static void shutdown(struct tty_struct *tty, struct serial_state *info)
+static void rs_shutdown(struct tty_struct *tty, struct serial_state *info)
{
unsigned long flags;
@@ -975,7 +975,7 @@ check_and_exit:
change_speed(tty, state, NULL);
}
} else
- retval = startup(tty, state);
+ retval = rs_startup(tty, state);
tty_unlock(tty);
return retval;
}
@@ -1251,9 +1251,9 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
*/
rs_wait_until_sent(tty, state->timeout);
}
- shutdown(tty, state);
+ rs_shutdown(tty, state);
rs_flush_buffer(tty);
-
+
tty_ldisc_flush(tty);
port->tty = NULL;
@@ -1325,7 +1325,7 @@ static void rs_hangup(struct tty_struct *tty)
struct serial_state *info = tty->driver_data;
rs_flush_buffer(tty);
- shutdown(tty, info);
+ rs_shutdown(tty, info);
info->tport.count = 0;
tty_port_set_active(&info->tport, false);
info->tport.tty = NULL;
@@ -1349,7 +1349,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
port->tty = tty;
tty->driver_data = info;
- retval = startup(tty, info);
+ retval = rs_startup(tty, info);
if (retval) {
return retval;
}
next prev parent reply other threads:[~2025-11-21 9:57 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 ` [PATCH 2/6] media: atomisp: gc2235: " Josh Poimboeuf
2025-11-21 9:57 ` [tip: objtool/core] " 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-bot2 for Josh Poimboeuf [this message]
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=176371907263.498.16211124701635103033.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.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®