Re: [PATCH] objtool: Fix infinite loop in find_jump_table()

From: Peter Zijlstra
Date: Tue Apr 28 2020 - 18:41:05 EST


On Tue, Apr 28, 2020 at 04:45:16PM -0500, Josh Poimboeuf wrote:
> Kristen found a hang in objtool when building with -ffunction-sections.
>
> It was caused by evergreen_pcie_gen2_enable.cold() being laid out
> immediately before evergreen_pcie_gen2_enable(). Since their "pfunc" is
> always the same, find_jump_table() got into an infinite loop because it
> didn't recognize the boundary between the two functions.
>
> Fix that with a new prev_insn_same_sym() helper, which doesn't cross
> subfunction boundaries.
>
> Reported-by: Kristen Carlson Accardi <kristen@xxxxxxxxxxxxxxx>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>

Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>