[lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)
Daniil Kovalev via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 15 01:40:25 PST 2024
================
@@ -2615,6 +2619,47 @@ static uint32_t getAndFeatures() {
return ret;
}
+static void getAArch64PauthInfo() {
+ if (ctx.objectFiles.empty())
+ return;
+
+ auto it = std::find_if(
+ ctx.objectFiles.begin(), ctx.objectFiles.end(),
+ [](const ELFFileBase *f) { return !f->aarch64PauthAbiTag.empty(); });
+ if (it == ctx.objectFiles.end())
+ return;
+
+ ctx.aarch64PauthAbiTag = (*it)->aarch64PauthAbiTag;
+ StringRef f1 = (*it)->getName();
+ for (ELFFileBase *f : ArrayRef(ctx.objectFiles)) {
+ StringRef f2 = f->getName();
+ const SmallVector<uint8_t, 0> &d1 = ctx.aarch64PauthAbiTag;
+ const SmallVector<uint8_t, 0> &d2 = f->aarch64PauthAbiTag;
+ if (d1.empty() != d2.empty()) {
----------------
kovdan01 wrote:
Thanks for pointing that `d2` cannot be empty. I've simplified the logic as requested taking this fact into account. I've left both `d1` and `d2` just as shortcuts to avoid large expressions - please let me know if there are any issues with this.
https://github.com/llvm/llvm-project/pull/72714
More information about the llvm-commits
mailing list