From nobody Tue Dec 2 02:19:36 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 8F21B33A706 for ; Thu, 20 Nov 2025 20:52:32 +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=1763671952; cv=none; b=HlHOyfX5hurAYLO8dQsH+OwSHr3Dd8Kx3t81sT1Jjw6DFzSAzfQzhIeD+hhLUX6Kze9+rv7ukFGOwvRH9A563fovmKI/sDT2YntQTkCHzq/Q2bPkfYrlPmLMiHd5Gd5Vp7YXGrm+QwOjzpe4OZrWV3InhvaTzC7k5MLX2a88Tpk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763671952; c=relaxed/simple; bh=6/+C8C8ScN5yQ87KESOLlqwTA36gwEDleRj9B/At4yY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nCOzbSFljgdId12wRXGtnqnN4ZRTtEQiqeD6DvdzI7V8LrUgIMz7f3wgxw8i3qTdR6z2sEkCcJek9hZ/NwutgX1h4voZnc88FIb0L3EtS0huvMm1X/fYwC0ghXWwb0DXgSYPtCXu9JQ/ltg39lnj73aR1p2TjMGAdfGKc6ipWv8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DpXeSI9N; 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="DpXeSI9N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3B34C4CEF1; Thu, 20 Nov 2025 20:52:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763671952; bh=6/+C8C8ScN5yQ87KESOLlqwTA36gwEDleRj9B/At4yY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DpXeSI9N9nohX3vNhtII1hn5yM3L+99HGGpacyF42tG5CvG8Eb7uv7TySzngcghWq 5rqLjSc0j1yyIog40uM+5OjRZxWCVGacx8E4wNwwZAtiVCMQX+5fsA68cIAyusgvld LwanWIYB8I9em5BzqNBcGy+VaBqi/25SM/NkOGtUhTczJ6ABB+NUGO6aPjQkFcyHgl 423PRHonEnrdwu46qWfMCkB4aWJfVs+m0LNy1/Aou/BjLQE/Eh8iuUYkZDhJcXQ+LU YV8ddHaRmXdiWkfHPgGIKh9HvzU/M3fteCswDTjACJq6J9cAI0UVtsAsp6J2fEi3xC B7OkpknrpZ/oQ== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Rong Xu , Han Shen , Sriraman Tallam , Krzysztof Pszeniczny Subject: [PATCH 3/6] objtool: Don't alias undefined symbols Date: Thu, 20 Nov 2025 12:52:17 -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" Objtool is mistakenly aliasing all undefined symbols. That's obviously wrong, though it has no consequence since objtool happens to only use sym->alias for defined symbols. Fix it regardless. Signed-off-by: Josh Poimboeuf --- tools/objtool/elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index fffca31d47ed..4f15643ad70c 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -492,8 +492,8 @@ static int elf_add_symbol(struct elf *elf, struct symbo= l *sym) sym->len =3D sym->sym.st_size; =20 __sym_for_each(iter, &sym->sec->symbol_tree, sym->offset, sym->offset) { - if (iter->offset =3D=3D sym->offset && iter->type =3D=3D sym->type && - iter->len =3D=3D sym->len) + if (!is_undef_sym(iter) && iter->offset =3D=3D sym->offset && + iter->type =3D=3D sym->type && iter->len =3D=3D sym->len) iter->alias =3D sym; } =20 --=20 2.51.1