objtool: optimize add_dead_ends for split sections
authorSami Tolvanen <samitolvanen@google.com>
Tue, 21 Apr 2020 22:08:43 +0000 (15:08 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 15 May 2020 08:35:13 +0000 (10:35 +0200)
commit6b5dd716da8fc3aba65e6b7d992dea0cee2f9528
tree2e5c1e4a8ad1c0d6619a30a476b76bc28de29cec
parent28fe1d7bf89f8ed5be70b98a33932dbaf99345dd
objtool: optimize add_dead_ends for split sections

Instead of iterating through all instructions to find the last
instruction each time .rela.discard.(un)reachable points beyond the
section, use find_insn to locate the last instruction by looking at
the last bytes of the section instead.

Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200421220843.188260-3-samitolvanen@google.com
tools/objtool/check.c