Re: [PATCH v2 08/11] arm64/static_call: Fix static call CFI violations

Josh Poimboeuf
2023-03-22T18:33:28Z

On Wed, Mar 22, 2023 at 11:07:21AM -0700, Sami Tolvanen wrote:
> > +/*
> > + * Make a dummy reference to a function pointer in C to force the compiler to
> > + * emit a __kcfi_typeid_ symbol for asm to use.
> > + */
> > +#define GEN_CFI_SYM(func) \
> > + static typeof(func) __used __section(".discard.cfi") *__UNIQUE_ID(cfi) = func
>
> Couldn't we just use __ADDRESSABLE instead of adding a separate macro?
> The type of the variable shouldn't matter here, as long as we take the
> address of func.

Oh I did pretty much reimplement __ADDRESSABLE didn't I ;-)

--
Josh