]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tty: amiserial: Fix namespace collision and startup() section placement with -ffuncti...
authorJosh Poimboeuf <jpoimboe@kernel.org>
Thu, 20 Nov 2025 20:14:18 +0000 (12:14 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 21 Nov 2025 09:04:09 +0000 (10:04 +0100)
commit845c09e4744f111eae894ad3b67a369bb43d50fb
treec9ffab6af9c715316ed94dad947643ae1819fff7
parent2c715c9de293b6c05bcdff1c22a7626f3bb42492
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