diff mbox series

[3/3] x86: error_inject: make just_return_func globally visible

Message ID 20180202145634.200291-3-arnd@arndb.de
State Accepted
Commit 01684e72f16727e6ae0aeb1392f478e11ec5b8f7
Headers show
Series x86 bugfixes for LTO | expand

Commit Message

Arnd Bergmann Feb. 2, 2018, 2:56 p.m. UTC
With link time optimizations enabled, I get a link failure:

./ccLbOEHX.ltrans19.ltrans.o: In function `override_function_with_return':
<artificial>:(.text+0x7f3): undefined reference to `just_return_func'

Marking the symbol .globl makes it work as expected.

Fixes: 540adea3809f ("error-injection: Separate error-injection from kprobe")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 arch/x86/lib/error-inject.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.9.0

Comments

Masami Hiramatsu (Google) Feb. 3, 2018, 1:21 p.m. UTC | #1
On Fri,  2 Feb 2018 15:56:19 +0100
Arnd Bergmann <arnd@arndb.de> wrote:

> With link time optimizations enabled, I get a link failure:

> 

> ./ccLbOEHX.ltrans19.ltrans.o: In function `override_function_with_return':

> <artificial>:(.text+0x7f3): undefined reference to `just_return_func'

> 

> Marking the symbol .globl makes it work as expected.


Good catch!

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>


Thank you!

> 

> Fixes: 540adea3809f ("error-injection: Separate error-injection from kprobe")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>  arch/x86/lib/error-inject.c | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/arch/x86/lib/error-inject.c b/arch/x86/lib/error-inject.c

> index 7b881d03d0dd..3cdf06128d13 100644

> --- a/arch/x86/lib/error-inject.c

> +++ b/arch/x86/lib/error-inject.c

> @@ -7,6 +7,7 @@ asmlinkage void just_return_func(void);

>  

>  asm(

>  	".type just_return_func, @function\n"

> +	".globl just_return_func\n"

>  	"just_return_func:\n"

>  	"	ret\n"

>  	".size just_return_func, .-just_return_func\n"

> -- 

> 2.9.0

> 



-- 
Masami Hiramatsu <mhiramat@kernel.org>
diff mbox series

Patch

diff --git a/arch/x86/lib/error-inject.c b/arch/x86/lib/error-inject.c
index 7b881d03d0dd..3cdf06128d13 100644
--- a/arch/x86/lib/error-inject.c
+++ b/arch/x86/lib/error-inject.c
@@ -7,6 +7,7 @@  asmlinkage void just_return_func(void);
 
 asm(
 	".type just_return_func, @function\n"
+	".globl just_return_func\n"
 	"just_return_func:\n"
 	"	ret\n"
 	".size just_return_func, .-just_return_func\n"