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

From: Josh Poimboeuf
Date: Wed Mar 22 2023 - 14:33:29 EST


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