From: Josh Poimboeuf Date: Wed, 17 Sep 2025 16:03:26 +0000 (-0700) Subject: objtool: Fix interval tree insertion for zero-length symbols X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c2a3e7af31107a2e1dff92b0601d525466dc21b7;p=thirdparty%2Fkernel%2Flinux.git objtool: Fix interval tree insertion for zero-length symbols Zero-length symbols get inserted in the wrong spot. Fix that. Acked-by: Petr Mladek Tested-by: Joe Lawrence Signed-off-by: Josh Poimboeuf --- diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index a8a78b55d3ece..c024937eb12a2 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -92,7 +92,7 @@ static inline unsigned long __sym_start(struct symbol *s) static inline unsigned long __sym_last(struct symbol *s) { - return s->offset + s->len - 1; + return s->offset + (s->len ? s->len - 1 : 0); } INTERVAL_TREE_DEFINE(struct symbol, node, unsigned long, __subtree_last,