objtool: Fix interval tree insertion for zero-length symbols

Zero-length symbols get inserted in the wrong spot.  Fix that.

Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
This commit is contained in:
Josh Poimboeuf
2025-09-17 09:03:26 -07:00
parent 81cf39be35
commit c2a3e7af31

View File

@@ -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,