diff options
| author | Eugene Leviant <eleviant@accesssoftek.com> | 2016-11-18 14:35:03 +0000 |
|---|---|---|
| committer | Eugene Leviant <eleviant@accesssoftek.com> | 2016-11-18 14:35:03 +0000 |
| commit | ff23d3e741ee9d7f7f1bd4a5cb0ff43b8b76389b (patch) | |
| tree | aeee9adbcc9a5eb69f178304272b85478008ae09 /lld/ELF/OutputSections.cpp | |
| parent | df613198c0d6d208f57f02abc882b36b686fef64 (diff) | |
| download | bcm5719-llvm-ff23d3e741ee9d7f7f1bd4a5cb0ff43b8b76389b.tar.gz bcm5719-llvm-ff23d3e741ee9d7f7f1bd4a5cb0ff43b8b76389b.zip | |
[ELF] Convert PltSection to input section
Differential revision: https://reviews.llvm.org/D26842
llvm-svn: 287346
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 21198828b00..cdbe6284a39 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -108,38 +108,6 @@ template <class ELFT> void GdbIndexSection<ELFT>::writeTo(uint8_t *Buf) { } } -template <class ELFT> -PltSection<ELFT>::PltSection() - : OutputSectionBase(".plt", SHT_PROGBITS, SHF_ALLOC | SHF_EXECINSTR) { - this->Addralign = 16; -} - -template <class ELFT> void PltSection<ELFT>::writeTo(uint8_t *Buf) { - // At beginning of PLT, we have code to call the dynamic linker - // to resolve dynsyms at runtime. Write such code. - Target->writePltHeader(Buf); - size_t Off = Target->PltHeaderSize; - - for (auto &I : Entries) { - const SymbolBody *B = I.first; - unsigned RelOff = I.second; - uint64_t Got = B->getGotPltVA<ELFT>(); - uint64_t Plt = this->Addr + Off; - Target->writePlt(Buf + Off, Got, Plt, B->PltIndex, RelOff); - Off += Target->PltEntrySize; - } -} - -template <class ELFT> void PltSection<ELFT>::addEntry(SymbolBody &Sym) { - Sym.PltIndex = Entries.size(); - unsigned RelOff = In<ELFT>::RelaPlt->getRelocOffset(); - Entries.push_back(std::make_pair(&Sym, RelOff)); -} - -template <class ELFT> void PltSection<ELFT>::finalize() { - this->Size = Target->PltHeaderSize + Entries.size() * Target->PltEntrySize; -} - // Returns the number of version definition entries. Because the first entry // is for the version definition itself, it is the number of versioned symbols // plus one. Note that we don't support multiple versions yet. @@ -894,11 +862,6 @@ template class EhFrameHeader<ELF32BE>; template class EhFrameHeader<ELF64LE>; template class EhFrameHeader<ELF64BE>; -template class PltSection<ELF32LE>; -template class PltSection<ELF32BE>; -template class PltSection<ELF64LE>; -template class PltSection<ELF64BE>; - template class OutputSection<ELF32LE>; template class OutputSection<ELF32BE>; template class OutputSection<ELF64LE>; |

