[PATCH] D156505: [AArch64][ELF] Support R_AARCH64_AUTH_ABS64 static relocation

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 11:03:29 PDT 2023


peter.smith added a comment.

Not much to add to what MaskRay has already said. Some suggestions to improve error messages and comments.



================
Comment at: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:7541
+  if (!isUInt<16>(Discriminator))
+    return TokError("too wide integer discriminator '" + Twine(Discriminator) +
+                    "'");
----------------
Similar error messages use out of range. Ideally we should give the permitted range in the error message.
`integer discriminator <Discrimator> is out of range, [0, 65535] expected` 


================
Comment at: llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp:331
+          SymLoc == AArch64AuthMCExpr::VK_AUTHADDR) {
+        // TODO: implement test with rel relocations and non-zero wide addends
+        // By default, rela is used, and implicit addend is 0
----------------
I'm not sure if MC can easily generate a REL relocation for AArch64. IIRC REL format may occur in the dynamic case, for RELATIVE compression and REL format dynamic relocations (lld -z rel).



================
Comment at: llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp:336
+                                          Twine(Value) +
+                                          "' in auth relocation");
+
----------------
Worth saying what the range is in the error message? For example there are other error messages with `fixup value out of range [-0xFFFF, 0xFFFF]");` For example:
"out of range addend <Value> in auth relocation. Permitted range [-2,147,483,648, -2,147,483,647]"


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156505/new/

https://reviews.llvm.org/D156505



More information about the llvm-commits mailing list