summaryrefslogtreecommitdiff
path: root/tools/objtool/elf.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2025-09-17 09:03:26 -0700
committerJosh Poimboeuf <jpoimboe@kernel.org>2025-10-14 14:45:23 -0700
commitc2a3e7af31107a2e1dff92b0601d525466dc21b7 (patch)
tree80e98ce197b1a8a38b9deacce96f5d50098f3ad1 /tools/objtool/elf.c
parent81cf39be3559f3cebef6ad7b0893c06bf5a5847e (diff)
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>
Diffstat (limited to 'tools/objtool/elf.c')
-rw-r--r--tools/objtool/elf.c2
1 files changed, 1 insertions, 1 deletions
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)
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,