objtool: Allow symbol range comparisons for IBT/ENDBR
authorPeter Zijlstra <peterz@infradead.org>
Thu, 15 Sep 2022 11:11:13 +0000 (13:11 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 17 Oct 2022 14:41:08 +0000 (16:41 +0200)
commit08ef8c40112b8cd157515cd532f65cb82c934a76
tree08ef77d8801a888a385cf97dcfd61f49599607b4
parent5da6aea375cde499fdfac3cde4f26df4a840eb9f
objtool: Allow symbol range comparisons for IBT/ENDBR

A semi common pattern is where code checks if a code address is
within a specific range. All text addresses require either ENDBR or
ANNOTATE_ENDBR, however the ANNOTATE_NOENDBR past the range is
unnatural.

Instead, suppress this warning when this is exactly at the end of a
symbol that itself starts with either ENDBR/ANNOTATE_ENDBR.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220915111146.434642471@infradead.org
arch/x86/entry/entry_64_compat.S
tools/objtool/check.c