<div dir="ltr"><div>George, could you please take a look?</div><div><br></div><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/3573/steps/check-lld%20msan/logs/stdio">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/3573/steps/check-lld%20msan/logs/stdio</a><div><br></div><div><pre style="font-family:"courier new",courier,monotype,monospace;font-size:medium"><span class="inbox-inbox-stdout">******************** TEST 'lld :: ELF/mips-64.s' FAILED ********************
Script:
--
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/./bin/llvm-mc -filetype=obj -triple=mips64-unknown-linux /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/test/ELF/mips-64.s -o /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/Output/mips-64.s.tmp.o
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/./bin/ld.lld --full-shutdown -shared /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/Output/mips-64.s.tmp.o -o /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/Output/<a href="http://mips-64.s.tmp.so">mips-64.s.tmp.so</a>
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/./bin/llvm-objdump -t /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/Output/<a href="http://mips-64.s.tmp.so">mips-64.s.tmp.so</a> | /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/./bin/FileCheck -check-prefix=SYM /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/test/ELF/mips-64.s
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/./bin/llvm-readobj -r -dynamic-table -mips-plt-got /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/Output/<a href="http://mips-64.s.tmp.so">mips-64.s.tmp.so</a> | /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_msan/./bin/FileCheck /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/test/ELF/mips-64.s
--
Exit Code: 1

Command Output (stderr):
--
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/test/ELF/mips-64.s:50:15: error: CHECK-NEXT: is not on the line after the previous match
# CHECK-NEXT: ]
              ^
<stdin>:48:2: note: 'next' match was here
 ]
 ^
