Drop vestigial support for UseLazyBinding=false.
Lazy binding is quite important for use case like a shared build of
llvm. Also, if someone wants to disable it, it is better done in the
compiler (disable plt generation).
The only reason to keep it is to make it easier to add a new
architecture. But it doesn't really help much as it is possible to start
with non lazy relocation and plt code but still let the generic part
create a dedicated .got.plt and .rela.plt.
llvm-svn: 269982
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index b4b5d80..d613df7 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -270,17 +270,14 @@
template <class ELFT> void PltSection<ELFT>::writeTo(uint8_t *Buf) {
size_t Off = 0;
- if (Target->UseLazyBinding) {
- // At beginning of PLT, we have code to call the dynamic linker
- // to resolve dynsyms at runtime. Write such code.
- Target->writePltZero(Buf);
- Off += Target->PltZeroSize;
- }
+ // At beginning of PLT, we have code to call the dynamic linker
+ // to resolve dynsyms at runtime. Write such code.
+ Target->writePltZero(Buf);
+ Off += Target->PltZeroSize;
for (auto &I : Entries) {
const SymbolBody *B = I.first;
unsigned RelOff = I.second;
- uint64_t Got =
- Target->UseLazyBinding ? B->getGotPltVA<ELFT>() : B->getGotVA<ELFT>();
+ uint64_t Got = B->getGotPltVA<ELFT>();
uint64_t Plt = this->getVA() + Off;
Target->writePlt(Buf + Off, Got, Plt, B->PltIndex, RelOff);
Off += Target->PltEntrySize;
@@ -289,9 +286,7 @@
template <class ELFT> void PltSection<ELFT>::addEntry(SymbolBody &Sym) {
Sym.PltIndex = Entries.size();
- unsigned RelOff = Target->UseLazyBinding
- ? Out<ELFT>::RelaPlt->getRelocOffset()
- : Out<ELFT>::RelaDyn->getRelocOffset();
+ unsigned RelOff = Out<ELFT>::RelaPlt->getRelocOffset();
Entries.push_back(std::make_pair(&Sym, RelOff));
}