summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2021-03-25 15:38:05 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-22 11:38:28 +0200
commitcd3ab0ac0a543252ade28015dbd171fc3cfcbfea (patch)
treea270260df10ccec11daf6be4ea329ea91581e110 /scripts
parentcfa65174402ff4bb5270044ce8a9e1af4b933862 (diff)
downloadlinux-stable-cd3ab0ac0a543252ade28015dbd171fc3cfcbfea.tar.gz
linux-stable-cd3ab0ac0a543252ade28015dbd171fc3cfcbfea.tar.bz2
linux-stable-cd3ab0ac0a543252ade28015dbd171fc3cfcbfea.zip
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/recordmcount.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 0bafed857e17..857d5b70b1a9 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -395,7 +395,7 @@ if ($arch eq "x86_64") {
$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
} elsif ($arch eq "riscv") {
$function_regex = "^([0-9a-fA-F]+)\\s+<([^.0-9][0-9a-zA-Z_\\.]+)>:";
- $mcount_regex = "^\\s*([0-9a-fA-F]+):\\sR_RISCV_CALL\\s_mcount\$";
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\sR_RISCV_CALL(_PLT)?\\s_mcount\$";
$type = ".quad";
$alignment = 2;
} elsif ($arch eq "nds32") {