[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
Wed Feb 28 12:59:19 PST 2024


================
@@ -2619,6 +2623,42 @@ static uint32_t getAndFeatures() {
   return ret;
 }
 
+static void getAArch64PauthInfo() {
+  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 : ctx.objectFiles) {
+    StringRef f2 = f->getName();
+    ArrayRef<uint8_t> d1 = ctx.aarch64PauthAbiTag;
----------------
kovdan01 wrote:

I used these "shortcuts" to avoid long names. If this does not look reasonable here, there is probably no reason to rename `d2` to `d` since we can just use `f->aarch64PauthAbiTag`. So, now naming is the following:

- `f1` -> `referenceFileName` (better name suggestions are welcome);
- `f2` -> `toString(f)`; `f->getName()` can also be used, but code above already uses `toString(f)`, so use it to keep things consistent;
- `d1` -> `ctx.aarch64PauthAbiTag`;
- `d2` -> `f->aarch64PauthAbiTag`.

See 1448a4a4e0e3cb70358558579e97fce3f0990356



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


More information about the llvm-commits mailing list