From nobody Wed Dec 17 04:41:44 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 BC2D126656C; Fri, 9 May 2025 20:17:55 +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=1746821875; cv=none; b=dHEqCjgbI/o+Hss2dm7A0YYLno9v/Rt4FSRMdI9jPAsL2WHKitstwDb+CmXNpN6OQYD/ebsK2ubTeYz2F4YEMJmOnPEE4G/1nOHSV1pPUEI87W4sg/eBuURityKD8/xOJairPyuM4YrIKe+6AhQo3dIlXmI36iO97bbvZrs7whs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746821875; c=relaxed/simple; bh=YyD6KDvlcm2ljvEKZEc8fYvgEk6IvDo2PvpCUwTOJmE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nmofumJXfjKWU2vB+h8Dg8QvOB+dU1llgz7COU95i/Rilv77zVzPwxHYyXDp0Z7oVhtb+NjiD4eeViPJH3wiPyNro4v8lgDhWbKFcHa7YYmtvwvtykzuXfT1uhaaf4F79BSCeJzRBNrV4VBlAg518Ps5uHfSRztx0JIFtw67ovQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hg92T/Vg; 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="hg92T/Vg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 920E2C4CEE9; Fri, 9 May 2025 20:17:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746821875; bh=YyD6KDvlcm2ljvEKZEc8fYvgEk6IvDo2PvpCUwTOJmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hg92T/VgT4yZHXxpKdOKJJ6R1KDniwxD7sZFosIXAdxZzsGFs6QF32pddr70S/Gsf DluZlRmmMnw7IIXMNJaul7m6DRKRI6E4ucbru3hTccafT/KI2upT766WBr2RaxF1FA G9Lb/doKrZQgH8tXQmfSSYdZxbNxQQh/qjbEu8ssYAgnschaaXslyhFL/1dh96YMO9 gSjscF8eLY9eNa+R7sKHko5uxEdfOe4F+xQ6gGTOSbR7EzIjeyzxO68bD52zDR3Cb/ v+afeearTstY2r2M7GepBdhXp7WL/QWGSL7736hn+oUhG6KFArrVtRB1ALBOvHx89l vBwZ5qmc4Fxlg== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Petr Mladek , Miroslav Benes , Joe Lawrence , live-patching@vger.kernel.org, Song Liu , laokz , Jiri Kosina , Marcos Paulo de Souza , Weinan Liu , Fazla Mehrab , Chen Zhongjin , Puranjay Mohan Subject: [PATCH v2 16/62] objtool: Fix interval tree insertion for zero-length symbols Date: Fri, 9 May 2025 13:16:40 -0700 Message-ID: X-Mailer: git-send-email 2.49.0 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" Zero-length symbols get inserted in the wrong spot. Fix that. Signed-off-by: Josh Poimboeuf --- tools/objtool/elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index a8a78b55d3ec..c024937eb12a 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -92,7 +92,7 @@ static inline unsigned long __sym_start(struct symbol *s) =20 static inline unsigned long __sym_last(struct symbol *s) { - return s->offset + s->len - 1; + return s->offset + (s->len ? s->len - 1 : 0); } =20 INTERVAL_TREE_DEFINE(struct symbol, node, unsigned long, __subtree_last, --=20 2.49.0