]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Fix off-by-one in symbol_by_offset()
authorJulien Thierry <jthierry@redhat.com>
Fri, 3 Apr 2020 13:17:30 +0000 (14:17 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 22 Apr 2020 08:53:49 +0000 (10:53 +0200)
commitc963662f5883c38614d4d7b02a18e8c08b85d91c
tree1ef18a8b85549cc38e021ba4104c8b84bc32f8a6
parent0a838e20797acf2547a00834650f5bfb07cdde47
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: 276e2cddca0c ("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>
tools/objtool/elf.c