[PATCH] D152921: [lld] Synthesize metadata for MTE globals

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 02:32:36 PDT 2023


hctim added inline comments.


================
Comment at: lld/ELF/Arch/AArch64.cpp:378
   case R_AARCH64_ABS64:
   case R_AARCH64_PREL64:
+    // AArch64 relocations to tagged symbols have extended semantics, as
----------------
peter.smith wrote:
> Does R_AARCH64_PREL64 need this behaviour? It isn't a dynamic relocation, won't generate a R_AARCH64_RELATIVE and calculates an offset to symbol from the place. I can't see it in the spec either.
> 
> Does it need to be?
> ```
> case R_AARCH64_PREL64:
>   write64(loc, val);
>   break;
> case R_AARCH64_ABS64:
>   // As below
> ```
> 
> Just for clarification, an R_AARCH64_ABS64 static relocation can be either converted to a relative or can be a dynamic reloc itself
> ```
> extern int foo;
> int *bar = &foo;
> ```
> Is it OK to encode the addend as for R_AARCH64_RELATIVE in both cases?
Done, removed it from the PREL64 branch. Yes, the encoded addend is intended and desirable for RELATIVE as well. It handles the case when we have an out-of-bounds (e.g. 'endptr') pointer to a local global variable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152921



More information about the llvm-commits mailing list