[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 08:54:06 PST 2024


================
@@ -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,
----------------
kovdan01 wrote:

Thanks for suggestion. I think I'll leave this "as is" w/o changes - it looks like that a pretty small decrease in code length here will require increase in complexity by introducing invariants on enum values and increase in code length somewhere else.


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


More information about the llvm-commits mailing list