Re: [PATCH 10/46] static_call, lto: Mark func_a() as __visible_on_lto

From: Andi Kleen
Date: Mon Nov 14 2022 - 15:29:38 EST


On Mon, Nov 14, 2022 at 04:54:16PM +0100, Peter Zijlstra wrote:
> On Mon, Nov 14, 2022 at 12:43:08PM +0100, Jiri Slaby (SUSE) wrote:
>
> > -static int func_a(int x)
> > +__visible_on_lto int sc_func_a(int x)
>
> > } static_call_data [] __initdata = {
> > { NULL, 2, 3 },
> > { func_b, 2, 4 },
> > - { func_a, 2, 3 }
> > + { sc_func_a, 2, 3 }
> > };
>
> I must say I really hate this. Also, with address taken, it still
> eliminiates it?

It doesn't eliminate it, but makes it static, which causes the label to
change, so the assembler reference breaks.

-Andi