linux/arch/riscv/kernel
Nathan Chancellor e69c7c1491 riscv: Workaround mcount name prior to clang-13
[ Upstream commit 7ce04771503074a7de7f539cc43f5e1b385cb99b ]

Prior to clang 13.0.0, the RISC-V name for the mcount symbol was
"mcount", which differs from the GCC version of "_mcount", which results
in the following errors:

riscv64-linux-gnu-ld: init/main.o: in function `__traceiter_initcall_level':
main.c:(.text+0xe): undefined reference to `mcount'
riscv64-linux-gnu-ld: init/main.o: in function `__traceiter_initcall_start':
main.c:(.text+0x4e): undefined reference to `mcount'
riscv64-linux-gnu-ld: init/main.o: in function `__traceiter_initcall_finish':
main.c:(.text+0x92): undefined reference to `mcount'
riscv64-linux-gnu-ld: init/main.o: in function `.LBB32_28':
main.c:(.text+0x30c): undefined reference to `mcount'
riscv64-linux-gnu-ld: init/main.o: in function `free_initmem':
main.c:(.text+0x54c): undefined reference to `mcount'

This has been corrected in https://reviews.llvm.org/D98881 but the
minimum supported clang version is 10.0.1. To avoid build errors and to
gain a working function tracer, adjust the name of the mcount symbol for
older versions of clang in mount.S and recordmcount.pl.

Link: https://github.com/ClangBuiltLinux/linux/issues/1331
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-22 11:38:29 +02:00
..
vdso riscv: fix vdso build with lld 2020-05-20 08:20:13 +02:00
.gitignore
asm-offsets.c
cacheinfo.c
cpu.c
cpufeature.c
entry.S riscv,entry: fix misaligned base for excp_vect_table 2021-04-16 11:46:38 +02:00
fpu.S
ftrace.c RISC-V: Take text_mutex in ftrace_init_nop() 2020-10-01 13:18:14 +02:00
head.h
head.S riscv: Set text_offset correctly for M-Mode 2020-11-18 19:20:25 +01:00
irq.c
Makefile
mcount-dyn.S
mcount.S riscv: Workaround mcount name prior to clang-13 2021-05-22 11:38:29 +02:00
module-sections.c
module.c
module.lds
perf_callchain.c
perf_event.c
perf_regs.c
process.c
ptrace.c
reset.c
riscv_ksyms.c
setup.c
signal.c
smp.c RISC-V: Fix error code returned by riscv_hartid_to_cpuid() 2021-05-19 10:08:26 +02:00
smpboot.c
stacktrace.c riscv: stacktrace: Fix undefined reference to `walk_stackframe' 2020-06-03 08:21:13 +02:00
sys_riscv.c RISC-V: Don't allow write+exec only page mapping request in mmap 2020-06-30 15:37:06 -04:00
syscall_table.c
time.c riscv: Fix kernel time_init() 2021-01-27 11:47:43 +01:00
traps.c
vdso.c
vmlinux.lds.S