[PATCH] D108924: [lld/mac] Tweak estimateStubsInRangeVA a bit
Vy Nguyen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 30 10:57:31 PDT 2021
oontvoo added inline comments.
================
Comment at: lld/MachO/ConcatOutputSection.cpp:173-176
+ for (size_t i = callIdx; i < inputs.size(); i++) {
InputSection *isec = inputs[i];
isecEnd = alignTo(isecEnd, isec->align) + isec->getSize();
}
----------------
int3 wrote:
> thakis wrote:
> > oontvoo wrote:
> > > I must be missing something here but why does this need to be a loop and not simply
> > >
> > > ```
> > > if (callIdx < inputs.size()) {
> > > InputSection *isec = inputs.last();
> > > secEnd = alignTo(isecEnd, isec->align) + isec->getSize();
> > > }
> > >
> > > ```
> > >
> > > IOWs, isecEnd seems to get overridden in each iteration, yes?
> > >
> > >
> > >
> > >
> > Yes, this computes the end address of all sections. After the loop, `isecEnd`points right after where the last section would end up, assuming we don't insert thunk sections anywhere along the way.
> It's a loop since it's summing the aligned sizes
Thanks :)
i shouldn't have done reviews on monday before☕
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108924/new/
https://reviews.llvm.org/D108924
More information about the llvm-commits
mailing list