On Tue, 26 Aug 2025 12:13:44 +0200
Vladimir Riabchun <ferr.lambargi...@gmail.com> wrote:

> In my_tramp1 function ASM_RET instruction was placed below
> .size directive, leading to a wrong function size.

Looking at the Fixes commit, it appears that the .size directive was placed
above the ret instruction ;-)

-- Steve


> 
> Fixes: 9d907f1ae80b ("samples/ftrace: Fix asm function ELF annotations")
> Signed-off-by: Vladimir Riabchun <ferr.lambargi...@gmail.com>
> ---
>  samples/ftrace/ftrace-direct-modify.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/samples/ftrace/ftrace-direct-modify.c 
> b/samples/ftrace/ftrace-direct-modify.c
> index cfea7a38befb..da3a9f2091f5 100644
> --- a/samples/ftrace/ftrace-direct-modify.c
> +++ b/samples/ftrace/ftrace-direct-modify.c
> @@ -75,8 +75,8 @@ asm (
>       CALL_DEPTH_ACCOUNT
>  "    call my_direct_func1\n"
>  "    leave\n"
> -"    .size           my_tramp1, .-my_tramp1\n"
>       ASM_RET
> +"    .size           my_tramp1, .-my_tramp1\n"
>  
>  "    .type           my_tramp2, @function\n"
>  "    .globl          my_tramp2\n"


Reply via email to