Re: [PATCH 2/4] objtool: Implement jump_assert for _static_cpu_has()

From: Josh Poimboeuf
Date: Mon Jan 15 2018 - 13:34:54 EST


On Mon, Jan 15, 2018 at 07:12:30PM +0100, Peter Zijlstra wrote:
> > b) Add another special annotation to tell objtool where
> > _static_cpu_has() locations are?
>
> Almost did that, but I figured I'd give this a try first. But yes I
> agree it is somewhat ugly.

I'm thinking this is the way to go. Create an ANNOTATE_STATIC_JUMP
macro, which is used in both _static_cpu_has() and
arch_static_branch[_jump](). Then it's very generalized and all the
special-casing for both alternatives and jump tables will go away.

--
Josh