From 4b1c3696e3ac8935742659eb2c518efdac02eedf Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 11 May 2017 21:23:38 +0000 Subject: [PATCH] Reduce template usage. NFC. llvm-svn: 302826 --- lld/ELF/Relocations.cpp | 4 ++-- lld/ELF/SyntheticSections.cpp | 2 +- lld/ELF/Target.cpp | 4 ++-- lld/ELF/Writer.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index f5db931..0570ed0 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -877,8 +877,8 @@ static void scanRelocs(InputSectionBase &Sec, ArrayRef Rels) { addPltEntry(InX::Iplt, In::IgotPlt, In::RelaIplt, Target->IRelativeRel, Body, true); else - addPltEntry(InX::Plt, In::GotPlt, In::RelaPlt, - Target->PltRel, Body, !Preemptible); + addPltEntry(InX::Plt, InX::GotPlt, In::RelaPlt, Target->PltRel, + Body, !Preemptible); } // Create a GOT slot if a relocation needs GOT. diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index b023aa8..6d6d22f 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -1093,7 +1093,7 @@ template void DynamicSection::finalizeContents() { add({DT_JMPREL, In::RelaPlt}); add({DT_PLTRELSZ, In::RelaPlt->OutSec->Size}); add({Config->EMachine == EM_MIPS ? DT_MIPS_PLTGOT : DT_PLTGOT, - In::GotPlt}); + InX::GotPlt}); add({DT_PLTREL, uint64_t(Config->IsRela ? DT_RELA : DT_REL)}); } diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 5c71aee..7a70bb9 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -736,7 +736,7 @@ void X86_64TargetInfo::writePltHeader(uint8_t *Buf) const { 0x0f, 0x1f, 0x40, 0x00 // nop }; memcpy(Buf, PltData, sizeof(PltData)); - uint64_t GotPlt = In::GotPlt->getVA(); + uint64_t GotPlt = InX::GotPlt->getVA(); uint64_t Plt = In::Plt->getVA(); write32le(Buf + 2, GotPlt - Plt + 2); // GOTPLT+8 write32le(Buf + 8, GotPlt - Plt + 4); // GOTPLT+16 @@ -2203,7 +2203,7 @@ void MipsTargetInfo::writePltHeader(uint8_t *Buf) const { write32(Buf + 24, 0x0320f809); // jalr $25 write32(Buf + 28, 0x2718fffe); // subu $24, $24, 2 - uint64_t GotPlt = In::GotPlt->getVA(); + uint64_t GotPlt = InX::GotPlt->getVA(); writeMipsHi16(Buf, GotPlt); writeMipsLo16(Buf + 4, GotPlt); writeMipsLo16(Buf + 8, GotPlt); diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index e31f64e..5be4eb2 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -408,8 +408,8 @@ template void Writer::createSyntheticSections() { Add(In::Got); } - In::GotPlt = make(); - Add(In::GotPlt); + InX::GotPlt = make(); + Add(InX::GotPlt); In::IgotPlt = make(); Add(In::IgotPlt); @@ -620,7 +620,7 @@ template bool elf::isRelroSection(const OutputSection *Sec) { // by default resolved lazily, so we usually cannot put it into RELRO. // However, if "-z now" is given, the lazy symbol resolution is // disabled, which enables us to put it into RELRO. - if (Sec == In::GotPlt->OutSec) + if (Sec == InX::GotPlt->OutSec) return Config->ZNow; // .dynamic section contains data for the dynamic linker, and @@ -1185,7 +1185,7 @@ template void Writer::finalizeSections() { In::GnuHashTab, In::HashTab, In::SymTab, In::ShStrTab, In::StrTab, In::VerDef, In::DynStrTab, In::GdbIndex, In::Got, - In::MipsGot, In::IgotPlt, In::GotPlt, + In::MipsGot, In::IgotPlt, InX::GotPlt, In::RelaDyn, In::RelaIplt, In::RelaPlt, In::Plt, In::Iplt, In::Plt, In::EhFrameHdr, In::VerSym, In::VerNeed, -- 2.7.4