================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to