[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221114114344.18650-11-jirislaby@kernel.org>
Date: Mon, 14 Nov 2022 12:43:08 +0100
From: "Jiri Slaby (SUSE)" <jirislaby@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Andi Kleen <andi@...stfloor.org>,
Peter Zijlstra <peterz@...radead.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Jason Baron <jbaron@...mai.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ard Biesheuvel <ardb@...nel.org>,
Martin Liska <mliska@...e.cz>, Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 10/46] static_call, lto: Mark func_a() as __visible_on_lto
From: Andi Kleen <andi@...stfloor.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 func_a() as __visible_on_lto as it was static.
[js] use __visible_on_lto
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: Jason Baron <jbaron@...mai.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Ard Biesheuvel <ardb@...nel.org>
Signed-off-by: Andi Kleen <andi@...stfloor.org>
Signed-off-by: Martin Liska <mliska@...e.cz>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
kernel/static_call_inline.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/static_call_inline.c b/kernel/static_call_inline.c
index dc5665b62814..6933b4437597 100644
--- a/kernel/static_call_inline.c
+++ b/kernel/static_call_inline.c
@@ -501,7 +501,7 @@ early_initcall(static_call_init);
#ifdef CONFIG_STATIC_CALL_SELFTEST
-static int func_a(int x)
+__visible_on_lto int sc_func_a(int x)
{
return x+1;
}
@@ -511,7 +511,7 @@ static int func_b(int x)
return x+2;
}
-DEFINE_STATIC_CALL(sc_selftest, func_a);
+DEFINE_STATIC_CALL(sc_selftest, sc_func_a);
static struct static_call_data {
int (*func)(int);
@@ -520,7 +520,7 @@ static struct static_call_data {
} static_call_data [] __initdata = {
{ NULL, 2, 3 },
{ func_b, 2, 4 },
- { func_a, 2, 3 }
+ { sc_func_a, 2, 3 }
};
static int __init test_static_call_init(void)
--
2.38.1
Powered by blists - more mailing lists