<stdin>:42:17: note: previous match ended here
 Local entries [
                ^
<stdin>:43:1: note: non-matching line after previous match is here
 Entry {
^

--</span></pre></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 20, 2017 at 9:56 AM George Rimar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: grimar<br class="gmail_msg">
Date: Mon Mar 20 11:44:28 2017<br class="gmail_msg">
New Revision: 298272<br class="gmail_msg">
<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=298272&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=298272&view=rev</a><br class="gmail_msg">
Log:<br class="gmail_msg">
[ELF] - Detemplate MipsGotSection<ELFT><br class="gmail_msg">
<br class="gmail_msg">
This continues detemplation process.<br class="gmail_msg">
<br class="gmail_msg">
Detemplating MipsGotSection<ELFT> is helpfull because can<br class="gmail_msg">
help to detemplate getRelocTargetVA. (one more change is required)<br class="gmail_msg">
It opens road to detemplation of GotSection<ELFT> and probably<br class="gmail_msg">
something else after that.<br class="gmail_msg">
<br class="gmail_msg">
Differential revision: <a href="https://reviews.llvm.org/D31090" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D31090</a><br class="gmail_msg">
<br class="gmail_msg">
Modified:<br class="gmail_msg">
    lld/trunk/ELF/SyntheticSections.cpp<br class="gmail_msg">
    lld/trunk/ELF/SyntheticSections.h<br class="gmail_msg">
    lld/trunk/ELF/Writer.cpp<br class="gmail_msg">
<br class="gmail_msg">
Modified: lld/trunk/ELF/SyntheticSections.cpp<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=298272&r1=298271&r2=298272&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=298272&r1=298271&r2=298272&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- lld/trunk/ELF/SyntheticSections.cpp (original)<br class="gmail_msg">
+++ lld/trunk/ELF/SyntheticSections.cpp Mon Mar 20 11:44:28 2017<br class="gmail_msg">
@@ -665,14 +665,11 @@ template <class ELFT> void GotSection<EL<br class="gmail_msg">
   this->template relocate<ELFT>(Buf, Buf + Size);<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-MipsGotSection<ELFT>::MipsGotSection()<br class="gmail_msg">
+MipsGotSection::MipsGotSection()<br class="gmail_msg">
     : SyntheticSection(SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL, SHT_PROGBITS, 16,<br class="gmail_msg">
                        ".got") {}<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-void MipsGotSection<ELFT>::addEntry(SymbolBody &Sym, int64_t Addend,<br class="gmail_msg">
-                                    RelExpr Expr) {<br class="gmail_msg">
+void MipsGotSection::addEntry(SymbolBody &Sym, int64_t Addend, RelExpr Expr) {<br class="gmail_msg">
   // For "true" local symbols which can be referenced from the same module<br class="gmail_msg">
   // only compiler creates two instructions for address loading:<br class="gmail_msg">
   //<br class="gmail_msg">
@@ -715,7 +712,7 @@ void MipsGotSection<ELFT>::addEntry(Symb<br class="gmail_msg">
     TlsEntries.push_back(&Sym);<br class="gmail_msg">
     return;<br class="gmail_msg">
   }<br class="gmail_msg">
-  auto AddEntry = [&](SymbolBody &S, uintX_t A, GotEntries &Items) {<br class="gmail_msg">
+  auto AddEntry = [&](SymbolBody &S, uint64_t A, GotEntries &Items) {<br class="gmail_msg">
     if (S.isInGot() && !A)<br class="gmail_msg">
       return;<br class="gmail_msg">
     size_t NewIndex = Items.size();<br class="gmail_msg">
@@ -740,8 +737,7 @@ void MipsGotSection<ELFT>::addEntry(Symb<br class="gmail_msg">
   }<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-bool MipsGotSection<ELFT>::addDynTlsEntry(SymbolBody &Sym) {<br class="gmail_msg">
+bool MipsGotSection::addDynTlsEntry(SymbolBody &Sym) {<br class="gmail_msg">
   if (Sym.GlobalDynIndex != -1U)<br class="gmail_msg">
     return false;<br class="gmail_msg">
   Sym.GlobalDynIndex = TlsEntries.size();<br class="gmail_msg">
@@ -753,10 +749,10 @@ bool MipsGotSection<ELFT>::addDynTlsEntr<br class="gmail_msg">
<br class="gmail_msg">
 // Reserves TLS entries for a TLS module ID and a TLS block offset.<br class="gmail_msg">
 // In total it takes two GOT slots.<br class="gmail_msg">
-template <class ELFT> bool MipsGotSection<ELFT>::addTlsIndex() {<br class="gmail_msg">
+bool MipsGotSection::addTlsIndex() {<br class="gmail_msg">
   if (TlsIndexOff != uint32_t(-1))<br class="gmail_msg">
     return false;<br class="gmail_msg">
-  TlsIndexOff = TlsEntries.size() * sizeof(uintX_t);<br class="gmail_msg">
+  TlsIndexOff = TlsEntries.size() * Config->Wordsize;<br class="gmail_msg">
   TlsEntries.push_back(nullptr);<br class="gmail_msg">
   TlsEntries.push_back(nullptr);<br class="gmail_msg">
   return true;<br class="gmail_msg">
@@ -770,25 +766,21 @@ static uint64_t getMipsPageCount(uint64_<br class="gmail_msg">
   return (Size + 0xfffe) / 0xffff + 1;<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-typename MipsGotSection<ELFT>::uintX_t<br class="gmail_msg">
-MipsGotSection<ELFT>::getPageEntryOffset(const SymbolBody &B,<br class="gmail_msg">
-                                         int64_t Addend) const {<br class="gmail_msg">
+uint64_t MipsGotSection::getPageEntryOffset(const SymbolBody &B,<br class="gmail_msg">
+                                            int64_t Addend) const {<br class="gmail_msg">
   const OutputSection *OutSec =<br class="gmail_msg">
       cast<DefinedRegular>(&B)->Section->getOutputSection();<br class="gmail_msg">
-  uintX_t SecAddr = getMipsPageAddr(OutSec->Addr);<br class="gmail_msg">
-  uintX_t SymAddr = getMipsPageAddr(B.getVA(Addend));<br class="gmail_msg">
-  uintX_t Index = PageIndexMap.lookup(OutSec) + (SymAddr - SecAddr) / 0xffff;<br class="gmail_msg">
+  uint64_t SecAddr = getMipsPageAddr(OutSec->Addr);<br class="gmail_msg">
+  uint64_t SymAddr = getMipsPageAddr(B.getVA(Addend));<br class="gmail_msg">
+  uint64_t Index = PageIndexMap.lookup(OutSec) + (SymAddr - SecAddr) / 0xffff;<br class="gmail_msg">
   assert(Index < PageEntriesNum);<br class="gmail_msg">
-  return (HeaderEntriesNum + Index) * sizeof(uintX_t);<br class="gmail_msg">
+  return (HeaderEntriesNum + Index) * Config->Wordsize;<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-typename MipsGotSection<ELFT>::uintX_t<br class="gmail_msg">
-MipsGotSection<ELFT>::getBodyEntryOffset(const SymbolBody &B,<br class="gmail_msg">
-                                         int64_t Addend) const {<br class="gmail_msg">
+uint64_t MipsGotSection::getBodyEntryOffset(const SymbolBody &B,<br class="gmail_msg">
+                                            int64_t Addend) const {<br class="gmail_msg">
   // Calculate offset of the GOT entries block: TLS, global, local.<br class="gmail_msg">
-  uintX_t Index = HeaderEntriesNum + PageEntriesNum;<br class="gmail_msg">
+  uint64_t Index = HeaderEntriesNum + PageEntriesNum;<br class="gmail_msg">
   if (B.isTls())<br class="gmail_msg">
     Index += LocalEntries.size() + LocalEntries32.size() + GlobalEntries.size();<br class="gmail_msg">
   else if (B.IsInGlobalMipsGot)<br class="gmail_msg">
@@ -803,37 +795,31 @@ MipsGotSection<ELFT>::getBodyEntryOffset<br class="gmail_msg">
     assert(It != EntryIndexMap.end());<br class="gmail_msg">
     Index += It->second;<br class="gmail_msg">
   }<br class="gmail_msg">
-  return Index * sizeof(uintX_t);<br class="gmail_msg">
+  return Index * Config->Wordsize;<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-typename MipsGotSection<ELFT>::uintX_t<br class="gmail_msg">
-MipsGotSection<ELFT>::getTlsOffset() const {<br class="gmail_msg">
-  return (getLocalEntriesNum() + GlobalEntries.size()) * sizeof(uintX_t);<br class="gmail_msg">
+uint64_t MipsGotSection::getTlsOffset() const {<br class="gmail_msg">
+  return (getLocalEntriesNum() + GlobalEntries.size()) * Config->Wordsize;<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-typename MipsGotSection<ELFT>::uintX_t<br class="gmail_msg">
-MipsGotSection<ELFT>::getGlobalDynOffset(const SymbolBody &B) const {<br class="gmail_msg">
-  return B.GlobalDynIndex * sizeof(uintX_t);<br class="gmail_msg">
+uint64_t MipsGotSection::getGlobalDynOffset(const SymbolBody &B) const {<br class="gmail_msg">
+  return B.GlobalDynIndex * Config->Wordsize;<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-const SymbolBody *MipsGotSection<ELFT>::getFirstGlobalEntry() const {<br class="gmail_msg">
+const SymbolBody *MipsGotSection::getFirstGlobalEntry() const {<br class="gmail_msg">
   return GlobalEntries.empty() ? nullptr : GlobalEntries.front().first;<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-unsigned MipsGotSection<ELFT>::getLocalEntriesNum() const {<br class="gmail_msg">
+unsigned MipsGotSection::getLocalEntriesNum() const {<br class="gmail_msg">
   return HeaderEntriesNum + PageEntriesNum + LocalEntries.size() +<br class="gmail_msg">
          LocalEntries32.size();<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT> void MipsGotSection<ELFT>::finalizeContents() {<br class="gmail_msg">
+void MipsGotSection::finalizeContents() {<br class="gmail_msg">
   updateAllocSize();<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT> void MipsGotSection<ELFT>::updateAllocSize() {<br class="gmail_msg">
+void MipsGotSection::updateAllocSize() {<br class="gmail_msg">
   PageEntriesNum = 0;<br class="gmail_msg">
   for (std::pair<const OutputSection *, size_t> &P : PageIndexMap) {<br class="gmail_msg">
     // For each output section referenced by GOT page relocations calculate<br class="gmail_msg">
@@ -846,27 +832,29 @@ template <class ELFT> void MipsGotSectio<br class="gmail_msg">
     PageEntriesNum += getMipsPageCount(P.first->Size);<br class="gmail_msg">
   }<br class="gmail_msg">
   Size = (getLocalEntriesNum() + GlobalEntries.size() + TlsEntries.size()) *<br class="gmail_msg">
-         sizeof(uintX_t);<br class="gmail_msg">
+         Config->Wordsize;<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT> bool MipsGotSection<ELFT>::empty() const {<br class="gmail_msg">
+bool MipsGotSection::empty() const {<br class="gmail_msg">
   // We add the .got section to the result for dynamic MIPS target because<br class="gmail_msg">
   // its address and properties are mentioned in the .dynamic section.<br class="gmail_msg">
   return Config->Relocatable;<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-typename MipsGotSection<ELFT>::uintX_t MipsGotSection<ELFT>::getGp() const {<br class="gmail_msg">
+uint64_t MipsGotSection::getGp() const {<br class="gmail_msg">
   return ElfSym::MipsGp->getVA(0);<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT><br class="gmail_msg">
-static void writeUint(uint8_t *Buf, typename ELFT::uint Val) {<br class="gmail_msg">
-  typedef typename ELFT::uint uintX_t;<br class="gmail_msg">
-  write<uintX_t, ELFT::TargetEndianness, sizeof(uintX_t)>(Buf, Val);<br class="gmail_msg">
+static void writeUint(uint8_t *Buf, uint64_t Val) {<br class="gmail_msg">
+  support::endianness E =<br class="gmail_msg">
+      Config->IsLE ? support::endianness::little : support::endianness::big;<br class="gmail_msg">
+  if (Config->Wordsize == 0)<br class="gmail_msg">
+    write64(Buf, Val, E);<br class="gmail_msg">
+  else<br class="gmail_msg">
+    write32(Buf, Val, E);<br class="gmail_msg">
 }<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT> void MipsGotSection<ELFT>::writeTo(uint8_t *Buf) {<br class="gmail_msg">
+void MipsGotSection::writeTo(uint8_t *Buf) {<br class="gmail_msg">
   // Set the MSB of the second GOT slot. This is not required by any<br class="gmail_msg">
   // MIPS ABI documentation, though.<br class="gmail_msg">
   //<br class="gmail_msg">
@@ -881,25 +869,24 @@ template <class ELFT> void MipsGotSectio<br class="gmail_msg">
   // we've been doing this for years, it is probably a safe bet to<br class="gmail_msg">
   // keep doing this for now. We really need to revisit this to see<br class="gmail_msg">
   // if we had to do this.<br class="gmail_msg">
-  auto *P = reinterpret_cast<typename ELFT::Off *>(Buf);<br class="gmail_msg">
-  P[1] = uintX_t(1) << (ELFT::Is64Bits ? 63 : 31);<br class="gmail_msg">
-  Buf += HeaderEntriesNum * sizeof(uintX_t);<br class="gmail_msg">
+  writeUint(Buf + Config->Wordsize, (uint64_t)1 << (Config->Wordsize * 8 - 1));<br class="gmail_msg">
+  Buf += HeaderEntriesNum * Config->Wordsize;<br class="gmail_msg">
   // Write 'page address' entries to the local part of the GOT.<br class="gmail_msg">
   for (std::pair<const OutputSection *, size_t> &L : PageIndexMap) {<br class="gmail_msg">
     size_t PageCount = getMipsPageCount(L.first->Size);<br class="gmail_msg">
-    uintX_t FirstPageAddr = getMipsPageAddr(L.first->Addr);<br class="gmail_msg">
+    uint64_t FirstPageAddr = getMipsPageAddr(L.first->Addr);<br class="gmail_msg">
     for (size_t PI = 0; PI < PageCount; ++PI) {<br class="gmail_msg">
-      uint8_t *Entry = Buf + (L.second + PI) * sizeof(uintX_t);<br class="gmail_msg">
-      writeUint<ELFT>(Entry, FirstPageAddr + PI * 0x10000);<br class="gmail_msg">
+      uint8_t *Entry = Buf + (L.second + PI) * Config->Wordsize;<br class="gmail_msg">
+      writeUint(Entry, FirstPageAddr + PI * 0x10000);<br class="gmail_msg">
     }<br class="gmail_msg">
   }<br class="gmail_msg">
-  Buf += PageEntriesNum * sizeof(uintX_t);<br class="gmail_msg">
+  Buf += PageEntriesNum * Config->Wordsize;<br class="gmail_msg">
   auto AddEntry = [&](const GotEntry &SA) {<br class="gmail_msg">
     uint8_t *Entry = Buf;<br class="gmail_msg">
-    Buf += sizeof(uintX_t);<br class="gmail_msg">
+    Buf += Config->Wordsize;<br class="gmail_msg">
     const SymbolBody *Body = SA.first;<br class="gmail_msg">
-    uintX_t VA = Body->getVA(SA.second);<br class="gmail_msg">
-    writeUint<ELFT>(Entry, VA);<br class="gmail_msg">
+    uint64_t VA = Body->getVA(SA.second);<br class="gmail_msg">
+    writeUint(Entry, VA);<br class="gmail_msg">
   };<br class="gmail_msg">
   std::for_each(std::begin(LocalEntries), std::end(LocalEntries), AddEntry);<br class="gmail_msg">
   std::for_each(std::begin(LocalEntries32), std::end(LocalEntries32), AddEntry);<br class="gmail_msg">
@@ -910,20 +897,20 @@ template <class ELFT> void MipsGotSectio<br class="gmail_msg">
   // for thread-local storage.<br class="gmail_msg">
   // <a href="https://www.linux-mips.org/wiki/NPTL" rel="noreferrer" class="gmail_msg" target="_blank">https://www.linux-mips.org/wiki/NPTL</a><br class="gmail_msg">
   if (TlsIndexOff != -1U && !Config->Pic)<br class="gmail_msg">
-    writeUint<ELFT>(Buf + TlsIndexOff, 1);<br class="gmail_msg">
+    writeUint(Buf + TlsIndexOff, 1);<br class="gmail_msg">
   for (const SymbolBody *B : TlsEntries) {<br class="gmail_msg">
     if (!B || B->isPreemptible())<br class="gmail_msg">
       continue;<br class="gmail_msg">
-    uintX_t VA = B->getVA();<br class="gmail_msg">
+    uint64_t VA = B->getVA();<br class="gmail_msg">
     if (B->GotIndex != -1U) {<br class="gmail_msg">
-      uint8_t *Entry = Buf + B->GotIndex * sizeof(uintX_t);<br class="gmail_msg">
-      writeUint<ELFT>(Entry, VA - 0x7000);<br class="gmail_msg">
+      uint8_t *Entry = Buf + B->GotIndex * Config->Wordsize;<br class="gmail_msg">
+      writeUint(Entry, VA - 0x7000);<br class="gmail_msg">
     }<br class="gmail_msg">
     if (B->GlobalDynIndex != -1U) {<br class="gmail_msg">
-      uint8_t *Entry = Buf + B->GlobalDynIndex * sizeof(uintX_t);<br class="gmail_msg">
-      writeUint<ELFT>(Entry, 1);<br class="gmail_msg">
-      Entry += sizeof(uintX_t);<br class="gmail_msg">
-      writeUint<ELFT>(Entry, VA - 0x8000);<br class="gmail_msg">
+      uint8_t *Entry = Buf + B->GlobalDynIndex * Config->Wordsize;<br class="gmail_msg">
+      writeUint(Entry, 1);<br class="gmail_msg">
+      Entry += Config->Wordsize;<br class="gmail_msg">
+      writeUint(Entry, VA - 0x8000);<br class="gmail_msg">
     }<br class="gmail_msg">
   }<br class="gmail_msg">
 }<br class="gmail_msg">
@@ -2254,6 +2241,7 @@ StringTableSection *InX::DynStrTab;<br class="gmail_msg">
 InputSection *InX::Interp;<br class="gmail_msg">
 GotPltSection *InX::GotPlt;<br class="gmail_msg">
 IgotPltSection *InX::IgotPlt;<br class="gmail_msg">
+MipsGotSection *InX::MipsGot;<br class="gmail_msg">
 MipsRldMapSection *InX::MipsRldMap;<br class="gmail_msg">
 PltSection *InX::Plt;<br class="gmail_msg">
 PltSection *InX::Iplt;<br class="gmail_msg">
@@ -2308,11 +2296,6 @@ template class elf::GotSection<ELF32BE>;<br class="gmail_msg">
 template class elf::GotSection<ELF64LE>;<br class="gmail_msg">
 template class elf::GotSection<ELF64BE>;<br class="gmail_msg">
<br class="gmail_msg">
-template class elf::MipsGotSection<ELF32LE>;<br class="gmail_msg">
-template class elf::MipsGotSection<ELF32BE>;<br class="gmail_msg">
-template class elf::MipsGotSection<ELF64LE>;<br class="gmail_msg">
-template class elf::MipsGotSection<ELF64BE>;<br class="gmail_msg">
-<br class="gmail_msg">
 template class elf::DynamicSection<ELF32LE>;<br class="gmail_msg">
 template class elf::DynamicSection<ELF32BE>;<br class="gmail_msg">
 template class elf::DynamicSection<ELF64LE>;<br class="gmail_msg">
<br class="gmail_msg">
Modified: lld/trunk/ELF/SyntheticSections.h<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=298272&r1=298271&r2=298272&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=298272&r1=298271&r2=298272&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- lld/trunk/ELF/SyntheticSections.h (original)<br class="gmail_msg">
+++ lld/trunk/ELF/SyntheticSections.h Mon Mar 20 11:44:28 2017<br class="gmail_msg">
@@ -169,9 +169,7 @@ private:<br class="gmail_msg">
   size_t Size = 0;<br class="gmail_msg">
 };<br class="gmail_msg">
<br class="gmail_msg">
-template <class ELFT> class MipsGotSection final : public SyntheticSection {<br class="gmail_msg">
-  typedef typename ELFT::uint uintX_t;<br class="gmail_msg">
-<br class="gmail_msg">
+class MipsGotSection final : public SyntheticSection {<br class="gmail_msg">
 public:<br class="gmail_msg">
   MipsGotSection();<br class="gmail_msg">
   void writeTo(uint8_t *Buf) override;<br class="gmail_msg">
@@ -182,9 +180,9 @@ public:<br class="gmail_msg">
   void addEntry(SymbolBody &Sym, int64_t Addend, RelExpr Expr);<br class="gmail_msg">
   bool addDynTlsEntry(SymbolBody &Sym);<br class="gmail_msg">
   bool addTlsIndex();<br class="gmail_msg">
-  uintX_t getPageEntryOffset(const SymbolBody &B, int64_t Addend) const;<br class="gmail_msg">
-  uintX_t getBodyEntryOffset(const SymbolBody &B, int64_t Addend) const;<br class="gmail_msg">
-  uintX_t getGlobalDynOffset(const SymbolBody &B) const;<br class="gmail_msg">
+  uint64_t getPageEntryOffset(const SymbolBody &B, int64_t Addend) const;<br class="gmail_msg">
+  uint64_t getBodyEntryOffset(const SymbolBody &B, int64_t Addend) const;<br class="gmail_msg">
+  uint64_t getGlobalDynOffset(const SymbolBody &B) const;<br class="gmail_msg">
<br class="gmail_msg">
   // Returns the symbol which corresponds to the first entry of the global part<br class="gmail_msg">
   // of GOT on MIPS platform. It is required to fill up MIPS-specific dynamic<br class="gmail_msg">
@@ -198,11 +196,11 @@ public:<br class="gmail_msg">
<br class="gmail_msg">
   // Returns offset of TLS part of the MIPS GOT table. This part goes<br class="gmail_msg">
   // after 'local' and 'global' entries.<br class="gmail_msg">
-  uintX_t getTlsOffset() const;<br class="gmail_msg">
+  uint64_t getTlsOffset() const;<br class="gmail_msg">
<br class="gmail_msg">
   uint32_t getTlsIndexOff() const { return TlsIndexOff; }<br class="gmail_msg">
<br class="gmail_msg">
-  uintX_t getGp() const;<br class="gmail_msg">
+  uint64_t getGp() const;<br class="gmail_msg">
<br class="gmail_msg">
 private:<br class="gmail_msg">
   // MIPS GOT consists of three parts: local, global and tls. Each part<br class="gmail_msg">
@@ -250,7 +248,7 @@ private:<br class="gmail_msg">
   // to the first index of "Page" entries allocated for this section.<br class="gmail_msg">
   llvm::SmallMapVector<const OutputSection *, size_t, 16> PageIndexMap;<br class="gmail_msg">
<br class="gmail_msg">
-  typedef std::pair<const SymbolBody *, uintX_t> GotEntry;<br class="gmail_msg">
+  typedef std::pair<const SymbolBody *, uint64_t> GotEntry;<br class="gmail_msg">
   typedef std::vector<GotEntry> GotEntries;<br class="gmail_msg">
   // Map from Symbol-Addend pair to the GOT index.<br class="gmail_msg">
   llvm::DenseMap<GotEntry, size_t> EntryIndexMap;<br class="gmail_msg">
@@ -266,7 +264,7 @@ private:<br class="gmail_msg">
   std::vector<const SymbolBody *> TlsEntries;<br class="gmail_msg">
<br class="gmail_msg">
   uint32_t TlsIndexOff = -1;<br class="gmail_msg">
-  uintX_t Size = 0;<br class="gmail_msg">
+  uint64_t Size = 0;<br class="gmail_msg">
 };<br class="gmail_msg">
<br class="gmail_msg">
 class GotPltSection final : public SyntheticSection {<br class="gmail_msg">
@@ -766,6 +764,7 @@ struct InX {<br class="gmail_msg">
   static InputSection *Interp;<br class="gmail_msg">
   static GotPltSection *GotPlt;<br class="gmail_msg">
   static IgotPltSection *IgotPlt;<br class="gmail_msg">
+  static MipsGotSection *MipsGot;<br class="gmail_msg">
   static MipsRldMapSection *MipsRldMap;<br class="gmail_msg">
   static PltSection *Plt;<br class="gmail_msg">
   static PltSection *Iplt;<br class="gmail_msg">
@@ -781,7 +780,6 @@ template <class ELFT> struct In : public<br class="gmail_msg">
   static GdbIndexSection<ELFT> *GdbIndex;<br class="gmail_msg">
   static GotSection<ELFT> *Got;<br class="gmail_msg">
   static EhFrameSection<ELFT> *EhFrame;<br class="gmail_msg">
-  static MipsGotSection<ELFT> *MipsGot;<br class="gmail_msg">
   static HashTableSection<ELFT> *HashTab;<br class="gmail_msg">
   static RelocationSection<ELFT> *RelaDyn;<br class="gmail_msg">
   static RelocationSection<ELFT> *RelaPlt;<br class="gmail_msg">
@@ -799,7 +797,6 @@ template <class ELFT> GdbIndexSection<EL<br class="gmail_msg">
 template <class ELFT> GnuHashTableSection<ELFT> *In<ELFT>::GnuHashTab;<br class="gmail_msg">
 template <class ELFT> GotSection<ELFT> *In<ELFT>::Got;<br class="gmail_msg">
 template <class ELFT> EhFrameSection<ELFT> *In<ELFT>::EhFrame;<br class="gmail_msg">
-template <class ELFT> MipsGotSection<ELFT> *In<ELFT>::MipsGot;<br class="gmail_msg">
 template <class ELFT> HashTableSection<ELFT> *In<ELFT>::HashTab;<br class="gmail_msg">
 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaDyn;<br class="gmail_msg">
 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaPlt;<br class="gmail_msg">
<br class="gmail_msg">
Modified: lld/trunk/ELF/Writer.cpp<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=298272&r1=298271&r2=298272&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=298272&r1=298271&r2=298272&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- lld/trunk/ELF/Writer.cpp (original)<br class="gmail_msg">
+++ lld/trunk/ELF/Writer.cpp Mon Mar 20 11:44:28 2017<br class="gmail_msg">
@@ -415,7 +415,7 @@ template <class ELFT> void Writer<ELFT>:<br class="gmail_msg">
   // Add .got. MIPS' .got is so different from the other archs,<br class="gmail_msg">
   // it has its own class.<br class="gmail_msg">
   if (Config->EMachine == EM_MIPS) {<br class="gmail_msg">
-    In<ELFT>::MipsGot = make<MipsGotSection<ELFT>>();<br class="gmail_msg">
+    In<ELFT>::MipsGot = make<MipsGotSection>();<br class="gmail_msg">
     Add(In<ELFT>::MipsGot);<br class="gmail_msg">
   } else {<br class="gmail_msg">
     In<ELFT>::Got = make<GotSection<ELFT>>();<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div>