From mboxrd@z Thu Jan 1 00:00:00 1970 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 ECA132DEA7E for ; Fri, 21 Nov 2025 13:28:23 +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=1763731704; cv=none; b=jZ32Db/TNxVewynZ0RQQwbYhhnGzZEjh7qKhh5KBqiTE2GRlKpRd2Ofe8/0N5B4R8rp12ghcHnoSQKVWS7fPEe7rku2VkyFm65uiPH1pThvW6Omf5Ln2OY00GZKALZGQIFD1Zzo+k7WCNacTZC4vi9z1WiWHR7CjPlrTg3kaRm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763731704; c=relaxed/simple; bh=HedUGmcUeY4VkX9AMbFdDsjta/FcnGrbTTinYTfGom4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=R5ystHqL+o1+neRIVDNwnJbXuC61xM5JsG42fj+A/iPcBfhmsHGsNSCQTreT0pjNfuFiihKsDhC4XS5Kt0Mvf2kAARcCc8JS8ohQP1CSYrYHmknN/WBYRQD02EDJsiFjas+aVwkpiW5PLfH4DjKGehSIGEu6iFDYtgMDO+A3x18= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M8lMGcd0; 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="M8lMGcd0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64B53C4CEFB; Fri, 21 Nov 2025 13:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763731703; bh=HedUGmcUeY4VkX9AMbFdDsjta/FcnGrbTTinYTfGom4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=M8lMGcd0VJqPDgZyuDztZOye9t3rDn5gGeEuqnewnFKZCGMd5MljRYyySmnGubX8G XpFhrfkBt3CN187TNcqvSKuw+85EjD1/tc5Db+NykZ4FJOTeXG7aUaJ5pjrnE+EJUt Pj21AoqS++k+CUp4+mX15deSJuGlRs1pNkPDwO/kqKP5B5qiBYVqREdX913vxTQRHs SZNB3EoRZ4IeqmKd5SOuQn97FwHl93935QpcpeMR7bRvTNDtkDIESGbtsZgeSjE+3C y4cvqp92WFoBmA9hgX0drmkU0zeUfgMu56bpZW5nGEaRN+1Q6tI1kSaHs/IgZsBCSz 3rQpwf9U3f/IA== Message-ID: Date: Fri, 21 Nov 2025 14:28:20 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/6] media: atomisp: gc2235: Fix namespace collision and startup() section placement with -ffunction-sections To: Josh Poimboeuf , x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Greg Kroah-Hartman , Jiri Slaby , Mauro Carvalho Chehab References: From: Hans de Goede Content-Language: en-US, nl In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On 20-Nov-25 9:14 PM, Josh Poimboeuf wrote: > 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 Thanks, patch looks good to me: Reviewed-by: Hans de Goede Feel free to merge through the x86/tip tree together with the rest of the series. Regards, Hans > --- > 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;