[llvm] [BOLT] Add support for Linux kernel .smp_locks section (PR #90798)
    Maksim Panchenko via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu May  2 10:53:00 PDT 2024
    
    
  
================
@@ -439,79 +408,73 @@ void LinuxKernelRewriter::processLKKSymtab(bool IsGPL) {
 
 /// .smp_locks section contains PC-relative references to instructions with LOCK
 /// prefix. The prefix can be converted to NOP at boot time on non-SMP systems.
-void LinuxKernelRewriter::processLKSMPLocks() {
-  ErrorOr<BinarySection &> SectionOrError =
+Error LinuxKernelRewriter::processSMPLocks() {
+  ErrorOr<BinarySection &> SMPLocksSection =
       BC.getUniqueSectionByName(".smp_locks");
-  if (!SectionOrError)
-    return;
+  if (!SMPLocksSection)
+    return Error::success();
 
-  uint64_t SectionSize = SectionOrError->getSize();
-  const uint64_t SectionAddress = SectionOrError->getAddress();
-  assert((SectionSize % 4) == 0 &&
----------------
maksfb wrote:
We don't expected it normally. That said, it should have been an error (not assertion) in the first place.
https://github.com/llvm/llvm-project/pull/90798
    
    
More information about the llvm-commits
mailing list