Skip to content

Commit 2416b30

Browse files
nehebandreas-gaisler
authored andcommitted
sparc: Export mcount for Clang-built modules
Clang emits calls to mcount for -pg on sparc64, while the existing ftrace support only exports the _mcount name. With FUNCTION_TRACER enabled, modules can therefore keep relocations against mcount and fail during modpost: ERROR: modpost: "mcount" [arch/sparc/kernel/chmc.ko] undefined! _mcount and mcount are aliases in arch/sparc/lib/mcount.S. Export the plain mcount alias as well so Clang-built modules can resolve their profiling call target. Assisted-by: Codex:GPT-5 Signed-off-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
1 parent 852fed2 commit 2416b30

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

arch/sparc/include/asm/asm-prototypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ void *memset(void *s, int c, size_t n);
2626
typedef int TItype __attribute__((mode(TI)));
2727
TItype __multi3(TItype a, TItype b);
2828
void _mcount(void);
29+
void mcount(void);
2930

3031
s64 __ashldi3(s64, int);
3132
s64 __lshrdi3(s64, int);

arch/sparc/lib/mcount.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
EXPORT_SYMBOL(_mcount)
2222
.globl mcount
2323
.type mcount,#function
24+
EXPORT_SYMBOL(mcount)
2425
_mcount:
2526
mcount:
2627
#ifdef CONFIG_FUNCTION_TRACER

0 commit comments

Comments
 (0)