[PATCH] D108924: [lld/mac] Tweak estimateStubsInRangeVA a bit
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 30 10:53:02 PDT 2021
int3 accepted this revision.
int3 added a comment.
thanks!
================
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();
}
----------------
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
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108924/new/
https://reviews.llvm.org/D108924
More information about the llvm-commits
mailing list