aboutsummaryrefslogtreecommitdiff
path: root/ELF/Symbols.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ELF/Symbols.cpp')
-rw-r--r--ELF/Symbols.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/ELF/Symbols.cpp b/ELF/Symbols.cpp
index 52fa72afa..96e23b9d2 100644
--- a/ELF/Symbols.cpp
+++ b/ELF/Symbols.cpp
@@ -120,20 +120,24 @@ uint64_t Symbol::getVA(int64_t Addend) const {
return OutVA + Addend;
}
-uint64_t Symbol::getGotVA() const { return In.Got->getVA() + getGotOffset(); }
+uint64_t Symbol::getGotVA() const {
+ if (GotInIgot)
+ return In.IgotPlt->getVA() + getGotPltOffset();
+ return In.Got->getVA() + getGotOffset();
+}
uint64_t Symbol::getGotOffset() const {
return GotIndex * Target->GotEntrySize;
}
uint64_t Symbol::getGotPltVA() const {
- if (this->IsInIgot)
+ if (IsInIplt)
return In.IgotPlt->getVA() + getGotPltOffset();
return In.GotPlt->getVA() + getGotPltOffset();
}
uint64_t Symbol::getGotPltOffset() const {
- if (IsInIgot)
+ if (IsInIplt)
return PltIndex * Target->GotPltEntrySize;
return (PltIndex + Target->GotPltHeaderEntriesNum) * Target->GotPltEntrySize;
}