LLD has workaround for the times when SectionIndex was not passed properly:
LT->getFileLineInfoForAddress(
S->getOffsetInFile() + Offset, nullptr, DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, Info));
S->getOffsetInFile() was added to differentiate offsets between
various sections. Now SectionIndex is properly specified.
Thus it is not necessary to use getOffsetInFile() workaround.
See https://reviews.llvm.org/D58194, https://reviews.llvm.org/D58357.
This patch removes getOffsetInFile() workaround.
This now seems can be:
// Range list with zero size has no effect. InputSectionBase *s = sections[r.SectionIndex]; if (s && s != &InputSection::discarded && s->isLive()) if (r.LowPC != r.HighPC) ret.push_back({cast<InputSection>(s), r.LowPC, r.HighPC, cuIdx});