diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-04-19 18:00:46 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-04-19 18:00:46 +0000 |
commit | b882191e5f93bb274345be014888ac0af277153f (patch) | |
tree | 27eddf828b36cc6d5419b00400dff0da5bd090ee /lld/ELF/InputSection.cpp | |
parent | 36c6465a9500efb6b0a46245fe5448f02924c5d9 (diff) |
Define InputSection::getOffset inline.
This is much simpler than the other section types and there are many
places where the section type is statically know.
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 d21c037ace0..4604253bc00 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -143,7 +143,7 @@ uint64_t SectionBase::getOffset(uint64_t Offset) const { } case Regular: case Synthetic: - return cast<InputSection>(this)->OutSecOff + Offset; + return cast<InputSection>(this)->getOffset(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 @@ -152,7 +152,7 @@ uint64_t SectionBase::getOffset(uint64_t Offset) const { case Merge: const MergeInputSection *MS = cast<MergeInputSection>(this); if (InputSection *IS = MS->getParent()) - return IS->OutSecOff + MS->getParentOffset(Offset); + return IS->getOffset(MS->getParentOffset(Offset)); return MS->getParentOffset(Offset); } llvm_unreachable("invalid section kind"); |