From nobody Thu Apr 9 09:03:32 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 E859141C2EF; Mon, 9 Mar 2026 19:59:52 +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=1773086394; cv=none; b=X3OJgEG7xrDONewdLvJF2Kiva27N+eIyUXWOow1BJmqyxtgTEaKKew/u7G7TDhsf/zL70qfTvenlu1BJaG1L8WXm3eDJAkarzo5tq5Rcz6+dBxcIzW2t8T9N8Pthd8K1VdLSynDXjSWcGaKrtYA+9HKJnNYmUYn6c8MLtqwC2F8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773086394; c=relaxed/simple; bh=VUN5FdtJJBvRfDGD3uE6AWiBGjkS1BdaNg76NLPlGlY=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=r65DmPiHBz7GZ+PYmC41LQb1ic4PWi3bRSBQVGs/Ssh0rcK6qArKS2KOZnNDv9Er9Nxw+c8yD9VU23HbV4fZW1wjlBML86hi+g8Db2qWD8YV8BiSf+o94Sy4+RC0cl7G5Sq2M7Jhs2H1A+kU+UDRHSoxNiIgV00iyO/4PcZKpNk= 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=r0wTfzCS; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=OS7oL0lZ; 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="r0wTfzCS"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="OS7oL0lZ" Date: Mon, 09 Mar 2026 19:59:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773086391; 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: in-reply-to:in-reply-to:references:references; bh=7WSvFBcycwje8xxNqxngyqMFIKGD3vdVYG6Lqy2ftpk=; b=r0wTfzCSVxUVguddTwIMWz8DJRM1Gvi+dlXZQvPA6HTaF8V4DGjBA2wv2ylfxKP8VVKypF 70pXBu62Z+e0oxQZSVqeYUogGK/yf3/sVFOR182DKRDMToo51Ria6w9briS7vwhCjgbYMU u3KIugjOOa5B7img7BcRJ497vpIkPoMhuPuUx+lyFo+sOGI3+Lv8+2twYvMN9KEKtiEqUj nCuZ5MykXHPXOHchtsRLOZDAJgklTOR9lzsEvuOnjVjmLMoZP6NJbbxvmd32wfObXM9kV7 4l2VbwB7ApX+YfouqoYOlpJ/khAiFKm8XrHzcri8DfRUeus7TjOxC0leP2zPkw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773086391; 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: in-reply-to:in-reply-to:references:references; bh=7WSvFBcycwje8xxNqxngyqMFIKGD3vdVYG6Lqy2ftpk=; b=OS7oL0lZIapNanLWrigHJQ+M9XLaQY07kePuHVDW41+lE708aitEkALyi0JNUF9kxNQKPF dMSfuGnoK6nnMhCw== From: "tip-bot2 for Song Liu" 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: Remove trailing '_' in demangle_name() Cc: Song Liu , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260305231531.3847295-3-song@kernel.org> References: <20260305231531.3847295-3-song@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177308639026.1647592.3929828972800732531.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: a3f28d2072452edb377eaad01375445dbace6771 Gitweb: https://git.kernel.org/tip/a3f28d2072452edb377eaad01375445db= ace6771 Author: Song Liu AuthorDate: Thu, 05 Mar 2026 15:15:26 -08:00 Committer: Josh Poimboeuf CommitterDate: Fri, 06 Mar 2026 08:08:30 -08:00 objtool/klp: Remove trailing '_' in demangle_name() With CONFIG_LTO_CLANG_THIN, it is possible to have nested __UNIQUE_ID_, such as: __UNIQUE_ID_addressable___UNIQUE_ID_pci_invalid_bar_694_695 To remove both trailing numbers, also remove trailing '_'. Also add comments to demangle_name(). Signed-off-by: Song Liu Link: https://patch.msgid.link/20260305231531.3847295-3-song@kernel.org Signed-off-by: Josh Poimboeuf --- tools/objtool/elf.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index a634b22..fe6e66d 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -441,6 +441,19 @@ static int read_sections(struct elf *elf) return 0; } =20 +/* + * Remove number suffix of a symbol. + * + * Specifically, remove trailing numbers for "__UNIQUE_ID_" symbols and + * symbols with '.'. + * + * With CONFIG_LTO_CLANG_THIN, it is possible to have nested __UNIQUE_ID_, + * such as + * + * __UNIQUE_ID_addressable___UNIQUE_ID_pci_invalid_bar_694_695 + * + * to remove both trailing numbers, also remove trailing '_'. + */ static const char *demangle_name(struct symbol *sym) { char *str; @@ -463,7 +476,7 @@ static const char *demangle_name(struct symbol *sym) for (int i =3D strlen(str) - 1; i >=3D 0; i--) { char c =3D str[i]; =20 - if (!isdigit(c) && c !=3D '.') { + if (!isdigit(c) && c !=3D '.' && c !=3D '_') { str[i + 1] =3D '\0'; break; }