lkml.org 
[lkml]   [2022]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 08/46] static_call, lto: Mark static keys as __visible
    On Mon, Nov 14, 2022 at 12:43:06PM +0100, Jiri Slaby (SUSE) wrote:
    > From: Andi Kleen <andi@firstfloor.org>
    >
    > Symbols referenced from assembler (either directly or e.f. from
    > DEFINE_STATIC_KEY()) need to be global and visible in gcc LTO because
    > they could end up in a different object file than the assembler. This
    > can lead to linker errors without this patch.
    >
    > So mark static call functions as __visible, namely static keys here.
    >
    > Cc: Peter Zijlstra <peterz@infradead.org>
    > Cc: Josh Poimboeuf <jpoimboe@kernel.org>
    > Cc: Jason Baron <jbaron@akamai.com>
    > Cc: Steven Rostedt <rostedt@goodmis.org>
    > Cc: Ard Biesheuvel <ardb@kernel.org>
    > Signed-off-by: Andi Kleen <andi@firstfloor.org>
    > Signed-off-by: Martin Liska <mliska@suse.cz>
    > Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    > ---
    > include/linux/static_call.h | 12 ++++++------
    > 1 file changed, 6 insertions(+), 6 deletions(-)
    >
    > diff --git a/include/linux/static_call.h b/include/linux/static_call.h
    > index df53bed9d71f..e629ab0c4ca3 100644
    > --- a/include/linux/static_call.h
    > +++ b/include/linux/static_call.h
    > @@ -182,7 +182,7 @@ extern long __static_call_return0(void);
    >
    > #define DEFINE_STATIC_CALL(name, _func) \
    > DECLARE_STATIC_CALL(name, _func); \
    > - struct static_call_key STATIC_CALL_KEY(name) = { \
    > + __visible struct static_call_key STATIC_CALL_KEY(name) = { \

    Why not __visible_on_lto?

    --
    Josh

    \
     
     \ /
      Last update: 2022-11-14 19:57    [W:5.600 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site