summaryrefslogtreecommitdiff
path: root/lld/ELF/InputSection.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-04-19 16:05:07 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-04-19 16:05:07 +0000
commit8ec1cf7576915f7bf8bbe1aa5306c15f8db073e6 (patch)
treefa8dccc6ce51b48b873b1f1b7d1460e12e4daa7b /lld/ELF/InputSection.cpp
parenta7fa87f07537435b06a0214c2bd2f0b044859e71 (diff)
Rename MergeInputSection::getOffset.
Unlike the getOffset in the base class, this one computes the offset in the parent synthetic section, not the final output section.
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r--lld/ELF/InputSection.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index fbbd37075dc..f094be5f6f2 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -156,8 +156,9 @@ uint64_t SectionBase::getOffset(uint64_t Offset) const {
case Merge:
const MergeInputSection *MS = cast<MergeInputSection>(this);
if (InputSection *IS = MS->getParent())
- return cast<InputSection>(IS->Repl)->OutSecOff + MS->getOffset(Offset);
- return MS->getOffset(Offset);
+ return cast<InputSection>(IS->Repl)->OutSecOff +
+ MS->getParentOffset(Offset);
+ return MS->getParentOffset(Offset);
}
llvm_unreachable("invalid section kind");
}
@@ -972,7 +973,7 @@ SectionPiece *MergeInputSection::getSectionPiece(uint64_t Offset) {
// Returns the offset in an output section for a given input offset.
// Because contents of a mergeable section is not contiguous in output,
// it is not just an addition to a base output offset.
-uint64_t MergeInputSection::getOffset(uint64_t Offset) const {
+uint64_t MergeInputSection::getParentOffset(uint64_t Offset) const {
// Find a string starting at a given offset.
auto It = OffsetMap.find(Offset);
if (It != OffsetMap.end())