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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 18:28:30 PDT 2023


MaskRay added inline comments.


================
Comment at: lld/ELF/Arch/AArch64.cpp:390
+         rel.addend >= static_cast<int64_t>(rel.sym->getSize())))
+      write64(loc, -1 * rel.addend);
+    else
----------------
hctim wrote:
> MaskRay wrote:
> > Just use the unary operator.
> Unfortunately not possible here. e.g. `~17 != -1 * 17`. While we could change the ABI to be granules-away (and then do a `% 16` on the offset at the end of the calculation), giving an exact offset in bytes gives a nice easy way to debug the exact address of the tag derivation (and doesn't waste any bytes doing so).
Sorry for being clear. I mean ` write64(loc, -rel.addend);`.

We use unary operator elsewhere. It's much more common than `-1 * xxx`


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