summaryrefslogtreecommitdiff
path: root/lld/ELF/InputSection.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-04-19 03:51:26 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-04-19 03:51:26 +0000
commit0750d0246f744bc3718dc3a68ba71d1d412cf2d1 (patch)
treed7b617e4f39f9d4b5eaca6f0670f403409d12c85 /lld/ELF/InputSection.cpp
parent86286a6d526117c4e23bace99a10236b9bd38e79 (diff)
Simplify. NFC.
Using getOffset is here was a bit of an overkill. This is being written and has relocations. This implies it is a .eh_frame or regular section.
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r--lld/ELF/InputSection.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 1eb7737bb20..fbbd37075dc 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -710,7 +710,9 @@ void InputSectionBase::relocateAlloc(uint8_t *Buf, uint8_t *BufEnd) {
const unsigned Bits = Config->Wordsize * 8;
for (const Relocation &Rel : Relocations) {
- uint64_t Offset = getOffset(Rel.Offset);
+ uint64_t Offset = Rel.Offset;
+ if (auto *Sec = dyn_cast<InputSection>(this))
+ Offset += Sec->OutSecOff;
uint8_t *BufLoc = Buf + Offset;
RelType Type = Rel.Type;