[PATCH] D54917: [ELF] Simplify Symbol::getPltVA logic
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 27 14:25:18 PST 2018
MaskRay updated this revision to Diff 175583.
MaskRay added a comment.
Delete unintended change to Target.h
Repository:
rLLD LLVM Linker
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54917/new/
https://reviews.llvm.org/D54917
Files:
ELF/Symbols.cpp
ELF/SyntheticSections.h
Index: ELF/SyntheticSections.h
===================================================================
--- ELF/SyntheticSections.h
+++ ELF/SyntheticSections.h
@@ -662,10 +662,11 @@
template <class ELFT> void addEntry(Symbol &Sym);
+ size_t HeaderSize;
+
private:
unsigned getPltRelocOff() const;
std::vector<std::pair<const Symbol *, unsigned>> Entries;
- size_t HeaderSize;
bool IsIplt;
};
Index: ELF/Symbols.cpp
===================================================================
--- ELF/Symbols.cpp
+++ ELF/Symbols.cpp
@@ -144,12 +144,8 @@
}
uint64_t Symbol::getPltVA() const {
- if (this->IsInIplt) {
- if (Config->ZRetpolineplt)
- return In.Iplt->getVA() + Target->getPltEntryOffset(PltIndex);
- return In.Iplt->getVA() + PltIndex * Target->PltEntrySize;
- }
- return In.Plt->getVA() + Target->getPltEntryOffset(PltIndex);
+ PltSection *Plt = IsInIplt ? In.Iplt : In.Plt;
+ return Plt->getVA() + Plt->HeaderSize + PltIndex * Target->PltEntrySize;
}
uint64_t Symbol::getPltOffset() const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54917.175583.patch
Type: text/x-patch
Size: 1036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181127/bf1cf10d/attachment.bin>
More information about the llvm-commits
mailing list