scripts/recordmcount.pl: Fix RISC-V regex for clang
authorNathan Chancellor <nathan@kernel.org>
Thu, 25 Mar 2021 22:38:05 +0000 (15:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 09:40:53 +0000 (11:40 +0200)
commit52b7b9ad63dad081511c6d96c9ee773e58707f36
tree24a883e2f3c1b09867b353bb118dfc4dd280740b
parentb6b7f7ed7f96912c2dd96ab3151be765692b78ba
scripts/recordmcount.pl: Fix RISC-V regex for clang

[ Upstream commit 2f095504f4b9cf75856d6a9cf90299cf75aa46c5 ]

Clang can generate R_RISCV_CALL_PLT relocations to _mcount:

$ llvm-objdump -dr build/riscv/init/main.o | rg mcount
                000000000000000e:  R_RISCV_CALL_PLT     _mcount
                000000000000004e:  R_RISCV_CALL_PLT     _mcount

After this, the __start_mcount_loc section is properly generated and
function tracing still works.

Link: https://github.com/ClangBuiltLinux/linux/issues/1331
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Fangrui Song <maskray@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/recordmcount.pl