[PATCH] D118903: [lld-macho] Have relocation address included in range-check error message

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 25 12:57:45 PST 2022


int3 added inline comments.


================
Comment at: lld/MachO/Arch/ARM64Common.h:109-111
+  encodePage21(&buf32[0], {&sym, "stub"}, stubCode[0],
+               pageBits(lazyPointerVA) - pcPageBits);
+  encodePageOff12(&buf32[1], stubCode[1], lazyPointerVA);
----------------
Roger wrote:
> I'm not sure which way is better. Is there a reason why you didn't use pointer arithmetic here and elsewhere? I'm wondering if the current code performs a dereferencing + address of operations unnecessarily (or if that gets optimized out). It's not a big deal and either way is fine with me but I just wanted to ask.
just style preference. This should be trivial for the compiler to optimize, I don't think we have to worry about it (but you can use godbolt to verify)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118903



More information about the llvm-commits mailing list