From nobody Tue Dec 2 02:05:25 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC61932FA11 for ; Thu, 20 Nov 2025 20:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763669703; cv=none; b=NYvCaKpqWN3EYzL205nsFcgdMhEJMSubgNUu0dCJCYkrlQHQhi+P8ACipsdfbYMgsAsFx+tMcwLgobeLekZQSViZk0sZ7iGjaKExZIeEKaw/gWc1Kpynag8mHO45JP8TSIPUK9D9ZRJR0XiNq6YEQE5U1+FPHJE9PM7PTm8jhhE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763669703; c=relaxed/simple; bh=iPe4wuZpLzda23MC4hWzxQHIeC44yhRipkTmvW8g5SQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EABsTNob/KvXLBBYBrImDcdx9fDdzFbQmJAtWOKl4s69kf6bIizPC/By7IF0OnY3gC/BXnriwgEZM9Za0HfhOmxzWG5wTLRo+XsxwumSNHbYzw5bQ9Z2bIbcvN5iHMPLwmOmoqFbZtaSB/RNz7N9MH3HwotJUBB7EmDQ+DCLt10= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nWILMF4q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nWILMF4q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA4F0C19422; Thu, 20 Nov 2025 20:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763669703; bh=iPe4wuZpLzda23MC4hWzxQHIeC44yhRipkTmvW8g5SQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nWILMF4qKGTBnVeXM51tNEY5plP0KA7sczNNq1QxkSO7nrYjVHyXPfmmar9x+levX OHSOj3nhg3pIVChZ8gvvYIeU/Jf0QvRPc4EfHRWGkpPRtsHrSZMF2ailPh9Q7LTx0R rX/+fRSapSrFLFvz7mvCFyrvksQBT33dtnvcn9nh1bA6ajNnzcSVh3bF+ZlsKsAZQ7 3XEMPVFHFS9b4gmTA+sfEdtZzrbbSp+PHMQCKjl3MKxHJP/vhapmlfrHr1QyI9E6SY HEkZFM3YUJqKNWQ9H5M+W2zdCAOzxD4cYz9gTiZ1RjJZhjpbaMGPj06oM7pMqS80xz 7hXzzWYKRJr7Q== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Greg Kroah-Hartman , Jiri Slaby , Mauro Carvalho Chehab , Hans de Goede Subject: [PATCH 1/6] serial: icom: Fix namespace collision and startup() section placement with -ffunction-sections Date: Thu, 20 Nov 2025 12:14:16 -0800 Message-ID: <1aee9ef69f9d40405676712b34f0c397706e7023.1763669451.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 icom_startup(). For consistency, also rename its shutdown() counterpart to icom_shutdown(). Signed-off-by: Josh Poimboeuf --- drivers/tty/serial/icom.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c index 7fb995a8490e..d00903cfa841 100644 --- a/drivers/tty/serial/icom.c +++ b/drivers/tty/serial/icom.c @@ -760,7 +760,7 @@ static void load_code(struct icom_port *icom_port) dma_free_coherent(&dev->dev, 4096, new_page, temp_pci); } =20 -static int startup(struct icom_port *icom_port) +static int icom_startup(struct icom_port *icom_port) { unsigned long temp; unsigned char cable_id, raw_cable_id; @@ -832,7 +832,7 @@ static int startup(struct icom_port *icom_port) return 0; } =20 -static void shutdown(struct icom_port *icom_port) +static void icom_shutdown(struct icom_port *icom_port) { unsigned long temp; unsigned char cmdReg; @@ -1311,7 +1311,7 @@ static int icom_open(struct uart_port *port) int retval; =20 kref_get(&icom_port->adapter->kref); - retval =3D startup(icom_port); + retval =3D icom_startup(icom_port); =20 if (retval) { kref_put(&icom_port->adapter->kref, icom_kref_release); @@ -1333,7 +1333,7 @@ static void icom_close(struct uart_port *port) cmdReg =3D readb(&icom_port->dram->CmdReg); writeb(cmdReg & ~CMD_RCV_ENABLE, &icom_port->dram->CmdReg); =20 - shutdown(icom_port); + icom_shutdown(icom_port); =20 kref_put(&icom_port->adapter->kref, icom_kref_release); } --=20 2.51.1