<div dir="ltr">Thank you for doing this!</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 17, 2016 at 1:49 PM, Simon Atanasyan via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: atanasyan<br>
Date: Thu Nov 17 15:49:14 2016<br>
New Revision: 287264<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=287264&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=287264&view=rev</a><br>
Log:<br>
[ELF][MIPS] Remove 'mips' word from MipsGotSection fields and methods names. NFC<br>
<br>
Also add new comments with MIPS GOT description.<br>
<br>
Modified:<br>
    lld/trunk/ELF/InputSection.cpp<br>
    lld/trunk/ELF/<wbr>SyntheticSections.cpp<br>
    lld/trunk/ELF/<wbr>SyntheticSections.h<br>
<br>
Modified: lld/trunk/ELF/InputSection.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=287264&r1=287263&r2=287264&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>InputSection.cpp?rev=287264&<wbr>r1=287263&r2=287264&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/InputSection.cpp (original)<br>
+++ lld/trunk/ELF/InputSection.cpp Thu Nov 17 15:49:14 2016<br>
@@ -382,21 +382,21 @@ static typename ELFT::uint getSymVA(uint<br>
     // If relocation against MIPS local symbol requires GOT entry, this entry<br>
     // should be initialized by 'page address'. This address is high 16-bits<br>
     // of sum the symbol's value and the addend.<br>
-    return In<ELFT>::MipsGot-><wbr>getMipsLocalPageOffset(Body.<wbr>getVA<ELFT>(A));<br>
+    return In<ELFT>::MipsGot-><wbr>getPageEntryOffset(Body.getVA<<wbr>ELFT>(A));<br>
   case R_MIPS_GOT_OFF:<br>
   case R_MIPS_GOT_OFF32:<br>
     // In case of MIPS if a GOT relocation has non-zero addend this addend<br>
     // should be applied to the GOT entry content not to the GOT entry offset.<br>
     // That is why we use separate expression type.<br>
-    return In<ELFT>::MipsGot-><wbr>getMipsGotOffset(Body, A);<br>
+    return In<ELFT>::MipsGot-><wbr>getBodyEntryOffset(Body, A);<br>
   case R_MIPS_GOTREL:<br>
     return Body.getVA<ELFT>(A) - In<ELFT>::MipsGot->getVA() - MipsGPOffset;<br>
   case R_MIPS_TLSGD:<br>
     return In<ELFT>::MipsGot-><wbr>getGlobalDynOffset(Body) +<br>
-           In<ELFT>::MipsGot-><wbr>getMipsTlsOffset() - MipsGPOffset;<br>
+           In<ELFT>::MipsGot-><wbr>getTlsOffset() - MipsGPOffset;<br>
   case R_MIPS_TLSLD:<br>
     return In<ELFT>::MipsGot-><wbr>getTlsIndexOff() +<br>
-           In<ELFT>::MipsGot-><wbr>getMipsTlsOffset() - MipsGPOffset;<br>
+           In<ELFT>::MipsGot-><wbr>getTlsOffset() - MipsGPOffset;<br>
   case R_PPC_OPD: {<br>
     uint64_t SymVA = Body.getVA<ELFT>(A);<br>
     // If we have an undefined weak symbol, we might get here with a symbol<br>
<br>
Modified: lld/trunk/ELF/<wbr>SyntheticSections.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=287264&r1=287263&r2=287264&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>SyntheticSections.cpp?rev=<wbr>287264&r1=287263&r2=287264&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/<wbr>SyntheticSections.cpp (original)<br>
+++ lld/trunk/ELF/<wbr>SyntheticSections.cpp Thu Nov 17 15:49:14 2016<br>
@@ -443,22 +443,22 @@ void MipsGotSection<ELFT>::<wbr>addEntry(Symb<br>
     // method calculate number of "pages" required to cover all saved output<br>
     // section and allocate appropriate number of GOT entries.<br>
     auto *OutSec = cast<DefinedRegular<ELFT>>(&<wbr>Sym)->Section->OutSec;<br>
-    MipsOutSections.insert(OutSec)<wbr>;<br>
+    OutSections.insert(OutSec);<br>
     return;<br>
   }<br>
   if (Sym.isTls()) {<br>
     // GOT entries created for MIPS TLS relocations behave like<br>
     // almost GOT entries from other ABIs. They go to the end<br>
     // of the global offset table.<br>
-    Sym.GotIndex = Entries.size();<br>
-    Entries.push_back(&Sym);<br>
+    Sym.GotIndex = TlsEntries.size();<br>
+    TlsEntries.push_back(&Sym);<br>
     return;<br>
   }<br>
-  auto AddEntry = [&](SymbolBody &S, uintX_t A, MipsGotEntries &Items) {<br>
+  auto AddEntry = [&](SymbolBody &S, uintX_t A, GotEntries &Items) {<br>
     if (S.isInGot() && !A)<br>
       return;<br>
     size_t NewIndex = Items.size();<br>
-    if (!MipsGotMap.insert({{&S, A}, NewIndex}).second)<br>
+    if (!EntryIndexMap.insert({{&S, A}, NewIndex}).second)<br>
       return;<br>
     Items.emplace_back(&S, A);<br>
     if (!A)<br>
@@ -466,26 +466,26 @@ void MipsGotSection<ELFT>::<wbr>addEntry(Symb<br>
   };<br>
   if (Sym.isPreemptible()) {<br>
     // Ignore addends for preemptible symbols. They got single GOT entry anyway.<br>
-    AddEntry(Sym, 0, MipsGlobal);<br>
+    AddEntry(Sym, 0, GlobalEntries);<br>
     Sym.IsInGlobalMipsGot = true;<br>
   } else if (Expr == R_MIPS_GOT_OFF32) {<br>
-    AddEntry(Sym, Addend, MipsLocal32);<br>
+    AddEntry(Sym, Addend, LocalEntries32);<br>
     Sym.Is32BitMipsGot = true;<br>
   } else {<br>
     // Hold local GOT entries accessed via a 16-bit index separately.<br>
     // That allows to write them in the beginning of the GOT and keep<br>
     // their indexes as less as possible to escape relocation's overflow.<br>
-    AddEntry(Sym, Addend, MipsLocal);<br>
+    AddEntry(Sym, Addend, LocalEntries);<br>
   }<br>
 }<br>
<br>
 template <class ELFT> bool MipsGotSection<ELFT>::<wbr>addDynTlsEntry(SymbolBody &Sym) {<br>
   if (Sym.GlobalDynIndex != -1U)<br>
     return false;<br>
-  Sym.GlobalDynIndex = Entries.size();<br>
+  Sym.GlobalDynIndex = TlsEntries.size();<br>
   // Global Dynamic TLS entries take two GOT slots.<br>
-  Entries.push_back(nullptr);<br>
-  Entries.push_back(&Sym);<br>
+  TlsEntries.push_back(nullptr);<br>
+  TlsEntries.push_back(&Sym);<br>
   return true;<br>
 }<br>
<br>
@@ -494,54 +494,56 @@ template <class ELFT> bool MipsGotSectio<br>
 template <class ELFT> bool MipsGotSection<ELFT>::<wbr>addTlsIndex() {<br>
   if (TlsIndexOff != uint32_t(-1))<br>
     return false;<br>
-  TlsIndexOff = Entries.size() * sizeof(uintX_t);<br>
-  Entries.push_back(nullptr);<br>
-  Entries.push_back(nullptr);<br>
+  TlsIndexOff = TlsEntries.size() * sizeof(uintX_t);<br>
+  TlsEntries.push_back(nullptr);<br>
+  TlsEntries.push_back(nullptr);<br>
   return true;<br>
 }<br>
<br>
 template <class ELFT><br>
 typename MipsGotSection<ELFT>::uintX_t<br>
-MipsGotSection<ELFT>::<wbr>getMipsLocalPageOffset(uintX_t EntryValue) {<br>
+MipsGotSection<ELFT>::<wbr>getPageEntryOffset(uintX_t EntryValue) {<br>
   // Initialize the entry by the %hi(EntryValue) expression<br>
   // but without right-shifting.<br>
   EntryValue = (EntryValue + 0x8000) & ~0xffff;<br>
   // Take into account MIPS GOT header.<br>
   // See comment in the MipsGotSection::writeTo.<br>
-  size_t NewIndex = MipsLocalGotPos.size() + 2;<br>
-  auto P = MipsLocalGotPos.insert(std::<wbr>make_pair(EntryValue, NewIndex));<br>
-  assert(!P.second || MipsLocalGotPos.size() <= MipsPageEntries);<br>
+  size_t NewIndex = PageIndexMap.size() + 2;<br>
+  auto P = PageIndexMap.insert(std::make_<wbr>pair(EntryValue, NewIndex));<br>
+  assert(!P.second || PageIndexMap.size() <= PageEntriesNum);<br>
   return (uintX_t)P.first->second * sizeof(uintX_t) - MipsGPOffset;<br>
 }<br>
<br>
 template <class ELFT><br>
 typename MipsGotSection<ELFT>::uintX_t<br>
-MipsGotSection<ELFT>::<wbr>getMipsGotOffset(const SymbolBody &B, uintX_t Addend) const {<br>
+MipsGotSection<ELFT>::<wbr>getBodyEntryOffset(const SymbolBody &B,<br>
+                                         uintX_t Addend) const {<br>
   // Calculate offset of the GOT entries block: TLS, global, local.<br>
   uintX_t GotBlockOff;<br>
   if (B.isTls())<br>
-    GotBlockOff = getMipsTlsOffset();<br>
+    GotBlockOff = getTlsOffset();<br>
   else if (B.IsInGlobalMipsGot)<br>
-    GotBlockOff = getMipsLocalEntriesNum() * sizeof(uintX_t);<br>
+    GotBlockOff = getLocalEntriesNum() * sizeof(uintX_t);<br>
   else if (B.Is32BitMipsGot)<br>
-    GotBlockOff = (MipsPageEntries + MipsLocal.size()) * sizeof(uintX_t);<br>
+    GotBlockOff = (PageEntriesNum + LocalEntries.size()) * sizeof(uintX_t);<br>
   else<br>
-    GotBlockOff = MipsPageEntries * sizeof(uintX_t);<br>
+    GotBlockOff = PageEntriesNum * sizeof(uintX_t);<br>
   // Calculate index of the GOT entry in the block.<br>
   uintX_t GotIndex;<br>
   if (B.isInGot())<br>
     GotIndex = B.GotIndex;<br>
   else {<br>
-    auto It = MipsGotMap.find({&B, Addend});<br>
-    assert(It != MipsGotMap.end());<br>
+    auto It = EntryIndexMap.find({&B, Addend});<br>
+    assert(It != EntryIndexMap.end());<br>
     GotIndex = It->second;<br>
   }<br>
   return GotBlockOff + GotIndex * sizeof(uintX_t) - MipsGPOffset;<br>
 }<br>
<br>
 template <class ELFT><br>
-typename MipsGotSection<ELFT>::uintX_t MipsGotSection<ELFT>::<wbr>getMipsTlsOffset() const {<br>
-  return (getMipsLocalEntriesNum() + MipsGlobal.size()) * sizeof(uintX_t);<br>
+typename MipsGotSection<ELFT>::uintX_t<br>
+MipsGotSection<ELFT>::<wbr>getTlsOffset() const {<br>
+  return (getLocalEntriesNum() + GlobalEntries.size()) * sizeof(uintX_t);<br>
 }<br>
<br>
 template <class ELFT><br>
@@ -551,29 +553,29 @@ MipsGotSection<ELFT>::<wbr>getGlobalDynOffset<br>
 }<br>
<br>
 template <class ELFT><br>
-const SymbolBody *MipsGotSection<ELFT>::<wbr>getMipsFirstGlobalEntry() const {<br>
-  return MipsGlobal.empty() ? nullptr : MipsGlobal.front().first;<br>
+const SymbolBody *MipsGotSection<ELFT>::<wbr>getFirstGlobalEntry() const {<br>
+  return GlobalEntries.empty() ? nullptr : GlobalEntries.front().first;<br>
 }<br>
<br>
 template <class ELFT><br>
-unsigned MipsGotSection<ELFT>::<wbr>getMipsLocalEntriesNum() const {<br>
-  return MipsPageEntries + MipsLocal.size() + MipsLocal32.size();<br>
+unsigned MipsGotSection<ELFT>::<wbr>getLocalEntriesNum() const {<br>
+  return PageEntriesNum + LocalEntries.size() + LocalEntries32.size();<br>
 }<br>
<br>
 template <class ELFT> void MipsGotSection<ELFT>::<wbr>finalize() {<br>
-  size_t EntriesNum = Entries.size();<br>
+  size_t EntriesNum = TlsEntries.size();<br>
   // Take into account MIPS GOT header.<br>
   // See comment in the MipsGotSection::writeTo.<br>
-  MipsPageEntries += 2;<br>
-  for (const OutputSectionBase *OutSec : MipsOutSections) {<br>
+  PageEntriesNum += 2;<br>
+  for (const OutputSectionBase *OutSec : OutSections) {<br>
     // Calculate an upper bound of MIPS GOT entries required to store page<br>
     // addresses of local symbols. We assume the worst case - each 64kb<br>
     // page of the output section has at least one GOT relocation against it.<br>
     // Add 0x8000 to the section's size because the page address stored<br>
     // in the GOT entry is calculated as (value + 0x8000) & ~0xffff.<br>
-    MipsPageEntries += (OutSec->Size + 0x8000 + 0xfffe) / 0xffff;<br>
+    PageEntriesNum += (OutSec->Size + 0x8000 + 0xfffe) / 0xffff;<br>
   }<br>
-  EntriesNum += getMipsLocalEntriesNum() + MipsGlobal.size();<br>
+  EntriesNum += getLocalEntriesNum() + GlobalEntries.size();<br>
   Size = EntriesNum * sizeof(uintX_t);<br>
 }<br>
<br>
@@ -601,21 +603,21 @@ template <class ELFT> void MipsGotSectio<br>
   auto *P = reinterpret_cast<typename ELFT::Off *>(Buf);<br>
   P[1] = uintX_t(1) << (ELFT::Is64Bits ? 63 : 31);<br>
   // Write 'page address' entries to the local part of the GOT.<br>
-  for (std::pair<uintX_t, size_t> &L : MipsLocalGotPos) {<br>
+  for (std::pair<uintX_t, size_t> &L : PageIndexMap) {<br>
     uint8_t *Entry = Buf + L.second * sizeof(uintX_t);<br>
     writeUint<ELFT>(Entry, L.first);<br>
   }<br>
-  Buf += MipsPageEntries * sizeof(uintX_t);<br>
-  auto AddEntry = [&](const MipsGotEntry &SA) {<br>
+  Buf += PageEntriesNum * sizeof(uintX_t);<br>
+  auto AddEntry = [&](const GotEntry &SA) {<br>
     uint8_t *Entry = Buf;<br>
     Buf += sizeof(uintX_t);<br>
     const SymbolBody *Body = SA.first;<br>
     uintX_t VA = Body->template getVA<ELFT>(SA.second);<br>
     writeUint<ELFT>(Entry, VA);<br>
   };<br>
-  std::for_each(std::begin(<wbr>MipsLocal), std::end(MipsLocal), AddEntry);<br>
-  std::for_each(std::begin(<wbr>MipsLocal32), std::end(MipsLocal32), AddEntry);<br>
-  std::for_each(std::begin(<wbr>MipsGlobal), std::end(MipsGlobal), AddEntry);<br>
+  std::for_each(std::begin(<wbr>LocalEntries), std::end(LocalEntries), AddEntry);<br>
+  std::for_each(std::begin(<wbr>LocalEntries32), std::end(LocalEntries32), AddEntry);<br>
+  std::for_each(std::begin(<wbr>GlobalEntries), std::end(GlobalEntries), AddEntry);<br>
   // Initialize TLS-related GOT entries. If the entry has a corresponding<br>
   // dynamic relocations, leave it initialized by zero. Write down adjusted<br>
   // TLS symbol's values otherwise. To calculate the adjustments use offsets<br>
@@ -623,7 +625,7 @@ template <class ELFT> void MipsGotSectio<br>
   // <a href="https://www.linux-mips.org/wiki/NPTL" rel="noreferrer" target="_blank">https://www.linux-mips.org/<wbr>wiki/NPTL</a><br>
   if (TlsIndexOff != -1U && !Config->Pic)<br>
     writeUint<ELFT>(Buf + TlsIndexOff, 1);<br>
-  for (const SymbolBody *B : Entries) {<br>
+  for (const SymbolBody *B : TlsEntries) {<br>
     if (!B || B->isPreemptible())<br>
       continue;<br>
     uintX_t VA = B->getVA<ELFT>();<br>
@@ -832,8 +834,8 @@ template <class ELFT> void DynamicSectio<br>
     add({DT_MIPS_FLAGS, RHF_NOTPOT});<br>
     add({DT_MIPS_BASE_ADDRESS, Config->ImageBase});<br>
     add({DT_MIPS_SYMTABNO, In<ELFT>::DynSymTab-><wbr>getNumSymbols()});<br>
-    add({DT_MIPS_LOCAL_GOTNO, In<ELFT>::MipsGot-><wbr>getMipsLocalEntriesNum()});<br>
-    if (const SymbolBody *B = In<ELFT>::MipsGot-><wbr>getMipsFirstGlobalEntry())<br>
+    add({DT_MIPS_LOCAL_GOTNO, In<ELFT>::MipsGot-><wbr>getLocalEntriesNum()});<br>
+    if (const SymbolBody *B = In<ELFT>::MipsGot-><wbr>getFirstGlobalEntry())<br>
       add({DT_MIPS_GOTSYM, B->DynsymIndex});<br>
     else<br>
       add({DT_MIPS_GOTSYM, In<ELFT>::DynSymTab-><wbr>getNumSymbols()});<br>
@@ -933,7 +935,7 @@ template <class ELFT> void RelocationSec<br>
       // Dynamic relocation against MIPS GOT section make deal TLS entries<br>
       // allocated in the end of the GOT. We need to adjust the offset to take<br>
       // in account 'local' and 'global' GOT entries.<br>
-      P->r_offset += In<ELFT>::MipsGot-><wbr>getMipsTlsOffset();<br>
+      P->r_offset += In<ELFT>::MipsGot-><wbr>getTlsOffset();<br>
     P->setSymbolAndType(Rel.<wbr>getSymIndex(), Rel.Type, Config->Mips64EL);<br>
   }<br>
<br>
<br>
Modified: lld/trunk/ELF/<wbr>SyntheticSections.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=287264&r1=287263&r2=287264&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>SyntheticSections.h?rev=<wbr>287264&r1=287263&r2=287264&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/<wbr>SyntheticSections.h (original)<br>
+++ lld/trunk/ELF/<wbr>SyntheticSections.h Thu Nov 17 15:49:14 2016<br>
@@ -178,49 +178,89 @@ public:<br>
   void addEntry(SymbolBody &Sym, uintX_t Addend, RelExpr Expr);<br>
   bool addDynTlsEntry(SymbolBody &Sym);<br>
   bool addTlsIndex();<br>
-  bool empty() const { return MipsPageEntries == 0 && Entries.empty(); }<br>
-  uintX_t getMipsLocalPageOffset(uintX_t Addr);<br>
-  uintX_t getMipsGotOffset(const SymbolBody &B, uintX_t Addend) const;<br>
+  bool empty() const { return PageEntriesNum == 0 && TlsEntries.empty(); }<br>
+  uintX_t getPageEntryOffset(uintX_t Addr);<br>
+  uintX_t getBodyEntryOffset(const SymbolBody &B, uintX_t Addend) const;<br>
   uintX_t getGlobalDynOffset(const SymbolBody &B) const;<br>
<br>
   // Returns the symbol which corresponds to the first entry of the global part<br>
   // of GOT on MIPS platform. It is required to fill up MIPS-specific dynamic<br>
   // table properties.<br>
   // Returns nullptr if the global part is empty.<br>
-  const SymbolBody *getMipsFirstGlobalEntry() const;<br>
+  const SymbolBody *getFirstGlobalEntry() const;<br>
<br>
   // Returns the number of entries in the local part of GOT including<br>
-  // the number of reserved entries. This method is MIPS-specific.<br>
-  unsigned getMipsLocalEntriesNum() const;<br>
+  // the number of reserved entries.<br>
+  unsigned getLocalEntriesNum() const;<br>
<br>
   // Returns offset of TLS part of the MIPS GOT table. This part goes<br>
   // after 'local' and 'global' entries.<br>
-  uintX_t getMipsTlsOffset() const;<br>
+  uintX_t getTlsOffset() const;<br>
<br>
   uint32_t getTlsIndexOff() const { return TlsIndexOff; }<br>
<br>
 private:<br>
-  std::vector<const SymbolBody *> Entries;<br>
-  uint32_t TlsIndexOff = -1;<br>
-  uint32_t MipsPageEntries = 0;<br>
-  uintX_t Size = 0;<br>
+  // MIPS GOT consists of three parts: local, global and tls. Each part<br>
+  // contains different types of entries. Here is a layout of GOT:<br>
+  // - Header entries                |<br>
+  // - Page entries                  |   Local part<br>
+  // - Local entries (16-bit access) |<br>
+  // - Local entries (32-bit access) |<br>
+  // - Normal global entries         ||  Global part<br>
+  // - Reloc-only global entries     ||<br>
+  // - TLS entries                   ||| TLS part<br>
+  //<br>
+  // Header:<br>
+  //   Two entries hold predefined value 0x0 and 0x80000000.<br>
+  // Page entries:<br>
+  //   These entries created by R_MIPS_GOT_PAGE relocation and R_MIPS_GOT16<br>
+  //   relocation against local symbols. They are initialized by higher 16-bit<br>
+  //   of the corresponding symbol's value. So each 64kb of address space<br>
+  //   requires a single GOT entry.<br>
+  // Local entries (16-bit access):<br>
+  //   These entries created by GOT relocations against global non-preemptible<br>
+  //   symbols so dynamic linker is not necessary to resolve the symbol's<br>
+  //   values. "16-bit access" means that corresponding relocations address<br>
+  //   GOT using 16-bit index. Each unique Symbol-Addend pair has its own<br>
+  //   GOT entry.<br>
+  // Local entries (32-bit access):<br>
+  //   These entries are the same as above but created by relocations which<br>
+  //   address GOT using 32-bit index (R_MIPS_GOT_HI16/LO16 etc).<br>
+  // Normal global entries:<br>
+  //   These entries created by GOT relocations against preemptible global<br>
+  //   symbols. They need to be initialized by dynamic linker and they ordered<br>
+  //   exactly as the corresponding entries in the dynamic symbols table.<br>
+  // Reloc-only global entries:<br>
+  //   These entries created for symbols that are referenced by dynamic<br>
+  //   relocations R_MIPS_REL32. These entries are not accessed with gp-relative<br>
+  //   addressing, but MIPS ABI requires that these entries be present in GOT.<br>
+  // TLS entries:<br>
+  //   Entries created by TLS relocations.<br>
+<br>
+  // Total number of allocated "Header" and "Page" entries.<br>
+  uint32_t PageEntriesNum = 0;<br>
   // Output sections referenced by MIPS GOT relocations.<br>
-  llvm::SmallPtrSet<const OutputSectionBase *, 10> MipsOutSections;<br>
-  llvm::DenseMap<uintX_t, size_t> MipsLocalGotPos;<br>
+  llvm::SmallPtrSet<const OutputSectionBase *, 10> OutSections;<br>
+  // Map from "page" address to the GOT index.<br>
+  llvm::DenseMap<uintX_t, size_t> PageIndexMap;<br>
+<br>
+  typedef std::pair<const SymbolBody *, uintX_t> GotEntry;<br>
+  typedef std::vector<GotEntry> GotEntries;<br>
+  // Map from Symbol-Addend pair to the GOT index.<br>
+  llvm::DenseMap<GotEntry, size_t> EntryIndexMap;<br>
+  // Local entries (16-bit access).<br>
+  GotEntries LocalEntries;<br>
+  // Local entries (32-bit access).<br>
+  GotEntries LocalEntries32;<br>
+<br>
+  // Normal and reloc-only global entries.<br>
+  GotEntries GlobalEntries;<br>
<br>
-  // MIPS ABI requires to create unique GOT entry for each Symbol/Addend<br>
-  // pairs. The `MipsGotMap` maps (S,A) pair to the GOT index in the `MipsLocal`<br>
-  // or `MipsGlobal` vectors. In general it does not have a sence to take in<br>
-  // account addend for preemptible symbols because the corresponding<br>
-  // GOT entries should have one-to-one mapping with dynamic symbols table.<br>
-  // But we use the same container's types for both kind of GOT entries<br>
-  // to handle them uniformly.<br>
-  typedef std::pair<const SymbolBody *, uintX_t> MipsGotEntry;<br>
-  typedef std::vector<MipsGotEntry> MipsGotEntries;<br>
-  llvm::DenseMap<MipsGotEntry, size_t> MipsGotMap;<br>
-  MipsGotEntries MipsLocal;<br>
-  MipsGotEntries MipsLocal32;<br>
-  MipsGotEntries MipsGlobal;<br>
+  // TLS entries.<br>
+  std::vector<const SymbolBody *> TlsEntries;<br>
+<br>
+  uint32_t TlsIndexOff = -1;<br>
+  uintX_t Size = 0;<br>
 };<br>
<br>
 template <class ELFT><br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>