[llvm] [BOLT] Add support for Linux kernel .smp_locks section (PR #90798)

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 10:23:28 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 &&
----------------
dcci wrote:

you moved this assertion to be an error, is this something that can triggered by a "regular binary"?

https://github.com/llvm/llvm-project/pull/90798


More information about the llvm-commits mailing list