Patch "scripts/recordmcount.pl: Fix RISC-V regex for clang" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scripts/recordmcount.pl: Fix RISC-V regex for clang

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scripts-recordmcount.pl-fix-risc-v-regex-for-clang.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8973a128e3500539696a14f40e27116196fdb1dc
Author: Nathan Chancellor <nathan@xxxxxxxxxx>
Date:   Thu Mar 25 15:38:05 2021 -0700

    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@xxxxxxxxxx>
    Reviewed-by: Fangrui Song <maskray@xxxxxxxxxx>
    Signed-off-by: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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") {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux