diff options
author | Nathan Chancellor <nathan@kernel.org> | 2021-03-26 01:38:05 +0300 |
---|---|---|
committer | Palmer Dabbelt <palmerdabbelt@google.com> | 2021-04-26 18:25:00 +0300 |
commit | 2f095504f4b9cf75856d6a9cf90299cf75aa46c5 (patch) | |
tree | 5d0890ca63ab3757ac2b4c4778435f6c2fea1ec7 /scripts | |
parent | 7f3d349065d0c643f7f7013fbf9bc9f2c90b675f (diff) | |
download | linux-2f095504f4b9cf75856d6a9cf90299cf75aa46c5.tar.xz |
scripts/recordmcount.pl: Fix RISC-V regex for clang
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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/recordmcount.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 867860ea57da..a36df04cfa09 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -392,7 +392,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") { |