[lld] [PAC][lld] Use braa instr in PAC PLT sequence with valid PAuth core info (PR #113945)

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 10 04:47:54 PST 2024


================
@@ -1066,9 +1079,13 @@ void AArch64BtiPac::writePlt(uint8_t *buf, const Symbol &sym,
       0x11, 0x02, 0x40, 0xf9,  // ldr  x17, [x16, Offset(&(.got.plt[n]))]
       0x10, 0x02, 0x00, 0x91   // add  x16, x16, Offset(&(.got.plt[n]))
   };
+  const uint8_t pacHintBr[] = {
+      0x9f, 0x21, 0x03, 0xd5, // autia1716
+      0x20, 0x02, 0x1f, 0xd6  // br   x17
+  };
   const uint8_t pacBr[] = {
-      0x9f, 0x21, 0x03, 0xd5,  // autia1716
-      0x20, 0x02, 0x1f, 0xd6   // br   x17
+      0x30, 0x0a, 0x1f, 0xd7, // braa x17, x16
+      0x1f, 0x20, 0x03, 0xd5  // nop
----------------
kovdan01 wrote:

I think it's a nice suggestion, but I'll apply it in a separate PR not to mix different changes - `nop` is present both in `pacBr` and `stdBr`, while the current PR is intended to change only `pacBr`.

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


More information about the llvm-commits mailing list