diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-04-26 16:09:30 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-04-26 16:09:30 +0000 |
| commit | f4a9d56a9a413e2d9d9a7ebd353304f9bf9a0d0a (patch) | |
| tree | 0880b5e98df38ed591a49b7ffa61de98aef4ad6a | |
| parent | 8086b9db3df2a3e63170739b6f8a418cbe5f05be (diff) | |
| download | bcm5719-llvm-f4a9d56a9a413e2d9d9a7ebd353304f9bf9a0d0a.tar.gz bcm5719-llvm-f4a9d56a9a413e2d9d9a7ebd353304f9bf9a0d0a.zip | |
Delete GotPltIndex.
It was always an offset of PltIndex.
This doesn't reduce the size of the structures, but makes it easier to
do so in a followup patch.
llvm-svn: 330953
| -rw-r--r-- | lld/ELF/Symbols.cpp | 4 | ||||
| -rw-r--r-- | lld/ELF/Symbols.h | 1 | ||||
| -rw-r--r-- | lld/ELF/SyntheticSections.cpp | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp index 474cc1fccd4..4c5878bf24e 100644 --- a/lld/ELF/Symbols.cpp +++ b/lld/ELF/Symbols.cpp @@ -132,7 +132,9 @@ uint64_t Symbol::getGotPltVA() const { } uint64_t Symbol::getGotPltOffset() const { - return GotPltIndex * Target->GotPltEntrySize; + if (IsInIgot) + return PltIndex * Target->GotPltEntrySize; + return (PltIndex + Target->GotPltHeaderEntriesNum) * Target->GotPltEntrySize; } uint64_t Symbol::getPltVA() const { diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h index 78391fc1db2..51925aa8e2d 100644 --- a/lld/ELF/Symbols.h +++ b/lld/ELF/Symbols.h @@ -69,7 +69,6 @@ protected: public: uint32_t DynsymIndex = 0; uint32_t GotIndex = -1; - uint32_t GotPltIndex = -1; uint32_t PltIndex = -1; uint32_t GlobalDynIndex = -1; diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 08c91424940..6102e5faf42 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -887,7 +887,7 @@ GotPltSection::GotPltSection() Target->GotPltEntrySize, ".got.plt") {} void GotPltSection::addEntry(Symbol &Sym) { - Sym.GotPltIndex = Target->GotPltHeaderEntriesNum + Entries.size(); + assert(Sym.PltIndex == Entries.size()); Entries.push_back(&Sym); } @@ -922,7 +922,7 @@ IgotPltSection::IgotPltSection() void IgotPltSection::addEntry(Symbol &Sym) { Sym.IsInIgot = true; - Sym.GotPltIndex = Entries.size(); + assert(Sym.PltIndex == Entries.size()); Entries.push_back(&Sym); } |

