Re: [PATCH] riscv/ftrace: Fix the problem modules cannot find _mcount

From: Steven Rostedt
Date: Tue May 08 2018 - 09:11:49 EST


On Tue, 8 May 2018 11:21:57 +0800
Alan Kao <alankao@xxxxxxxxxxxxx> wrote:

> Enabling ftrace and module support at the same time fails the kernel
> build process, because modules cannot find the _mcount symbol. This
> patch fixes this issue.

I think you have a much bigger issue.

>
> Signed-off-by: Alan Kao <alankao@xxxxxxxxxxxxx>
> Cc: Greentime Hu <greentime@xxxxxxxxxxxxx>
> Cc: Zong Li <zong@xxxxxxxxxxxxx>
> ---
> arch/riscv/kernel/mcount.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/mcount.S b/arch/riscv/kernel/mcount.S
> index ce9bdc57a2a1..5721624886a1 100644
> --- a/arch/riscv/kernel/mcount.S
> +++ b/arch/riscv/kernel/mcount.S
> @@ -126,5 +126,5 @@ do_trace:
> RESTORE_ABI_STATE
> ret
> ENDPROC(_mcount)
> -EXPORT_SYMBOL(_mcount)
> #endif
> +EXPORT_SYMBOL(_mcount)

How does this work? How do you export _mcount if _mcount isn't even
defined?

-- Steve