[PATCH] D98387: [lld-macho] Check address ranges when applying relocations

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 10:22:31 PST 2021


int3 added inline comments.


================
Comment at: lld/MachO/Arch/ARM64.cpp:162
+    checkInt(r, value - pc, 28);
     value = encodeBranch26(base, value - pc);
     break;
----------------
thakis wrote:
> (Should the check be in encodeBranch26() instead (etc)? The we won't miss it for other calls, and the 26/28 discrepancy is maybe a bit less magical when the check is closer to the shift.
Good idea. In fact while implementing it I realized we were actually missing ranges checks for the pointers to stubs, which lld-ELF does check. I've therefore added support for it by introducing `SymbolDiagnostic`. Want to have another look before I land this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98387



More information about the llvm-commits mailing list