From nobody Tue Dec 2 02:05:21 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 D61D6307491 for ; Thu, 20 Nov 2025 20:15:04 +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=1763669704; cv=none; b=W0R06YU7z6ga3LjB/gDazK4NRPoKt4R/zFv795KmguZRYgT5Njr2v/QudwbcXxM4OQ1fyaWtYE62MWM5U6uoZ1VpuSRg7RYOd/d69AeRnRZVdKLUqX4r2uP5ZcvLo5hij+Zm4P1tfq8J2lHhun63VPXQ5kJEJqHOWGItHuUIYqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763669704; c=relaxed/simple; bh=sgi0YKniZ5UAMrG3Hm817p4oZ2+hI2zUnCoWIqMhEdc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DWmQ55X914NgyGMU9e1fI4Gdt97qj4o8QkaG8gKDPd3MENzxC6Fd0Xg4KNimg88l/T5bdCA1YW8GyaBD3uiHXg/lUSLdy+JNBFzrmqsTfDqhNMNf94GimJpPjFD7QRSwGuMTy+3WitidXx7hy0HKNdrPbMuw9t7YvnNdGo9/geU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JdHnRC5t; 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="JdHnRC5t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24792C16AAE; Thu, 20 Nov 2025 20:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763669704; bh=sgi0YKniZ5UAMrG3Hm817p4oZ2+hI2zUnCoWIqMhEdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JdHnRC5tthFf28DfKjBjbXYUFrWSax0cDXzRgEpXWHrAlkGUfsIhVJXv3mPYgr62x sdSR1AJrJV+zPSvH0KnxXa6XjjMGq/27qblDj0+hrbF8dNTjsYy12GIh7uE8hQ5Nij 9kJf1WIEYe6UTM3DVZ18lUbTDgAiNiaFTb47zWd+vj822DKsLRWO8XiT8fM8gYCVmt FqyI8gwT26VMhwCkbtl2vzM+QPAMyawo7iW/oNT88S+iqjz7876QKmKfose666bRcB Xy11DiHNYDw0WpemCn7qSMFn+8O3kTsQeV9VN0XnKBK+t11mzfEjIpUWijVxkmzfBA RSHNvhB6jCJNg== 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 4/6] tty: synclink_gt: Fix namespace collision and startup() section placement with -ffunction-sections Date: Thu, 20 Nov 2025 12:14:19 -0800 Message-ID: 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 startup_hw(). For consistency, also rename its shutdown() counterpart to shutdown_hw(). Signed-off-by: Josh Poimboeuf --- drivers/tty/synclink_gt.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 3865b10d2d43..9d591fb291fd 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -407,9 +407,9 @@ static void wr_reg32(struct slgt_info *info, unsigned = int addr, __u32 value); =20 static void msc_set_vcr(struct slgt_info *info); =20 -static int startup(struct slgt_info *info); +static int startup_hw(struct slgt_info *info); static int block_til_ready(struct tty_struct *tty, struct file * filp,str= uct slgt_info *info); -static void shutdown(struct slgt_info *info); +static void shutdown_hw(struct slgt_info *info); static void program_hw(struct slgt_info *info); static void change_params(struct slgt_info *info); =20 @@ -622,7 +622,7 @@ static int open(struct tty_struct *tty, struct file *fi= lp) =20 if (info->port.count =3D=3D 1) { /* 1st open on this device, init hardware */ - retval =3D startup(info); + retval =3D startup_hw(info); if (retval < 0) { mutex_unlock(&info->port.mutex); goto cleanup; @@ -666,7 +666,7 @@ static void close(struct tty_struct *tty, struct file *= filp) flush_buffer(tty); tty_ldisc_flush(tty); =20 - shutdown(info); + shutdown_hw(info); mutex_unlock(&info->port.mutex); =20 tty_port_close_end(&info->port, tty); @@ -687,7 +687,7 @@ static void hangup(struct tty_struct *tty) flush_buffer(tty); =20 mutex_lock(&info->port.mutex); - shutdown(info); + shutdown_hw(info); =20 spin_lock_irqsave(&info->port.lock, flags); info->port.count =3D 0; @@ -1445,7 +1445,7 @@ static int hdlcdev_open(struct net_device *dev) spin_unlock_irqrestore(&info->netlock, flags); =20 /* claim resources and init adapter */ - if ((rc =3D startup(info)) !=3D 0) { + if ((rc =3D startup_hw(info)) !=3D 0) { spin_lock_irqsave(&info->netlock, flags); info->netcount=3D0; spin_unlock_irqrestore(&info->netlock, flags); @@ -1455,7 +1455,7 @@ static int hdlcdev_open(struct net_device *dev) /* generic HDLC layer open processing */ rc =3D hdlc_open(dev); if (rc) { - shutdown(info); + shutdown_hw(info); spin_lock_irqsave(&info->netlock, flags); info->netcount =3D 0; spin_unlock_irqrestore(&info->netlock, flags); @@ -1499,7 +1499,7 @@ static int hdlcdev_close(struct net_device *dev) netif_stop_queue(dev); =20 /* shutdown adapter and release resources */ - shutdown(info); + shutdown_hw(info); =20 hdlc_close(dev); =20 @@ -2328,7 +2328,7 @@ static irqreturn_t slgt_interrupt(int dummy, void *de= v_id) return IRQ_HANDLED; } =20 -static int startup(struct slgt_info *info) +static int startup_hw(struct slgt_info *info) { DBGINFO(("%s startup\n", info->device_name)); =20 @@ -2361,7 +2361,7 @@ static int startup(struct slgt_info *info) /* * called by close() and hangup() to shutdown hardware */ -static void shutdown(struct slgt_info *info) +static void shutdown_hw(struct slgt_info *info) { unsigned long flags; =20 --=20 2.51.1