mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
objtool: Fix off-by-one in symbol_by_offset()
Sometimes, WARN_FUNC() and other users of symbol_by_offset() will
associate the first instruction of a symbol with the symbol preceding
it. This is because symbol->offset + symbol->len is already outside of
the symbol's range.
Fixes: 2a362ecc3e
("objtool: Optimize find_symbol_*() and read_symbols()")
Signed-off-by: Julien Thierry <jthierry@redhat.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
963d566917
commit
5377cae94a
@ -105,7 +105,7 @@ static int symbol_by_offset(const void *key, const struct rb_node *node)
|
||||
|
||||
if (*o < s->offset)
|
||||
return -1;
|
||||
if (*o > s->offset + s->len)
|
||||
if (*o >= s->offset + s->len)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user