diff options
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r-- | lld/ELF/InputSection.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 74d4dd309c79..4d5bd1f1e5f2 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -187,7 +187,7 @@ uint64_t SectionBase::getOffset(uint64_t offset) const { } case Regular: case Synthetic: - return cast<InputSection>(this)->getOffset(offset); + return cast<InputSection>(this)->outSecOff + offset; case EHFrame: // The file crtbeginT.o has relocations pointing to the start of an empty // .eh_frame that is known to be the first in the link. It does that to @@ -196,7 +196,7 @@ uint64_t SectionBase::getOffset(uint64_t offset) const { case Merge: const MergeInputSection *ms = cast<MergeInputSection>(this); if (InputSection *isec = ms->getParent()) - return isec->getOffset(ms->getParentOffset(offset)); + return isec->outSecOff + ms->getParentOffset(offset); return ms->getParentOffset(offset); } llvm_unreachable("invalid section kind"); |