[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
Sat Feb 10 12:03:55 PST 2024


================
@@ -1132,11 +1132,37 @@ void RelocationScanner::processAux(RelExpr expr, RelType type, uint64_t offset,
                     (isa<EhInputSection>(sec) && config->emachine != EM_MIPS));
   if (canWrite) {
     RelType rel = target->getDynRel(type);
+    if (config->emachine == EM_AARCH64 && type == R_AARCH64_AUTH_ABS64) {
+      // Assume relocations from relocatable objects are RELA.
+      assert(config->isRela);
----------------
MaskRay wrote:

There is no guarantee that isRela is true if `-z rel`. This assert will cause a crash in an assertion build, but the assert is not necessary at all since using incompatible linker options leading to a runtime crash is not news. You can delete this.

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


More information about the llvm-commits mailing list