[PATCH] D88629: [lld-macho] Add ARM64 target arch
Greg McGary via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 4 00:50:03 PDT 2020
gkm added inline comments.
================
Comment at: lld/MachO/InputSection.cpp:55
if (r.pcrel)
- referentVal -= getVA() + r.offset;
- target->relocateOne(buf + r.offset, r, referentVal);
+ referentVA -= getVA() + r.offset;
+ target->relocateOne(buf + r.offset, r, referentVA);
----------------
smeenai wrote:
> Same comment here about VA vs. val. I think I'd prefer to just shift the pcrel handling entirely into `relocateOne`; yes, it's architecture-agnostic, so there's a *tiny* bit of duplication per-architecture, but then all the logic of going from a referent VA to an actual relocation value gets shifted into `relocateOne`, which is nicer IMO.
`pcrel` handling requires the value of `InputSection::getVA()`, accessible here via `this`. Moving it into `relocateOne` means passing another argument. I think it's better to keep it here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88629/new/
https://reviews.llvm.org/D88629
More information about the llvm-commits
mailing list