From nobody Sat Jun 13 21:00:35 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 4045848AE1E; Tue, 5 May 2026 10:56:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978617; cv=none; b=ikpRmj0zC5cLbsPXsOu6w10PpiY9g0VWz4S1Hz8G84vJt9tD7q8U0w0vH7jXCPFgQakKO5bvxJv6UgM+DPUbyejRXKWwpWwJxrehGoXQbuXRMVDmEGckPYUzsKGusRPNcmH9MoM6SdW1coLIqnCG+itrwIhsrqnWwczzpyQLrOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978617; c=relaxed/simple; bh=8rpQXWIOSHmhhWVUaf6WDMl8Z8aGEnR9yuJa3FTtOCU=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=UxPR1jiLnEqoa13GEz9wrd2A/2JZIB8OnDYjDOPT3RsAAxr6Hi2re3SpiBiDpyxlR5xzMdROPlZu+guqnvQJ4Pxaw9meAb5+XSpWCHhjT5CaDVC2oClX5+nJsb5iEwKaQMtk+9gHFX6Jelvk3VYqvzW6mmC2K4UyzHGdLCYT85U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dm5mvH5w; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=lbYsNPCN; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dm5mvH5w"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lbYsNPCN" Date: Tue, 05 May 2026 10:56:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777978614; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P+1XWU7TqXZVNSYT246G+jAl0f/C6yuk8ykW0JBAwls=; b=dm5mvH5wSgO5bHlowMMkvewKVPO7OXwmL0tlgqcZkBqlxmXe6v/4kPBdabFyA8cHI4Akl7 9PF2mbxAjMUI5bHFcx+YNrYi+GkQknH7kG7Ia2sx6kz5FywZ+aQROhJGMjifzMB5pveQAT pZ6/IA/hqYp8zgTvEPOx6z2XDBVtHeBAAT6kL9uH9q/NfzeHBHwsyCvmSvCXn2Q0DcSU8T dk2OfSvYMX/pbNTYmRp9H32DuKawYtigaTlD/CnnWRGgLuWJcTkxbwZrIHZHFeY29lQPlF b/N+I1ElGuBkyvRxfjaaR20Dv8rmzDAFxScTrvei/ktVAGsnTS5CpzkA6sS0hA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777978614; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P+1XWU7TqXZVNSYT246G+jAl0f/C6yuk8ykW0JBAwls=; b=lbYsNPCNwR0e0/yTjxKxo0u7lDOAzzSo6wQ+0MEfz7xyNMbAwLHwYmUEKVXNWFwrgEEQWE dArob/0gxPUddTCg== From: "tip-bot2 for Joe Lawrence" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] objtool/klp: Fix is_uncorrelated_static_local() for Clang Cc: Joe Lawrence , Song Liu , Miroslav Benes , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177797861352.424702.1670855677836337177.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the objtool/core branch of tip: Commit-ID: 84c304a534b844703d3437811e8f072166e3f116 Gitweb: https://git.kernel.org/tip/84c304a534b844703d3437811e8f07216= 6e3f116 Author: Joe Lawrence AuthorDate: Wed, 08 Apr 2026 10:49:19 -04:00 Committer: Josh Poimboeuf CommitterDate: Mon, 04 May 2026 21:15:59 -07:00 objtool/klp: Fix is_uncorrelated_static_local() for Clang For naming function-local static locals, GCC uses ., e.g. __already_done.15, while Clang uses . with optional ., e.g. create_worker.__already_done.111 The existing is_uncorrelated_static_local() check only matches the GCC convention where the variable name is a prefix. Handle both cases by checking for a prefix match (GCC) and by checking after the first dot separator (Clang). Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffin= g object files") Signed-off-by: Joe Lawrence Acked-by: Song Liu Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf --- tools/objtool/klp-diff.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c index 0b0d150..b1b068e 100644 --- a/tools/objtool/klp-diff.c +++ b/tools/objtool/klp-diff.c @@ -242,16 +242,17 @@ static struct symbol *next_file_symbol(struct elf *el= f, struct symbol *sym) static bool is_uncorrelated_static_local(struct symbol *sym) { static const char * const vars[] =3D { - "__already_done.", - "__func__.", - "__key.", - "__warned.", - "_entry.", - "_entry_ptr.", - "_rs.", - "descriptor.", - "CSWTCH.", + "__already_done", + "__func__", + "__key", + "__warned", + "_entry", + "_entry_ptr", + "_rs", + "descriptor", + "CSWTCH", }; + const char *dot; =20 if (!is_object_sym(sym) || !is_local_sym(sym)) return false; @@ -259,8 +260,20 @@ static bool is_uncorrelated_static_local(struct symbol= *sym) if (!strcmp(sym->sec->name, ".data.once")) return true; =20 + dot =3D strchr(sym->name, '.'); + if (!dot) + return false; + for (int i =3D 0; i < ARRAY_SIZE(vars); i++) { - if (strstarts(sym->name, vars[i])) + size_t len =3D strlen(vars[i]); + + /* GCC: . */ + if (strstarts(sym->name, vars[i]) && (sym->name[len] =3D=3D '.')) + return true; + + /* Clang: .[.] */ + if (strstarts(dot + 1, vars[i]) && + (dot[1 + len] =3D=3D '.' || dot[1 + len] =3D=3D '\0')) return true; } =20