[lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 00:53:47 PDT 2024


================
@@ -2611,14 +2634,33 @@ static uint32_t getAndFeatures() {
                          "GNU_PROPERTY_AARCH64_FEATURE_1_PAC property");
       features |= GNU_PROPERTY_AARCH64_FEATURE_1_PAC;
     }
-    ret &= features;
+    config->andFeatures &= features;
+
+    if (ctx.aarch64PauthAbiTag.empty())
+      continue;
+
+    if (f->aarch64PauthAbiTag.empty()) {
+      reportMissingFeature(config->zPauthReport,
+                           toString(f) +
+                               ": -z pauth-report: file does not have AArch64 "
+                               "PAuth compatibility info while " +
+                               referenceFileName + " has one");
+      continue;
+    }
+
+    if (ctx.aarch64PauthAbiTag != f->aarch64PauthAbiTag)
+      errorOrWarn(
+          "incompatible values of AArch64 PAuth compatibility info found"
+          "\n>>> " +
+          referenceFileName + ": 0x" +
+          toHex(ctx.aarch64PauthAbiTag, /*LowerCase=*/true) + "\n>>> " +
----------------
MaskRay wrote:

Twine::utohexstr

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


More information about the llvm-commits mailing list