================
@@ -1096,8 +1113,10 @@ void AArch64BtiPac::writePlt(uint8_t *buf, const Symbol 
&sym,
   relocateNoSym(buf + 4, R_AARCH64_LDST64_ABS_LO12_NC, gotPltEntryAddr);
   relocateNoSym(buf + 8, R_AARCH64_ADD_ABS_LO12_NC, gotPltEntryAddr);
 
-  if (pacEntry)
-    memcpy(buf + sizeof(addrInst), pacBr, sizeof(pacBr));
+  if (pacEntryKind != PEK_NoAuth)
+    memcpy(buf + sizeof(addrInst),
+           pacEntryKind == PEK_AuthHint ? pacHintBr : pacBr,
----------------
smithp35 wrote:

Could be a possibility to make pacHintBr and pacBr into an array indexed by 
pacEntryKind.
```
memcpy(buf + sizeof(addrInst),
  pacBrInstrs[pacEntryKind],
  sizeof(pacBrInstrs[pacEntryKind]));
```

Not sure if it is worth the trouble though.

https://github.com/llvm/llvm-project/pull/113945
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to