[llvm-branch-commits] [llvm] [WIP] Feat/diasm and emit plt (PR #173571)

Alexey Moksyakov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 29 05:49:49 PST 2025


================
@@ -1718,16 +1718,37 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
              << " to have a BTI landing pad. Relink the workload using LLD.\n";
       exit(1);
     }
+
     // If the PLT does not have a BTI, and it has nops, create a new instruction
     // sequence to patch the entry with.
-    InstructionListType NewPLTSeq;
     MCInst BTIInst;
     createBTI(BTIInst, BTIKind::C);
-    NewPLTSeq.push_back(BTIInst);
-    for (auto II = FirstBBI->begin(); II != FirstBBI->end(); ++II) {
-      NewPLTSeq.push_back(*II);
-    }
-    BC.createInstructionPatch(PLTFunction.getAddress(), NewPLTSeq);
+
+    // remove 1 nop
+    LastBBI->eraseInstruction(LastII);
+    // insert bti c
+    FirstBBI->insertInstruction(FirstBBI->begin(), BTIInst);
+    PLTFunction.dump();
----------------
yavtuk wrote:

need to delete

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


More information about the llvm-branch-commits mailing list