riscv/ftrace: Export _mcount when DYNAMIC_FTRACE isn't set
authorAlan Kao <alankao@andestech.com>
Tue, 8 May 2018 03:21:57 +0000 (11:21 +0800)
committerPalmer Dabbelt <palmer@sifive.com>
Mon, 11 Jun 2018 16:04:03 +0000 (09:04 -0700)
The EXPORT_SYMBOL(_mcount) for RISC-V ended up inside a
CONFIG_DYNAMIC_FTRACE ifdef.  If you enable modules without enabling
CONFIG_DYNAMIC_FTRACE then you'll get a build error without this patch
because the modules won't be able to find _mcount.

The new behavior is to export _mcount whenever CONFIG_FUNCTION_TRACER is
defined.  This matches what every other architecture is doing.

Signed-off-by: Alan Kao <alankao@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Cc: Zong Li <zong@andestech.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/mcount.S

index ce9bdc57a2a161b1ab16b8a593b031a0e2df72ed..5721624886a1cc8f0af054da3bec133b53de0381 100644 (file)
@@ -126,5 +126,5 @@ do_trace:
        RESTORE_ABI_STATE
        ret
 ENDPROC(_mcount)
-EXPORT_SYMBOL(_mcount)
 #endif
+EXPORT_SYMBOL(_mcount)