[PATCH] D156882: [AArch64][ELF][lld] Support dynamic R_AARCH64_AUTH_* relocations

Daniil Kovalev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 08:54:31 PDT 2023


kovdan01 added a comment.

TODO: update the revision when https://reviews.llvm.org/D156505 is updated



================
Comment at: lld/ELF/Driver.cpp:1582
+  config->relrPackAuthDynRelocs = getZFlag(
+      args, "pack-relative-auth-relocs", "nopack-relative-auth-relocs", false);
+
----------------
MaskRay wrote:
> `nopack-relative-auth-relocs` is untested.
It seems that it is, see lld/test/ELF/aarch64-ptrauth. Am I mistaken?


================
Comment at: lld/ELF/Writer.cpp:402
+      part.relrAuthDyn = std::make_unique<RelrSection<ELFT>>(
+          threadCount, /*isAArch64Auth*/ true);
+      add(*part.relrAuthDyn);
----------------
MaskRay wrote:
> 
Fixed


================
Comment at: lld/test/ELF/aarch64-ptrauth.s:3
+
+// RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %p/Inputs/shared2.s -o %t.so.o
+// RUN: ld.lld -shared %t.so.o -soname=so -o %t.so
----------------
MaskRay wrote:
> omit `-unknown-linux` as this applies to generic ELF.
Fixed


================
Comment at: lld/test/ELF/aarch64-ptrauth.s:157
+.quad bar2 at AUTH(ia,42)
+
----------------
MaskRay wrote:
> delete trailing blank line
Fixed


================
Comment at: llvm/include/llvm/BinaryFormat/DynamicTags.def:137
+// https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#dynamic-section
+// FIXME: this should be 0x70000005, but it overlaps with AARCH64_VARIANT_PCS
+// See https://reviews.llvm.org/D93044 when it was first introduced.
----------------
MaskRay wrote:
> This suggests that the spec `DT_AARCH64_AUTH_RELR*` should be fixed first:) https://github.com/ARM-software/abi-aa/pull/214 has changed the values now.
Fixed, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156882



More information about the llvm-commits mailing list